1
votes

I have subscribed with SNS with multiple emails and few emails are wrong and I see the status as "Pending Confirmation". I'm looking for a command to list the subscriptions array having only PendingConfirmation subscriptedARns.

By using the below command I'm getting all the subscription list but I just need Pending Confirmation Subscriptions: aws sns list-subscriptions-by-topic --topic-arn arn:aws:sns:us-east-1:xxxxx:qwertyuuyt

{
    "Subscriptions": [
        {
            "SubscriptionArn": "arn:aws:sns:us-east-1:xxxxxxx:qwertyuuyt:ccffgv-e904-4f68-9a8f-vvggbb",
            "Owner": "xxxxxxx",
            "Protocol": "email",
            "Endpoint": "[email protected]",
            "TopicArn": "arn:aws:sns:us-east-1:xxxxxxx:qwertyuuyt"
        },
        {
            "SubscriptionArn": "PendingConfirmation",
            "Owner": "xxxxxxx",
            "Protocol": "email",
            "Endpoint": "[email protected]",
            "TopicArn": "arn:aws:sns:us-east-1:xxxxxxx:qwertyuuyt"
        },
        {
            "SubscriptionArn": "PendingConfirmation",
            "Owner": "xxxxxxx",
            "Protocol": "email",
            "Endpoint": "[email protected]",
            "TopicArn": "arn:aws:sns:us-east-1:xxxxxxx:qwertyuuyt"
        }`cv`
    ]
}
1

1 Answers

0
votes

You should be able to do it using the following --query:

aws sns list-subscriptions-by-topic --topic-arn arn:aws:sns:us-east-1:xxxxx:qwertyuuyt --query "Subscriptions[?SubscriptionArn=='PendingConfirmation']"