Sha256: 1e8565fc7ef30fa8644f99d1ad431c46636ab672ef2f8a4e242a46502cb8ab65

Contents?: true

Size: 706 Bytes

Versions: 15

Compression:

Stored size: 706 Bytes

Contents

module Jets::Cfn::Resource::Events
  class Rule < Jets::Cfn::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::Cfn::Resource`
    def merged_properties
      {
        State: "ENABLED",
        Targets: [{
          Arn: "!GetAtt {namespace}LambdaFunction.Arn",
          Id: "{namespace}RuleTarget"
        }]
      }.deep_merge(@props)
    end

    def rule_logical_id
      "{namespace}EventsRule"
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
jets-5.0.13 lib/jets/cfn/resource/events/rule.rb
jets-5.0.12 lib/jets/cfn/resource/events/rule.rb
jets-5.0.11 lib/jets/cfn/resource/events/rule.rb
jets-5.0.10 lib/jets/cfn/resource/events/rule.rb
jets-5.0.9 lib/jets/cfn/resource/events/rule.rb
jets-5.0.8 lib/jets/cfn/resource/events/rule.rb
jets-5.0.7 lib/jets/cfn/resource/events/rule.rb
jets-5.0.6 lib/jets/cfn/resource/events/rule.rb
jets-5.0.5 lib/jets/cfn/resource/events/rule.rb
jets-5.0.4 lib/jets/cfn/resource/events/rule.rb
jets-5.0.3 lib/jets/cfn/resource/events/rule.rb
jets-5.0.2 lib/jets/cfn/resource/events/rule.rb
jets-5.0.1 lib/jets/cfn/resource/events/rule.rb
jets-5.0.0 lib/jets/cfn/resource/events/rule.rb
jets-5.0.0.beta1 lib/jets/cfn/resource/events/rule.rb