Class: AWS::Route53::ResourceRecordSet
- Inherits:
-
Core::Resource
- Object
- Core::Resource
- AWS::Route53::ResourceRecordSet
- Defined in:
- lib/aws/route_53/resource_record_set.rb
Overview
Modify resource record set
rrsets = AWS::Route53::HostedZone.new(hosted_zone_id).rrsets
rrset = rrsets['foo.example.com.', 'A']
rrset.ttl = 3600
rrset.update
Delete existing resource record set
rrsets = AWS::Route53::HostedZone.new(hosted_zone_id).rrsets
rrset = rrsets['foo.example.com.', 'A']
rrset.delete
Instance Attribute Summary collapse
-
#alias_target ⇒ Hash
The current value of alias_target.
- #change_info ⇒ ChangeInfo readonly
-
#hosted_zone_id ⇒ String
readonly
The hosted zone ID.
-
#name ⇒ String
Name.
-
#region ⇒ String
The current value of region.
-
#resource_records ⇒ Array<Hash>
The current value of resource_records.
- #set_identifier ⇒ String (also: #identifier)
-
#ttl ⇒ Integer
The current value of ttl.
- #type ⇒ String
-
#weight ⇒ Integer
The current value of weight.
Instance Method Summary collapse
-
#delete(options = {}) ⇒ ChangeInfo
Delete resource record set.
-
#exists? ⇒ Boolean
Returns
true
if this rrset exists. -
#new_change_batch(options = {}) ⇒ ChangeBatch
Return a new change batch for this hosted zone.
-
#new_create_request ⇒ CreateRequest
Return the create request that #update would include in its change batch.
-
#new_delete_request ⇒ DeleteRequest
Return a delete request that would delete this resource record set.
-
#update(options = {}) ⇒ ResourceRecordSet
Update values of resource record set.
Instance Attribute Details
#alias_target ⇒ Hash
Returns the current value of alias_target.
40 41 42 |
# File 'lib/aws/route_53/resource_record_set.rb', line 40 def alias_target @alias_target end |
#change_info ⇒ ChangeInfo (readonly)
57 58 59 |
# File 'lib/aws/route_53/resource_record_set.rb', line 57 def change_info @change_info end |
#hosted_zone_id ⇒ String (readonly)
Returns The hosted zone ID.
54 55 56 |
# File 'lib/aws/route_53/resource_record_set.rb', line 54 def hosted_zone_id @hosted_zone_id end |
#name ⇒ String
Returns name.
60 61 62 |
# File 'lib/aws/route_53/resource_record_set.rb', line 60 def name @name end |
#region ⇒ String
Returns the current value of region.
40 41 42 |
# File 'lib/aws/route_53/resource_record_set.rb', line 40 def region @region end |
#resource_records ⇒ Array<Hash>
Returns the current value of resource_records.
40 41 42 |
# File 'lib/aws/route_53/resource_record_set.rb', line 40 def resource_records @resource_records end |
#set_identifier ⇒ String Also known as: identifier
78 79 80 |
# File 'lib/aws/route_53/resource_record_set.rb', line 78 def set_identifier @set_identifier end |
#ttl ⇒ Integer
Returns the current value of ttl.
40 41 42 |
# File 'lib/aws/route_53/resource_record_set.rb', line 40 def ttl @ttl end |
#type ⇒ String
69 70 71 |
# File 'lib/aws/route_53/resource_record_set.rb', line 69 def type @type end |
#weight ⇒ Integer
Returns the current value of weight.
40 41 42 |
# File 'lib/aws/route_53/resource_record_set.rb', line 40 def weight @weight end |
Instance Method Details
#delete(options = {}) ⇒ ChangeInfo
Delete resource record set.
172 173 174 175 176 177 |
# File 'lib/aws/route_53/resource_record_set.rb', line 172 def delete = {} batch = new_change_batch() batch << new_delete_request change_info = batch.call() end |
#exists? ⇒ Boolean
Returns true
if this rrset exists.
141 142 143 144 145 146 147 148 149 |
# File 'lib/aws/route_53/resource_record_set.rb', line 141 def exists? !get_resource.data[:resource_record_sets].find { |details| if set_identifier details[:name] == name and details[:type] == type and details[:set_identifier] == set_identifier else details[:name] == name and details[:type] == type end }.nil? end |
#new_change_batch(options = {}) ⇒ ChangeBatch
Return a new change batch for this hosted zone.
182 183 184 |
# File 'lib/aws/route_53/resource_record_set.rb', line 182 def new_change_batch = {} ChangeBatch.new(hosted_zone_id, .merge(:config => config)) end |
#new_create_request ⇒ CreateRequest
Return the create request that #update would include in its change batch. Note that #update also includes a delete request.
189 190 191 192 193 |
# File 'lib/aws/route_53/resource_record_set.rb', line 189 def new_create_request = .merge(@create_options) CreateRequest.new([:name], [:type], ) end |
#new_delete_request ⇒ DeleteRequest
Return a delete request that would delete this resource record set.
197 198 199 200 |
# File 'lib/aws/route_53/resource_record_set.rb', line 197 def new_delete_request = DeleteRequest.new([:name], [:type], ) end |
#update(options = {}) ⇒ ResourceRecordSet
Update values of resource record set.
154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
# File 'lib/aws/route_53/resource_record_set.rb', line 154 def update = {} batch = new_change_batch() AWS.memoize do batch << new_delete_request batch << new_create_request end @change_info = batch.call() @name = @create_options[:name] @type = @create_options[:type] @set_identifier = @create_options[:set_identifier] @create_options = {} self end |