Class: Convection::Model::Template::Resource::CloudWatchAlarm
Overview
Instance Attribute Summary
#exist, #name, #parent, #properties, #resource_attributes, #template
Instance Method Summary
collapse
#as_attribute, attach_method, #deletion_policy, #depends_on, #initialize, properties, property, #property, #reference, #render, type, #type, #with_output
#condition, #render_condition
#_terraform_module_dir_to_flag, #_terraform_module_flag_to_dir, attach_resource, attach_resource_collection, resource_collection_dsl_methods, resource_dsl_methods
#camel_case, included, method_name, #screaming_snake_case, #snake_case
#base64, #find_in_map, #fn_and, #fn_equals, #fn_if, #fn_import_value, #fn_not, #fn_or, #fn_ref, #fn_sub, #get_att, #get_azs, included, #join, mixers, #select
Instance Method Details
#actions_enabled ⇒ Object
#actions_enabled(value) ⇒ Object
12
|
# File 'lib/convection/model/template/resource/aws_cloud_watch_alarm.rb', line 12
property :actions_enabled, 'ActionsEnabled', :default => true
|
#alarm_action ⇒ Object
#alarm_action(value) ⇒ Object
13
|
# File 'lib/convection/model/template/resource/aws_cloud_watch_alarm.rb', line 13
property :alarm_action, 'AlarmActions', :type => :list
|
#alarm_description ⇒ Object
#alarm_description(value) ⇒ Object
14
|
# File 'lib/convection/model/template/resource/aws_cloud_watch_alarm.rb', line 14
property :alarm_description, 'AlarmDescription'
|
#alarm_name ⇒ Object
#alarm_name(value) ⇒ Object
15
|
# File 'lib/convection/model/template/resource/aws_cloud_watch_alarm.rb', line 15
property :alarm_name, 'AlarmName'
|
#comparison_operator ⇒ Object
#comparison_operator(value) ⇒ Object
16
|
# File 'lib/convection/model/template/resource/aws_cloud_watch_alarm.rb', line 16
property :comparison_operator, 'ComparisonOperator'
|
#dimension ⇒ Object
#dimension(value) ⇒ Object
17
|
# File 'lib/convection/model/template/resource/aws_cloud_watch_alarm.rb', line 17
property :dimension, 'Dimensions', :type => :list
|
#evaluation_periods ⇒ Object
#evaluation_periods(value) ⇒ Object
18
|
# File 'lib/convection/model/template/resource/aws_cloud_watch_alarm.rb', line 18
property :evaluation_periods, 'EvaluationPeriods'
|
#insufficient_data_action ⇒ Object
#insufficient_data_action(value) ⇒ Object
19
|
# File 'lib/convection/model/template/resource/aws_cloud_watch_alarm.rb', line 19
property :insufficient_data_action, 'InsufficientDataActions', :type => :list
|
#metric_name ⇒ Object
#metric_name(value) ⇒ Object
20
|
# File 'lib/convection/model/template/resource/aws_cloud_watch_alarm.rb', line 20
property :metric_name, 'MetricName'
|
#namespace ⇒ Object
#namespace(value) ⇒ Object
21
|
# File 'lib/convection/model/template/resource/aws_cloud_watch_alarm.rb', line 21
property :namespace, 'Namespace'
|
#ok_action ⇒ Object
#ok_action(value) ⇒ Object
22
|
# File 'lib/convection/model/template/resource/aws_cloud_watch_alarm.rb', line 22
property :ok_action, 'OKActions', :type => :list
|
#period ⇒ Object
#period(value) ⇒ Object
23
|
# File 'lib/convection/model/template/resource/aws_cloud_watch_alarm.rb', line 23
property :period, 'Period'
|
#statistic ⇒ Object
#statistic(value) ⇒ Object
24
|
# File 'lib/convection/model/template/resource/aws_cloud_watch_alarm.rb', line 24
property :statistic, 'Statistic'
|
28
29
30
31
32
33
34
|
# File 'lib/convection/model/template/resource/aws_cloud_watch_alarm.rb', line 28
def terraform_import_commands(module_path: 'root')
prefix = "#{module_path}." unless module_path == 'root'
commands = ['# Run the following commands to import your infrastructure into terraform management.', '# ensure :module_path is set correctly', '']
commands << "terraform import #{prefix}aws_cloudwatch_metric_alarm.#{name.underscore} #{stack.resources[name].physical_resource_id}"
commands << ''
commands
end
|
#threshold ⇒ Object
#threshold(value) ⇒ Object
25
|
# File 'lib/convection/model/template/resource/aws_cloud_watch_alarm.rb', line 25
property :threshold, 'Threshold'
|
#to_hcl_json ⇒ Object
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
# File 'lib/convection/model/template/resource/aws_cloud_watch_alarm.rb', line 36
def to_hcl_json(*)
tf_alarm_attrs = {
alarm_name: alarm_name,
comparison_operator: comparison_operator,
evaluation_periods: evaluation_periods,
metric_name: metric_name,
namespace: namespace,
period: period,
statistic: statistic,
threshold: threshold,
actions_enabled: actions_enabled,
alarm_actions: alarm_action,
alarm_description: alarm_description,
dimensions: dimension,
insufficient_data_actions: insufficient_data_action,
ok_actions: ok_action,
unit: unit
}
tf_alarm_attrs.reject! { |_, v| v.nil? }
tf_alarm = {
aws_cloudwatch_metric_alarm: {
name.underscore => tf_alarm_attrs
}
}
{ resource: [tf_alarm] }.to_json
end
|
#unit ⇒ Object
#unit(value) ⇒ Object
26
|
# File 'lib/convection/model/template/resource/aws_cloud_watch_alarm.rb', line 26
property :unit, 'Unit'
|