Sha256: da8d1f488c398197f4bc09469c549a26049b2ec67249a6a1ab02d7f4fe0bae84
Contents?: true
Size: 1.07 KB
Versions: 15
Compression:
Stored size: 1.07 KB
Contents
# CloudFormation SNS TopicPolicy docs: https://amzn.to/2SBMq9v module Jets::Cfn::Resource::Sns class TopicPolicy < Jets::Cfn::Base def initialize(props={}) @props = props # associated_properties from dsl.rb end def definition { policy_logical_id => { Type: "AWS::SNS::TopicPolicy", Properties: merged_properties, } } end # Do not name this method properties, that is a computed method of `Jets::Cfn::Resource` def merged_properties { PolicyDocument: { Version: "2012-10-17", Statement: { Effect: "Allow", Principal: { Service: "s3.amazonaws.com"}, Action: "sns:Publish", Resource: "*", # TODO: figure out good syntax to limit easily # Condition: # ArnLike: # aws:SourceArn: arn:aws:s3:::aa-test-95872017 } }, topics: ["!Ref {namespace}SnsTopic"], }.deep_merge(@props) end def policy_logical_id "{namespace}SnsTopicPolicy" end end end
Version data entries
15 entries across 15 versions & 1 rubygems