User guide
• CallerReference – (Required) An arbitrary user-defined string that serves as a request ID
and can be used to retry failed requests.
If you run this application multiple times, you must change the CallerReference value.
2. Pass the CreateHostedZoneRequest object to the client object's CreateHostedZone method.
The method returns a CreateHostedZoneResponse object that contains a variety of information
about the request, including the HostedZone.Id property that identifies zone.
[3] Create a resource record set change batch
A hosted zone can have multiple resource record sets. Each set specifies how a subset the domain's
traffic, such as email requests, should be routed.You can update a zone's resource record sets with
a single request. The first step is to package all the updates in a ChangeBatch object. This example
specifies only one update, adding a basic resource record set to the zone, but a ChangeBatch object
can contain updates for multiple resource record sets.
To create a ChangeBatch object
1. Create a ResourceRecordSet object for each resource record set that you want to update. The
group of properties that you specify depends on the type of resource record set. For a complete
description of the properties used by the different resource record sets, see Values that You
Specify When You Create or Edit Amazon Route 53 Resource Record Sets.The example
ResourceRecordSet object represents a basic resource record set, and specifies the following
required properties.
• Name – The domain or subdomain name, www.example.com for this example.
• TTL – The amount of time in seconds that the DNS recursive resolvers should cache information
about this resource record set, 60 seconds for this example.
• Type – The DNS record type, A for this example. For a complete list, see Supported DNS
Resource Record Types.
• ResourceRecords – A list of one or more ResourceRecord objects, each of which contains
a DNS record value that depends on the DNS record type. For an A record type, the record
value is an IPv4 address, which for this example is set to a standard example address,
192.0.2.235.
2. Create a Change object for each for each resource record set, and set the following properties.
• ResourceRecordSet – The ResourceRecordSet object that you created in the previous
step.
• Action – The action to be taken for this resource record set: CREATE, DELETE, or UPSERT.
For more information on these actions, see Elements. This example creates a new resource
record set in the hosted zone, so Action is set to CREATE.
3. Create a ChangeBatch object and set its Changes property to a list of the Change objects that
you created in the previous step.
[4] Update the zone's resource record sets
To update the resource record sets, pass the ChangeBatch object to the hosted zone, as follows.
To update a hosted zone's resource record sets
1. Create a ChangeResourceRecordSetsRequest object with the following property settings.
• HostedZoneId – The hosted zone's ID, which the example sets to the ID that was returned
in the CreateHostedZoneResponse object.
To get the ID of an existing hosted zone, call ListHostedZones.
• ChangeBatch – A ChangeBatch object that contains the updates.
Version v2.0.0
115
AWS SDK for .NET Developer Guide
Updating Amazon Route 53 Resource Record Sets