AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

The information for each resource record set that you want to change.

Inheritance Hierarchy

System.Object
  Amazon.Route53.Model.Change

Namespace: Amazon.Route53.Model
Assembly: AWSSDK.Route53.dll
Version: 3.x.y.z

Syntax

C#
public class Change

The Change type exposes the following members

Constructors

NameDescription
Public Method Change()

Empty constructor used to set properties independently even when a simple constructor is available

Public Method Change(ChangeAction, ResourceRecordSet)

Instantiates Change with the parameterized properties

Properties

NameTypeDescription
Public Property Action Amazon.Route53.ChangeAction

Gets and sets the property Action.

The action to perform:

  • CREATE: Creates a resource record set that has the specified values.

  • DELETE: Deletes a existing resource record set.

    To delete the resource record set that is associated with a traffic policy instance, use DeleteTrafficPolicyInstance. Amazon Route 53 will delete the resource record set automatically. If you delete the resource record set by using ChangeResourceRecordSets, Route 53 doesn't automatically delete the traffic policy instance, and you'll continue to be charged for it even though it's no longer in use.

  • UPSERT: If a resource record set doesn't already exist, Route 53 creates it. If a resource record set does exist, Route 53 updates it with the values in the request.

Public Property ResourceRecordSet Amazon.Route53.Model.ResourceRecordSet

Gets and sets the property ResourceRecordSet.

Information about the resource record set to create, delete, or update.

Examples

This example shows how to create an Amazon Route 53 hosted zone and add a resource record set to the zone.

Create a hosted zone and add a resource record set

string domainName = "www.example.org";

IAmazonRoute53 route53Client = new AmazonRoute53Client();

CreateHostedZoneRequest zoneRequest = new CreateHostedZoneRequest
{
  Name = domainName,
  CallerReference = "my_change_request"
};

CreateHostedZoneResponse zoneResponse = route53Client.CreateHostedZone(zoneRequest);

ResourceRecordSet recordSet = new ResourceRecordSet
{
  Name = domainName,
  TTL = 60,
  Type = RRType.A,
  ResourceRecords = new List<ResourceRecord> { new ResourceRecord { Value = "192.0.2.235" } }
};

Change change1 = new Change
{
  ResourceRecordSet = recordSet,
  Action = ChangeAction.CREATE
};

ChangeBatch changeBatch = new ChangeBatch
{
  Changes = new List<Change> { change1 }
};

ChangeResourceRecordSetsRequest recordsetRequest = new ChangeResourceRecordSetsRequest
{
  HostedZoneId = zoneResponse.HostedZone.Id,
  ChangeBatch = changeBatch
};

ChangeResourceRecordSetsResponse recordsetResponse = route53Client.ChangeResourceRecordSets(recordsetRequest);

GetChangeRequest changeRequest = new GetChangeRequest
{
  Id = recordsetResponse.ChangeInfo.Id
};

while (route53Client.GetChange(changeRequest).ChangeInfo.Status == ChangeStatus.PENDING)
{
  Console.WriteLine("Change is pending.");
  Thread.Sleep(TimeSpan.FromSeconds(15));
}
      

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5, 4.0, 3.5