class AWS::Route53::HostedZone
# Delete existing hosted zone
hosted_zone = AWS::Route53::HostedZone.new(hosted_zone_id) hosted_zone.delete
@attr_reader [String] name The hosted zone name.
@attr_reader [Integer] resource_record_set_count
The resource record set count.
@attr_reader [Array<String>] delegation_set
Constants
- S3_HOSTED_ZONE_IDS
Attributes
change_info[R]
@return [ChangeInfo] Change info for the newly created HostedZone
instance.
id[R]
@return [String] The hosted zone ID.
Public Class Methods
new(id, options = {})
click to toggle source
@api private
Calls superclass method
AWS::Core::Resource::new
# File lib/aws/route_53/hosted_zone.rb, line 44 def initialize id, options = {} @id = id.sub(%r!^/hostedzone/!, '') @change_info = options[:change_info] super end
Public Instance Methods
associate_vpc(vpc)
click to toggle source
Associates an additional VPC with a private hosted zone. @return [ChangeInfo]
# File lib/aws/route_53/hosted_zone.rb, line 127 def associate_vpc vpc resp = client.associate_vpc_with_hosted_zone(:hosted_zone_id => id, :vpc => vpc) if resp[:change_info][:id] ChangeInfo.new_from(:associate_vpc_with_hosted_zone, resp[:change_info], resp[:change_info][:id]) end end
delete()
click to toggle source
Deletes the hosted zone. @return [ChangeInfo]
# File lib/aws/route_53/hosted_zone.rb, line 100 def delete resp = client.delete_hosted_zone(:id => id) if resp[:change_info][:id] ChangeInfo.new_from(:delete_hosted_zone, resp[:change_info], resp[:change_info][:id], :config => config) end end
disassociate_vpc(vpc)
click to toggle source
Disassociates an VPC from an private hosted zone. @return [ChangeInfo]
# File lib/aws/route_53/hosted_zone.rb, line 138 def disassociate_vpc vpc resp = client.disassociate_vpc_from_hosted_zone(:hosted_zone_id => id, :vpc => vpc) if resp[:change_info][:id] ChangeInfo.new_from(:disassociate_vpc_from_hosted_zone, resp[:change_info], resp[:change_info][:id]) end end
exists?()
click to toggle source
@return [Boolean] Returns ‘true` if this hosted zone exists.
# File lib/aws/route_53/hosted_zone.rb, line 111 def exists? get_resource true rescue Errors::NoSuchHostedZone false end
path()
click to toggle source
The Hosted zone path. @return [String]
# File lib/aws/route_53/hosted_zone.rb, line 59 def path "/hostedzone/#{id}" end
resource_record_sets()
click to toggle source
Returns resource record sets. @return [ResourceRecordSetCollection]
# File lib/aws/route_53/hosted_zone.rb, line 120 def resource_record_sets ResourceRecordSetCollection.new(id, :config => config) end
Also aliased as: rrsets
Protected Instance Methods
get_resource(attr_name = nil)
click to toggle source
# File lib/aws/route_53/hosted_zone.rb, line 153 def get_resource attr_name = nil client.get_hosted_zone(:id => id) end
resource_identifiers()
click to toggle source
# File lib/aws/route_53/hosted_zone.rb, line 149 def resource_identifiers [[:id, id], [:name, name]] end