sns-cmd¶
create sns¶
send file as message¶
subscription confirmation¶
echo '{
"Type" : "SubscriptionConfirmation",
"MessageId" : "xxx",
...
"SigningCertURL" : "https://sns.ap-southeast-1.amazonaws.com/SimpleNotificationService-xxx.pem"
}' |tee /tmp/$$.json
message_id=$( cat /tmp/$$.json |jq -r '.MessageId' )
arn=$( cat /tmp/$$.json |jq -r '.TopicArn' )
region=$(echo $arn |awk -F":" '{print $4}')
url=$( cat /tmp/$$.json |jq -r '.SubscribeURL' )
token=$( cat /tmp/$$.json |jq -r '.Token')
aws sns confirm-subscription --topic-arn $arn --token $token --region $region
-
output
-
or
- output
<ConfirmSubscriptionResponse xmlns="http://sns.amazonaws.com/doc/2010-03-31/"> <ConfirmSubscriptionResult> <SubscriptionArn>arn:aws:sns:ap-southeast-1:123456789012:notificate-to-panlm:xxx</SubscriptionArn> </ConfirmSubscriptionResult> <ResponseMetadata> <RequestId>xxx</RequestId> </ResponseMetadata> </ConfirmSubscriptionResponse>