Class: Jets::Cfn::TemplateBuilders::RuleBuilder
Instance Method Summary
collapse
#add_class_iam_policy, #add_common_parameters, #add_function, #add_functions, #add_iam_policy, #initialize, #template_path
Methods included from Interface
#add_output, #add_parameter, #add_resource, #build, #post_process_template, #template, #text, #write
Instance Method Details
#add_config_rule(task, map) ⇒ Object
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/jets/cfn/template_builders/rule_builder.rb', line 20
def add_config_rule(task, map)
add_resource(map.logical_id, "AWS::Config::ConfigRule",
Properties: task.config_rule_properties,
DependsOn: map.permission_logical_id
)
end
|
#add_config_rules ⇒ Object
9
10
11
12
13
14
15
16
17
|
# File 'lib/jets/cfn/template_builders/rule_builder.rb', line 9
def add_config_rules
@app_klass.tasks.each do |task|
map = Jets::Cfn::TemplateMappers::ConfigRuleMapper.new(task)
add_config_rule(task, map)
add_permission(map)
end
end
|
#add_permission(map) ⇒ Object
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# File 'lib/jets/cfn/template_builders/rule_builder.rb', line 39
def add_permission(map)
add_resource(map.permission_logical_id, "AWS::Lambda::Permission",
FunctionName: "!GetAtt #{map.lambda_function_logical_id}.Arn",
Action: "lambda:InvokeFunction",
Principal: "config.amazonaws.com"
)
end
|
#compose ⇒ Object
3
4
5
6
7
|
# File 'lib/jets/cfn/template_builders/rule_builder.rb', line 3
def compose
add_common_parameters
add_functions
add_config_rules
end
|