Sha256: 3c4f104bff1e55e5ca37741338bc00e5e9d1dee1c80f08816464e41f648525d9

Contents?: true

Size: 709 Bytes

Versions: 136

Compression:

Stored size: 709 Bytes

Contents

module Jets::Resource::Events
  class Rule < Jets::Resource::Base
    def initialize(props={})
      @props = props # associated_properties from dsl.rb
    end

    def definition
      {
        rule_logical_id => {
          type: "AWS::Events::Rule",
          properties: merged_properties
        }
      }
    end

    # Do not name this method properties, that is a computed method of `Jets::Resource::Base`
    def merged_properties
      {
        state: "ENABLED",
        targets: [{
          arn: "!GetAtt {namespace}LambdaFunction.Arn",
          id: "{namespace}RuleTarget"
        }]
      }.deep_merge(@props)
    end

    def rule_logical_id
      "{namespace}_events_rule"
    end
  end
end

Version data entries

136 entries across 136 versions & 3 rubygems

Version Path
jets-2.1.1 lib/jets/resource/events/rule.rb
jets-2.1.0 lib/jets/resource/events/rule.rb
jets-2.0.6 lib/jets/resource/events/rule.rb
jets-2.0.5 lib/jets/resource/events/rule.rb
jets-2.0.4 lib/jets/resource/events/rule.rb
jets-2.0.3 lib/jets/resource/events/rule.rb
jets-2.0.1 lib/jets/resource/events/rule.rb
jets-2.0.0 lib/jets/resource/events/rule.rb
jets-1.9.32 lib/jets/resource/events/rule.rb
jets-1.9.31 lib/jets/resource/events/rule.rb
jets-1.9.30 lib/jets/resource/events/rule.rb
jets-1.9.29 lib/jets/resource/events/rule.rb
jets-1.9.28 lib/jets/resource/events/rule.rb
jets-1.9.27 lib/jets/resource/events/rule.rb
jets-1.9.26 lib/jets/resource/events/rule.rb
jets-1.9.25 lib/jets/resource/events/rule.rb
jets-1.9.24 lib/jets/resource/events/rule.rb
jets-1.9.23 lib/jets/resource/events/rule.rb
jets-1.9.22 lib/jets/resource/events/rule.rb
jets-1.9.21 lib/jets/resource/events/rule.rb