Class: Cumulus::Route53::AliasTarget
- Inherits:
-
Struct
- Object
- Struct
- Cumulus::Route53::AliasTarget
- Defined in:
- lib/route53/models/AliasTarget.rb
Overview
Public: A struct that matches the structure of the AWS alias target struct
Instance Attribute Summary collapse
-
#local_zone_id ⇒ Object
Returns the value of attribute local_zone_id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#dns_name ⇒ Object
Public: Produce the dns_name for this alias.
-
#evaluate_target_health ⇒ Object
Public: Determine whether to evaluate the health check on the target.
-
#hosted_zone_id ⇒ Object
Public: Produce the hosted_zone_id for this alias.
-
#is_cloudfront? ⇒ Boolean
Public: Determine if this alias is for a Cloudfront distribution.
-
#is_elb? ⇒ Boolean
Public: Determine if this alias is for an ELB.
-
#is_record_set? ⇒ Boolean
Public: Determine if this alias is for a record set.
-
#is_s3? ⇒ Boolean
Public: Determine if this alias is for an s3 website.
-
#to_hash ⇒ Object
Public: Produce a hash representing this alias target.
Instance Attribute Details
#local_zone_id ⇒ Object
Returns the value of attribute local_zone_id
8 9 10 |
# File 'lib/route53/models/AliasTarget.rb', line 8 def local_zone_id @local_zone_id end |
#name ⇒ Object
Returns the value of attribute name
8 9 10 |
# File 'lib/route53/models/AliasTarget.rb', line 8 def name @name end |
#type ⇒ Object
Returns the value of attribute type
8 9 10 |
# File 'lib/route53/models/AliasTarget.rb', line 8 def type @type end |
Instance Method Details
#dns_name ⇒ Object
Public: Produce the dns_name for this alias
Returns the dns_name
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/route53/models/AliasTarget.rb', line 12 def dns_name if is_elb? "dualstack.#{ELB::get_aws(name).dns_name}" elsif is_s3? "s3-website-#{S3::get_aws(name).location}.amazonaws.com" elsif is_cloudfront? CloudFront::get_aws(name).domain_name else name end end |
#evaluate_target_health ⇒ Object
Public: Determine whether to evaluate the health check on the target. Always false.
Returns false
53 54 55 |
# File 'lib/route53/models/AliasTarget.rb', line 53 def evaluate_target_health false end |
#hosted_zone_id ⇒ Object
Public: Produce the hosted_zone_id for this alias
Returns the hosted_zone_id
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/route53/models/AliasTarget.rb', line 37 def hosted_zone_id if is_elb? ELB::get_aws(name).canonical_hosted_zone_name_id elsif is_record_set? local_zone_id elsif is_s3? S3::zone_ids[S3::get_aws(name).location] elsif is_cloudfront? "Z2FDTNDATAQYW2" # AWS hard codes this end end |
#is_cloudfront? ⇒ Boolean
Public: Determine if this alias is for a Cloudfront distribution
Returns true if the alias is for a Cloudfront distribution
81 82 83 |
# File 'lib/route53/models/AliasTarget.rb', line 81 def is_cloudfront? type.downcase == "cloudfront" end |
#is_elb? ⇒ Boolean
Public: Determine if this alias is for an ELB
Returns true if the alias is an ELB
60 61 62 |
# File 'lib/route53/models/AliasTarget.rb', line 60 def is_elb? type.downcase == "elb" end |
#is_record_set? ⇒ Boolean
Public: Determine if this alias is for a record set
Returns true if the alias is for a record set
67 68 69 |
# File 'lib/route53/models/AliasTarget.rb', line 67 def is_record_set? type.downcase == "record" end |
#is_s3? ⇒ Boolean
Public: Determine if this alias is for an s3 website
Returns true if the alias is for an s3 website
74 75 76 |
# File 'lib/route53/models/AliasTarget.rb', line 74 def is_s3? type.downcase == "s3" end |
#to_hash ⇒ Object
Public: Produce a hash representing this alias target
Returns the hash
27 28 29 30 31 32 |
# File 'lib/route53/models/AliasTarget.rb', line 27 def to_hash { "name" => name, "type" => type }.reject { |k, v| v.nil? } end |