c81f9bca4d
First one to change (as a POC): SnsSubscribe. Main changes: 1. Break each helper out into separate files. 2. Use a directory structure that puts non-AWS on par with AWS. 3. Provide an interface than can be implemented and makes CloudFormation stack deletion required. 4. Provide example templates (which can also be used to test the helpers). I will migrate the other existing helpers in separate commits.
53 lines
No EOL
1.6 KiB
Text
53 lines
No EOL
1.6 KiB
Text
{
|
|
"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"
|
|
]
|
|
}
|
|
}
|
|
} |