cloudformation-helpers/test/aws/sns.subscribe.template

53 lines
1.6 KiB
Text
Raw Normal View History

{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters": {
"CFHelperStackName": {
"Type": "String",
"Description": "The name of the stack where you installed the CloudFormation helper functions. See https://github.com/gilt/cloudformation-helpers."
}
},
"Resources": {
"CFHelperStack": {
"Type": "AWS::CloudFormation::Stack",
"Properties": {
"TemplateURL": "https://s3.amazonaws.com/com.gilt.public.backoffice/cloudformation_templates/lookup_stack_outputs.template"
}
},
"CFHelper": {
"Type": "Custom::CFHelper",
"Properties": {
"ServiceToken": { "Fn::GetAtt" : ["CFHelperStack", "Outputs.LookupStackOutputsArn"] },
"StackName": { "Ref": "CFHelperStackName" }
},
"DependsOn": [
"CFHelperStack"
]
},
"OriginQueue": {
"Type" : "AWS::SNS::Topic",
"Properties" : {
"TopicName" : { "Fn::Join": [ "-", [ { "Ref" : "AWS::StackName" }, "origin" ] ] }
}
},
"NotificationQueue": {
"Type": "AWS::SQS::Queue",
"Properties": {
"QueueName": { "Fn::Join": [ "-", [ { "Ref" : "AWS::StackName" }, "notifications" ] ] }
}
},
"SnsSubscription": {
"Type": "Custom::SnsSubscription",
"Properties": {
"ServiceToken": { "Fn::GetAtt" : ["CFHelper", "SnsSubscribeFunctionArn"] },
"TopicArn": { "Ref": "OriginQueue" },
"Protocol": "sqs",
"Endpoint": { "Fn::GetAtt" : [ "NotificationQueue", "Arn" ] }
},
"DependsOn": [
"CFHelper",
"OriginQueue",
"NotificationQueue"
]
}
}
}