Sha256: f67f51c195af3d389ea9f11dc2496227b1405348c3f5ea2a9b4b8bbea181d73b

Contents?: true

Size: 853 Bytes

Versions: 20

Compression:

Stored size: 853 Bytes

Contents

# CloudFormation AWS::IoT::TopicRule docs: https://amzn.to/2SMBOVm
module Jets::Resource::Iot
  class TopicRule < Jets::Resource::Base
    def initialize(props={})
      @props = props # associated_properties from dsl.rb
    end

    def definition
      {
        topic_logical_id => {
          type: "AWS::IoT::TopicRule",
          properties: merged_properties,
        }
      }
    end

    # Do not name this method properties, that is a computed method of `Jets::Resource::Base`
    def merged_properties
      {
        # required properties
        topic_rule_payload: {
          actions: [{
            lambda: { function_arn: "!GetAtt {namespace}LambdaFunction.Arn" }
          }],
          rule_disabled: 'false',
        }
      }.deep_merge(@props)
    end

    def topic_logical_id
      "{namespace}_iot_topic_rule"
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
jets-1.9.7 lib/jets/resource/iot/topic_rule.rb
jets-1.9.6 lib/jets/resource/iot/topic_rule.rb
jets-1.9.5 lib/jets/resource/iot/topic_rule.rb
jets-1.9.4 lib/jets/resource/iot/topic_rule.rb
jets-1.9.3 lib/jets/resource/iot/topic_rule.rb
jets-1.9.2 lib/jets/resource/iot/topic_rule.rb
jets-1.9.1 lib/jets/resource/iot/topic_rule.rb
jets-1.9.0 lib/jets/resource/iot/topic_rule.rb
jets-1.8.14 lib/jets/resource/iot/topic_rule.rb
jets-1.8.13 lib/jets/resource/iot/topic_rule.rb
jets-1.8.12 lib/jets/resource/iot/topic_rule.rb
jets-1.8.11 lib/jets/resource/iot/topic_rule.rb
jets-1.8.10 lib/jets/resource/iot/topic_rule.rb
jets-1.8.9 lib/jets/resource/iot/topic_rule.rb
jets-1.8.8 lib/jets/resource/iot/topic_rule.rb
jets-1.8.7 lib/jets/resource/iot/topic_rule.rb
jets-1.8.6 lib/jets/resource/iot/topic_rule.rb
jets-1.8.5 lib/jets/resource/iot/topic_rule.rb
jets-1.8.4 lib/jets/resource/iot/topic_rule.rb
jets-1.8.3 lib/jets/resource/iot/topic_rule.rb