Class: Convection::Model::Template::Resource::Route53RecordSet
Overview
Constant Summary
collapse
- TF_ASSUMED_RESOURCE_NAME =
'aws_elastic_load_balancing_load_balancer'.freeze
- TF_ACTUAL_RESOURCE_NAME =
'aws_elb'.freeze
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
#alias_target(tgt = nil, &block) ⇒ Object
32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/convection/model/template/resource/aws_route53_recordset.rb', line 32
def alias_target(tgt = nil, &block)
if tgt
alias_tgt tgt
else
a = ResourceProperty::Route53AliasTarget.new(self)
a.instance_exec(&block) if block
properties['AliasTarget'].set(a)
end
end
|
#alias_tgt ⇒ Object
#alias_tgt(value) ⇒ Object
15
|
# File 'lib/convection/model/template/resource/aws_route53_recordset.rb', line 15
property :alias_tgt, 'AliasTarget'
|
16
|
# File 'lib/convection/model/template/resource/aws_route53_recordset.rb', line 16
property :comment, 'Comment'
|
#failover ⇒ Object
#failover(value) ⇒ Object
17
|
# File 'lib/convection/model/template/resource/aws_route53_recordset.rb', line 17
property :failover, 'Failover'
|
#geo_loc ⇒ Object
#geo_loc(value) ⇒ Object
18
|
# File 'lib/convection/model/template/resource/aws_route53_recordset.rb', line 18
property :geo_loc, 'GeoLocation'
|
#geo_location(geo = nil, &block) ⇒ Object
44
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/convection/model/template/resource/aws_route53_recordset.rb', line 44
def geo_location(geo = nil, &block)
if geo
geo_loc geo
else
g = ResourceProperty::Route53GeoLocation.new(self)
g.instance_exec(&block) if block
properties['GeoLocation'].set(g)
end
end
|
#health_check_id ⇒ Object
#health_check_id(value) ⇒ Object
19
|
# File 'lib/convection/model/template/resource/aws_route53_recordset.rb', line 19
property :health_check_id, 'HealthCheckId'
|
#hosted_zone_id ⇒ Object
#hosted_zone_id(value) ⇒ Object
Also known as:
zone
20
|
# File 'lib/convection/model/template/resource/aws_route53_recordset.rb', line 20
property :hosted_zone_id, 'HostedZoneId'
|
#hosted_zone_name ⇒ Object
#hosted_zone_name(value) ⇒ Object
Also known as:
zone_name
22
|
# File 'lib/convection/model/template/resource/aws_route53_recordset.rb', line 22
property :hosted_zone_name, 'HostedZoneName'
|
#record ⇒ Object
#record(value) ⇒ Object
26
|
# File 'lib/convection/model/template/resource/aws_route53_recordset.rb', line 26
property :record, 'ResourceRecords', :array
|
#record_name ⇒ Object
#record_name(value) ⇒ Object
24
|
# File 'lib/convection/model/template/resource/aws_route53_recordset.rb', line 24
property :record_name, 'Name'
|
#record_type ⇒ Object
#record_type(value) ⇒ Object
29
|
# File 'lib/convection/model/template/resource/aws_route53_recordset.rb', line 29
property :record_type, 'Type'
|
#region ⇒ Object
#region(value) ⇒ Object
25
|
# File 'lib/convection/model/template/resource/aws_route53_recordset.rb', line 25
property :region, 'Region'
|
#set_identifier ⇒ Object
#set_identifier(value) ⇒ Object
27
|
# File 'lib/convection/model/template/resource/aws_route53_recordset.rb', line 27
property :set_identifier, 'SetIdentifier'
|
56
57
58
59
60
61
62
63
64
65
|
# File 'lib/convection/model/template/resource/aws_route53_recordset.rb', line 56
def terraform_import_commands(module_path: 'root')
commands = []
commands << '# Import the Route53 record:'
tf_set_id = "_#{set_identifier}" if set_identifier
prefix = "#{module_path}." unless module_path == 'root'
tf_record_name = record_name.sub(/\.$/, '')
commands << "terraform import #{prefix}aws_route53_record.#{name.underscore} #{hosted_zone_id}_#{tf_record_name}_#{record_type}#{tf_set_id}"
commands.map { |cmd| cmd.gsub(stack.region, stack._original_region).gsub(stack.cloud, stack._original_cloud) }
end
|
#to_hcl_json ⇒ Object
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
# File 'lib/convection/model/template/resource/aws_route53_recordset.rb', line 67
def to_hcl_json(*)
tf_record_attrs = {
zone_id: hosted_zone_id,
name: record_name,
type: record_type,
ttl: ttl,
records: tf_records,
set_identifier: set_identifier
}
tf_record_attrs.reject! { |_k, v| v.nil? }
tf_record = {
aws_route53_record: {
name.underscore => tf_record_attrs
}
}
{ resource: [tf_record] }.to_json
end
|
#ttl ⇒ Object
#ttl(value) ⇒ Object
28
|
# File 'lib/convection/model/template/resource/aws_route53_recordset.rb', line 28
property :ttl, 'TTL'
|
#weight ⇒ Object
#weight(value) ⇒ Object
30
|
# File 'lib/convection/model/template/resource/aws_route53_recordset.rb', line 30
property :weight, 'Weight'
|