Class: CfRoute53RecordSet

Inherits:
Object
  • Object
show all
Includes:
CfBase
Defined in:
lib/cf_factory/route53/cf_route53_record_set.rb

Instance Method Summary collapse

Methods included from CfBase

#generate, #generate_ref, #get_deletion_policy, #get_name, #hash_to_string, #retrieve_attribute, #set_meta_data, #set_quotes, #set_tags

Constructor Details

#initialize(name, record_name, record_type, options) ⇒ CfRoute53RecordSet

Returns a new instance of CfRoute53RecordSet.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/cf_factory/route53/cf_route53_record_set.rb', line 5

def initialize(name, record_name, record_type, options)
  @name = name
  @record_name = record_name
  @record_type = record_type
  
  @comment = options[:comment]
  @region = options[:region]
  @hosted_zone_id = options[:hosted_zone_id]
  @hosted_zone_name = options[:hosted_zone_name]      
  @region = options[:region]
  @ttl = options[:ttl]
  @resource_records = options[:resource_records]
  @weight = options[:weight]
  @set_identifier = options[:set_identifier]
  @alias_target = options[:alias_target]
  validate()
end

Instance Method Details

#get_cf_attributesObject



27
28
29
# File 'lib/cf_factory/route53/cf_route53_record_set.rb', line 27

def get_cf_attributes
  {}
end

#get_cf_propertiesObject



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/cf_factory/route53/cf_route53_record_set.rb', line 31

def get_cf_properties
  result = {}
  result["Name"] = @record_name
  result["Type"] = @record_type
  result["Comment"] = @comment unless @comment.nil?
  result["HostedZoneId"] = @hosted_zone_id unless @hosted_zone_id.nil?
  result["HostedZoneName"] = @hosted_zone_name unless @hosted_zone_name.nil?
  result["Region"] = @region unless @region.nil?
  result["TTL"] = @ttl unless @ttl.nil?
  result["Weight"] = @weight unless @weight.nil?
  result["SetIdentifier"] = @set_identifier unless @set_identifier.nil? 
  result["ResourceRecords"] = CfHelper.print_array(@resource_records) unless @resource_records.nil?
  result["AliasTarget"] = @alias_target.generate unless @alias_target.nil?
  result
end

#get_cf_typeObject



23
24
25
# File 'lib/cf_factory/route53/cf_route53_record_set.rb', line 23

def get_cf_type
  "AWS::Route53::RecordSet"
end