01 Get the configuration details from the existing SNS topic subscription, required for the next step. Run get-subscription-attributes command (OSX/Linux/UNIX) using the ARN of the subscription that you want to re-create (see Audit section part II to identify the right resource), to describe all its configuration details:
aws sns get-subscription-attributes
--region us-east-1
--subscription-arn arn:aws:sns:us-east-1:123456789012:mobile-web-sns-topic:f6759ab3-59b5-4a32-bef4-e64582b115e0
02 The command output should return the requested subscription configuration attributes:
{
"Attributes": {
"Endpoint": "http://cloudconformity.com",
"Protocol": "http",
"RawMessageDelivery": "false",
"ConfirmationWasAuthenticated": "true",
"Owner": "123456789012",
"SubscriptionArn": "arn:aws:sns:us-east-1:123456789012:
mobile-web-sns-topic:f6759ab3-59b5-4a32-bef4-e64582b115e0",
"TopicArn": "arn:aws:sns:us-east-1:123456789012:
cloud-conformity-sns-topic"
}
}
03 Run subscribe command (OSX/Linux/UNIX) using the configuration details returned at the previous step to re-create the original SNS topic subscription with the HTTPS delivery protocol by sending a confirmation message to the notification-endpoint (in this case the endpoint used as example is https://cloudconformity.com):
aws sns subscribe
--region us-east-1
--topic-arn arn:aws:sns:us-east-1:123456789012:cloud-conformity-sns-topic
--protocol https
--notification-endpoint https://cloudconformity.com
04 The command output should return the "pending confirmation" status:
{
"SubscriptionArn": "pending confirmation"
}
05 Now run confirm-subscription command (OSX/Linux/UNIX) to confirm the newly created subscription by validating the token sent to the notification endpoint selected (the command does not produce an output):
aws sns confirm-subscription
--topic-arn arn:aws:sns:us-east-1:123456789012:cloud-conformity-sns-topic
--token 59302192f37fb687f5d51e6e241d7700ae02f7124d8268910b858cb4db727ceeb2474bb937929d3bdd7ce5d0cce19325d036bc858d3c217426bcafa9c501a2cace93b83f1dd3797627467553dc438a8c974119496fc3eff026eaa5d14472ded6f9a5c43aec62d83ef5f49109da350761
06 Once your new SNS subscription is confirmed, you can delete the original one from your AWS account by executing unsubscribe command (OSX/Linux/UNIX) with the subscription ARN as identifier (the command does not produce an output):
aws sns unsubscribe
--subscription-arn "arn:aws:sns:us-east-1:123456789012:mobile-web-sns-topic:f6759ab3-59b5-4a32-bef4-e64582b115e0"
07 Repeat steps no. 1 – 6 to implement the HTTPS protocol for other Amazon SNS subscriptions created in the selected region.
08 Change the AWS region by updating the --region command parameter value and repeat steps no. 1 - 7 to perform the entire process for other regions.