Sha256: f66ff05bb378f22d69b88c0bc8644abf4fecf3ee5c04fbff572d726827b99f75
Contents?: true
Size: 1.02 KB
Versions: 15
Compression:
Stored size: 1.02 KB
Contents
# CloudFormation SNS Topic docs: https://amzn.to/2MYbUZc module Jets::Cfn::Resource::Sns class Topic < Jets::Cfn::Base def initialize(props={}) @props = props # associated_properties from dsl.rb end def definition { topic_logical_id => { Type: "AWS::SNS::Topic", Properties: merged_properties, } } end # Do not name this method properties, that is a computed method of `Jets::Cfn::Resource` def merged_properties display_name = "{namespace} Topic"[0..99] # limit is 100 chars { DisplayName: display_name, # Not setting subscription this way but instead with a SNS::Subscription resource so the interface # is consistent. Leaving comment in here to remind me and in case decide to change this. # Subscription: [ # Endpoint: "!GetAtt {namespace}LambdaFunction.Arn", # Protocol: "lambda" # ] }.deep_merge(@props) end def topic_logical_id "{namespace}SnsTopic" end end end
Version data entries
15 entries across 15 versions & 1 rubygems