Class: Jets::Resource::Route53::RecordSet
- Defined in:
- lib/jets/resource/route53/record_set.rb
Instance Method Summary collapse
- #cname ⇒ Object
- #definition ⇒ Object
- #domain_name ⇒ Object
- #endpoint_types ⇒ Object
-
#hosted_zone_name ⇒ Object
IE: mydomain.com.
-
#name ⇒ Object
IE: demo-dev.mydomain.com.
- #outputs ⇒ Object
Methods inherited from Base
Instance Method Details
#cname ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/jets/resource/route53/record_set.rb', line 35 def cname if endpoint_types.include?("REGIONAL") "!GetAtt DomainName.RegionalDomainName" else "!GetAtt DomainName.DistributionDomainName" end end |
#definition ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/jets/resource/route53/record_set.rb', line 17 def definition { dns_record: { type: "AWS::Route53::RecordSet", properties: { hosted_zone_name: hosted_zone_name, comment: "DNS record managed by Jets", name: name, type: "CNAME", ttl: "60", resource_records: [ cname, ], } } } end |
#domain_name ⇒ Object
43 44 45 |
# File 'lib/jets/resource/route53/record_set.rb', line 43 def domain_name Jets::Resource::ApiGateway::DomainName.new end |
#endpoint_types ⇒ Object
48 49 50 |
# File 'lib/jets/resource/route53/record_set.rb', line 48 def endpoint_types domain_name.endpoint_types end |
#hosted_zone_name ⇒ Object
IE: mydomain.com
59 60 61 62 |
# File 'lib/jets/resource/route53/record_set.rb', line 59 def hosted_zone_name name = Jets.config.domain.hosted_zone_name name.ends_with?('.') ? name : "#{name}." # add trailing period if missing end |
#name ⇒ Object
IE: demo-dev.mydomain.com
53 54 55 56 |
# File 'lib/jets/resource/route53/record_set.rb', line 53 def name # Weird looking but correct: domain_name is object and domain_name is also method domain_name.domain_name end |
#outputs ⇒ Object
64 65 66 67 68 |
# File 'lib/jets/resource/route53/record_set.rb', line 64 def outputs { "DnsRecord" => "!Ref DnsRecord", } end |