Class: Jets::Resource::Sns::TopicPolicy
- Defined in:
- lib/jets/resource/sns/topic_policy.rb
Instance Method Summary collapse
- #definition ⇒ Object
-
#initialize(props = {}) ⇒ TopicPolicy
constructor
A new instance of TopicPolicy.
-
#merged_properties ⇒ Object
Do not name this method properties, that is a computed method of ‘Jets::Resource::Base`.
- #policy_logical_id ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(props = {}) ⇒ TopicPolicy
Returns a new instance of TopicPolicy.
4 5 6 |
# File 'lib/jets/resource/sns/topic_policy.rb', line 4 def initialize(props={}) @props = props # associated_properties from dsl.rb end |
Instance Method Details
#definition ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/jets/resource/sns/topic_policy.rb', line 8 def definition { policy_logical_id => { type: "AWS::SNS::TopicPolicy", properties: merged_properties, } } end |
#merged_properties ⇒ Object
Do not name this method properties, that is a computed method of ‘Jets::Resource::Base`
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/jets/resource/sns/topic_policy.rb', line 18 def merged_properties { policy_document: { 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 |
#policy_logical_id ⇒ Object
36 37 38 |
# File 'lib/jets/resource/sns/topic_policy.rb', line 36 def policy_logical_id "{namespace}_sns_topic_policy" end |