Class: Awful::Config
Constant Summary
collapse
- COLORS =
{
ACTIVE: :green,
DELETING: :red,
DELETING_RESULTS: :red,
EVALUATING: :yellow,
COMPLIANT: :green,
NON_COMPLIANT: :red,
NOT_APPLICABLE: :yellow,
INSUFFICIENT_DATA: :yellow,
}
Instance Method Summary
collapse
Methods inherited from Cli
#initialize, #ll, #version
Constructor Details
This class inherits a constructor from Awful::Cli
Instance Method Details
35
36
37
38
39
40
|
# File 'lib/awful/config.rb', line 35
def channels
config.describe_delivery_channels.delivery_channels.output do |list|
puts YAML.dump(list.map{ |channel| stringify_keys(channel.to_hash) })
end
end
|
#compliance(rule) ⇒ Object
67
68
69
70
71
72
73
74
75
76
|
# File 'lib/awful/config.rb', line 67
def compliance(rule)
paginate(:evaluation_results) do |next_token|
config.get_compliance_details_by_config_rule(config_rule_name: rule, next_token: next_token)
end.output do |results|
print_table results.map { |r|
q = r.evaluation_result_identifier.evaluation_result_qualifier
[q.resource_type, q.resource_id, color(r.compliance_type), r.result_recorded_time]
}
end
end
|
#dump(*names) ⇒ Object
60
61
62
63
64
|
# File 'lib/awful/config.rb', line 60
def dump(*names)
config.describe_config_rules(config_rule_names: names).config_rules.output do |list|
puts YAML.dump(list.map{ |rule| stringify_keys(rule.to_hash) })
end
end
|
#evaluate(*names) ⇒ Object
79
80
81
|
# File 'lib/awful/config.rb', line 79
def evaluate(*names)
config.start_config_rules_evaluation(config_rule_names: names)
end
|
#recorders ⇒ Object
27
28
29
30
31
32
|
# File 'lib/awful/config.rb', line 27
def recorders
config.describe_configuration_recorders.configuration_recorders.output do |list|
puts YAML.dump(list.map{ |recorder| stringify_keys(recorder.to_hash) })
end
end
|
#rules(*names) ⇒ Object
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
# File 'lib/awful/config.rb', line 44
def rules(*names)
paginate(:config_rules) do |next_token|
config.describe_config_rules(config_rule_names: names)
end.output do |rules|
if options[:long]
print_table rules.map { |r|
s = r.source
[r.config_rule_name, r.config_rule_id, color(r.config_rule_state), r.maximum_execution_frequency, s.owner, s.source_identifier]
}
else
puts rules.map(&:config_rule_name)
end
end
end
|