class RenderCFN::DnsWizard
Public Class Methods
new( arguments )
click to toggle source
# File lib/renderCFN/dnsWizard.rb, line 5 def initialize( arguments ) @title = arguments[:name] @name = "#{@title}DNS" @awsObject = { "#{@title}DNS" => { 'Type' => 'AWS::Route53::RecordSetGroup', 'Properties' => { 'HostedZoneId' => arguments[:zoneID], 'RecordSets' => [ ] }, 'DependsOn' => [] } } end
Public Instance Methods
addARecord(name, ip, ttl = 300)
click to toggle source
# File lib/renderCFN/dnsWizard.rb, line 20 def addARecord(name, ip, ttl = 300) @awsObject[@name]['Properties']['RecordSets'].push( { 'Name' => name, 'ResourceRecords' => [ ip ], 'Type' => 'A', 'TTL'=> ttl } ) end
addCNAMERecord( arguments)
click to toggle source
# File lib/renderCFN/dnsWizard.rb, line 24 def addCNAMERecord( arguments) unless arguments[:ttl] ttl = 300 else ttl = arguments[:ttl] end @awsObject[@name]['Properties']['RecordSets'].push( { 'Name' => arguments[:name], 'ResourceRecords' => [ arguments[:target] ], 'Type' => 'CNAME', 'TTL'=> ttl } ) end
addLbDNS( arguments)
click to toggle source
# File lib/renderCFN/dnsWizard.rb, line 35 def addLbDNS( arguments) @awsObject[@name]['Properties']['RecordSets'].push( { 'Name' => "#{arguments[:name]}.#{@@stackType}.#{@@environmentName}.#{@@environmentType}.#{arguments[:zoneTLD]}", 'Type' => 'A', 'AliasTarget'=> { 'HostedZoneId' => { "Fn::GetAtt" => [ "#{@title}ElasticLoadBalancer", "CanonicalHostedZoneNameID"] }, 'DNSName' => { "Fn::GetAtt" => [ "#{@title}ElasticLoadBalancer", "DNSName"] } } } ) @awsObject[@name]['DependsOn'].push( "#{@title}ElasticLoadBalancer") end