Class: Pipedream::Sns
- Inherits:
-
Object
- Object
- Pipedream::Sns
- Defined in:
- lib/pipedream/sns.rb
Constant Summary
Constants included from Dsl::Sns
Instance Method Summary collapse
- #default_properties ⇒ Object
-
#initialize(options = {}) ⇒ Sns
constructor
A new instance of Sns.
- #run ⇒ Object
Methods included from Evaluate
Constructor Details
#initialize(options = {}) ⇒ Sns
Returns a new instance of Sns.
6 7 8 9 10 |
# File 'lib/pipedream/sns.rb', line 6 def initialize(={}) @options = @sns_path = [:sns_path] || get_sns_path @properties = default_properties end |
Instance Method Details
#default_properties ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/pipedream/sns.rb', line 24 def default_properties display_name = "#{@options[:full_pipeline_name]} pipeline" { display_name: display_name, # kms_master_key_id: "string", # subscription: [{ # endpoint: '', # protocol: ',' # }], # topic_name: "string", # Not setting because update requires: Replacement. Dont want 2 pipelines to collide } # https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sns-subscription.html end |
#run ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/pipedream/sns.rb', line 12 def run evaluate(@sns_path) if File.exist?(@sns_path) resource = { sns_topic: { type: "AWS::SNS::Topic", properties: @properties } } CfnCamelizer.transform(resource) end |