User guide
ChangeBatch = changeBatch
};
ChangeResourceRecordSetsResponse recordsetResponse = route53Cli
ent.ChangeResourceRecordSets(recordsetRequest);
//[5] Monitor the change status
GetChangeRequest changeRequest = new GetChangeRequest()
{
Id = recordsetResponse.ChangeInfo.Id
};
while (route53Client.GetChange(changeRequest).ChangeInfo.Status ==
ChangeStatus.PENDING)
{
Console.WriteLine("Change is pending.");
Thread.Sleep(15000);
}
Console.WriteLine("Change is complete.");
Console.ReadKey();
}
}
}
The numbers in the following sections are keyed to the comments in the preceding example.
[1] Create a Client Object
The AmazonRoute53Client class supports a set of public methods that you use to invoke Amazon
Route 53 actions.You create the client object by calling the appropriate object creation method on
the AWSClientFactory class.There are multiple methods, each corresponding to a different constructor.
The object must have the following information.
• An AWS region.
When you call a client method, the underlying HTTP request is sent to this endpoint.
• A credentials profile.
The profile must grant permissions for the actions that you intend to use—the Amazon Route 53
actions in this case. Attempts to call actions that lack permissions will fail. For more information,
see Configuring AWS Credentials (p. 9).
The example uses the default constructor to create the object, which implicitly specifies the application's
default profile and region. Other constructors allow you to override either or both default values.
[2] Create a hosted zone
A hosted zone serves the same purpose as a traditional DNS zone file. It represents a collection of
resource record sets that are managed together under a single domain name.
To create a hosted zone
1. Create a CreateHostedZoneRequest object and specify following request parameters. There
are also two optional parameters that aren't used by this example.
• Name – (Required) The domain name that you want to register, www.example.com for this
example.
This domain name is intended only for examples and can't be registered with a domain name
registrar for an actual site, but you can use it to create a hosted zone for learning purposes.
Version v2.0.0
114
AWS SDK for .NET Developer Guide
Updating Amazon Route 53 Resource Record Sets