Class: Jets::Rule::Task
- Inherits:
-
Lambda::Task
- Object
- Lambda::Task
- Jets::Rule::Task
- Defined in:
- lib/jets/rule/task.rb
Instance Attribute Summary collapse
-
#config_rule ⇒ Object
readonly
Returns the value of attribute config_rule.
Attributes inherited from Lambda::Task
#class_name, #iam_policy, #lang, #meth, #properties, #type
Instance Method Summary collapse
- #config_rule_defaults ⇒ Object
- #config_rule_name ⇒ Object
- #config_rule_properties ⇒ Object
- #conventional_config_rule_name ⇒ Object
-
#initialize(class_name, meth, options = {}) ⇒ Task
constructor
A new instance of Task.
Methods inherited from Lambda::Task
#full_handler, #get_type, #handler_base, #handler_path, #lang_ext, #name, #poly_src_path
Constructor Details
#initialize(class_name, meth, options = {}) ⇒ Task
Returns a new instance of Task.
3 4 5 6 |
# File 'lib/jets/rule/task.rb', line 3 def initialize(class_name, meth, ={}) super @config_rule = [:config_rule] || {} end |
Instance Attribute Details
#config_rule ⇒ Object (readonly)
Returns the value of attribute config_rule.
2 3 4 |
# File 'lib/jets/rule/task.rb', line 2 def config_rule @config_rule end |
Instance Method Details
#config_rule_defaults ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/jets/rule/task.rb', line 23 def config_rule_defaults map = Jets::Cfn::TemplateMappers::ConfigRuleMapper.new(self) source_identifier = "!GetAtt #{map.lambda_function_logical_id}.Arn" { "ConfigRuleName" => config_rule_name, "Source" => { "Owner" => "CUSTOM_LAMBDA", "SourceIdentifier" => source_identifier, "SourceDetails" => [ { "EventSource" => "aws.config", "MessageType" => "ConfigurationItemChangeNotification" }, { "EventSource" => "aws.config", "MessageType" => "OversizedConfigurationItemChangeNotification" } ] } } end |
#config_rule_name ⇒ Object
8 9 10 |
# File 'lib/jets/rule/task.rb', line 8 def config_rule_name @properties[:config_rule_name] || conventional_config_rule_name end |
#config_rule_properties ⇒ Object
17 18 19 20 21 |
# File 'lib/jets/rule/task.rb', line 17 def config_rule_properties props = Jets::Pascalize.pascalize(@config_rule) props = config_rule_defaults.merge(props) props end |
#conventional_config_rule_name ⇒ Object
12 13 14 15 |
# File 'lib/jets/rule/task.rb', line 12 def conventional_config_rule_name name_without_rule = @class_name.underscore.gsub(/_rule$/,'') "#{name_without_rule}_#{@meth}".dasherize end |