Sha256: d67240dcb3e93080f67ed43978e45d77997e84567074bf0a351600b39a779d33

Contents?: true

Size: 741 Bytes

Versions: 136

Compression:

Stored size: 741 Bytes

Contents

# CloudFormation SNS Subscription docs: https://amzn.to/2SJtN3C
module Jets::Resource::Sns
  class Subscription < Jets::Resource::Base
    def initialize(props={})
      @props = props # associated_properties from dsl.rb
    end

    def definition
      {
        subscription_logical_id => {
          type: "AWS::SNS::Subscription",
          properties: merged_properties,
        }
      }
    end

    # Do not name this method properties, that is a computed method of `Jets::Resource::Base`
    def merged_properties
      {
        endpoint: "!GetAtt {namespace}LambdaFunction.Arn",
        protocol: "lambda",
      }.deep_merge(@props)
    end

    def subscription_logical_id
      "{namespace}_sns_subscription"
    end
  end
end

Version data entries

136 entries across 136 versions & 3 rubygems

Version Path
jets-3.0.6 lib/jets/resource/sns/subscription.rb
jets-3.0.5 lib/jets/resource/sns/subscription.rb
jets-3.0.4 lib/jets/resource/sns/subscription.rb
jets-3.0.3 lib/jets/resource/sns/subscription.rb
jets-2.3.19 lib/jets/resource/sns/subscription.rb
jets-3.0.2 lib/jets/resource/sns/subscription.rb
jets-3.0.1 lib/jets/resource/sns/subscription.rb
jets-3.0.0 lib/jets/resource/sns/subscription.rb
jets-2.3.18 lib/jets/resource/sns/subscription.rb
jets-2.3.17 lib/jets/resource/sns/subscription.rb
jets-2.3.16 lib/jets/resource/sns/subscription.rb
jets-2.3.15 lib/jets/resource/sns/subscription.rb
jets-2.3.14 lib/jets/resource/sns/subscription.rb
jets-2.3.13 lib/jets/resource/sns/subscription.rb
jets-2.3.12 lib/jets/resource/sns/subscription.rb
jets-2.3.11 lib/jets/resource/sns/subscription.rb
jets-2.3.10 lib/jets/resource/sns/subscription.rb
jets-2.3.9 lib/jets/resource/sns/subscription.rb
jets-2.3.8 lib/jets/resource/sns/subscription.rb
jets-2.3.7 lib/jets/resource/sns/subscription.rb