-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
55 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
lambdaArn=$1 | ||
lambdaRegion=$2 | ||
snsRegion=$3 | ||
snsRegion=$2 | ||
|
||
lambdaRegion=$(echo $lambdaArn | perl -pe 's/arn:aws:lambda:(.+?):.*/$1/') | ||
|
||
topicArn=$(aws sns create-topic --region $snsRegion --name cf-remote-route53 --query TopicArn --output text) | ||
aws sns subscribe --region $snsRegion --topic-arn $topicArn --protocol lambda --notification-endpoint $lambdaArn | ||
|
||
sid=$(cat /dev/urandom | env LC_CTYPE=C tr -dc a-zA-Z0-9 | head -c 16; echo) | ||
aws lambda add-permission --region $lambdaRegion --function-name $lambdaArn --statement-id $sid --action lambda:invokeFunction \ | ||
aws lambda add-permission --region $lambdaRegion --function-name $lambdaArn \ | ||
--statement-id $sid --action lambda:invokeFunction \ | ||
--principal sns.amazonaws.com --source-arn $topicArn | ||
|
||
echo "" | ||
echo "SNS topic ARN: $topicArn" | ||
echo "Use this ARN in the as the 'ServiceToken' parameter to the Cloud Formation resource." | ||
echo "Use this ARN in the as the 'ServiceToken' parameter to the Cloud Formation resource for templates run in $snsRegion." | ||
echo "" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.