Skip to content

sesv2 list-suppressed-destinations is not paginated (only first page is returned) #7859

Description

@adam-nielsen

Describe the bug

Since there is no way to search the list of SES suppressed e-mails for a given address, I launched CloudShell and used this command:

aws sesv2 list-suppressed-destinations --query "SuppressedDestinationSummaries[*].[EmailAddress]" --output text | grep example.com

However I thought I had better test that this is actually returning the full list of addresses, so I counted the number of addresses returned:

aws sesv2 list-suppressed-destinations --query "SuppressedDestinationSummaries[*].[EmailAddress]" --output text | wc -l
1000

It seemed suspicious exactly 1000 addresses were returned, so I tried lowering the page size:

aws sesv2 list-suppressed-destinations --page-size 500 --query "SuppressedDestinationSummaries[*].[EmailAddress]" --output text | wc -l
500

Here, instead of making multiple requests for 500 records each, it only stopped after the first request. I tried to disable pagination to confirm:

aws sesv2 list-suppressed-destinations --page-size 500 --no-paginate --query "SuppressedDestinationSummaries[*].[EmailAddress]" --output text | wc -l
500

Again, I get 500 records. So whether pagination is enabled or disabled, I only get one page of results.

I believe this is a bug, and aws list-suppressed-destinations is not automatically retrieving additional pages when present, as the documentation says it should and as it apparently does for other services.

Expected Behavior

I expected to get the full list of records returned, not limited to just 1000 or 500.

Current Behavior

Only the first page of results were returned.

Reproduction Steps

Add 10 or 15 addresses to the suppression list, then query them via AWS CloudShell:

aws sesv2 list-suppressed-destinations --page-size 5 --query "SuppressedDestinationSummaries[*].[EmailAddress]" --output text | wc -l

You should get a number that matches however many addresses you added.

Possible Solution

Reuse the same pagination code already in use by the other commands.

Additional Information/Context

I have been given an e-mail address that is experiencing issues, and I am trying to find out whether it is included on any of our SES suppression lists.

CLI version used

AWS CloudShell / ap-southeast-2

Environment details (OS name and version, etc.)

AWS CloudShell

Metadata

Metadata

Assignees

No one assigned

    Labels

    p3This is a minor priority issuesesv2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions