View a markdown version of this page

CreateResourceRecordSetProtections - Amazon Route 53

CreateResourceRecordSetProtections

Creates one or more resource record set protections in a hosted zone. A protection applies to every resource record set in the hosted zone that has the specified name and type. While a protection exists, Route 53 rejects any ChangeResourceRecordSets request that creates, updates, or deletes a resource record set with that name and type, and returns an InvalidChangeBatch error. To change a protected resource record set, first delete its protection by using DeleteResourceRecordSetProtections.

You can create a protection for a name and type that doesn't have a resource record set yet. In that case, Route 53 also rejects requests to create that resource record set.

You can't delete a hosted zone that has protections. To delete the hosted zone, first delete all of its protections by using DeleteResourceRecordSetProtections.

The request is atomic. Route 53 either creates all of the protections in the request or none of them. If one or more entries fail, the response is an error that lists the failing entries and the reason that each one failed. Route 53 checks for invalid entries before it checks for existing protections, so if any entry is invalid, the error lists only the invalid entries.

The error that Route 53 returns depends on the failures:

  • If every entry already has a protection, Route 53 returns a ProtectionAlreadyExists error.

  • For any other combination of failures, Route 53 returns an InvalidResourceRecordSetProtectionBatch error.

You can specify up to 100 protections in one request. The number of protections that you can have in a hosted zone is limited by a quota. If the request would exceed that quota, Route 53 returns a LimitsExceeded error.

Request Syntax

POST /2013-04-01/hostedzone/Id/rrsetprotection HTTP/1.1 <?xml version="1.0" encoding="UTF-8"?> <CreateResourceRecordSetProtectionsRequest xmlns="https://route53.amazonaws.com/doc/2013-04-01/"> <Protections> <ResourceRecordSetProtectionConfig> <Comment>string</Comment> <RecordName>string</RecordName> <RecordType>string</RecordType> </ResourceRecordSetProtectionConfig> </Protections> </CreateResourceRecordSetProtectionsRequest>

URI Request Parameters

The request uses the following URI parameters.

Id

The ID of the hosted zone that contains the resource record sets that you want to protect.

Length Constraints: Maximum length of 32.

Required: Yes

Request Body

The request accepts the following data in XML format.

CreateResourceRecordSetProtectionsRequest

Root level tag for the CreateResourceRecordSetProtectionsRequest parameters.

Required: Yes

Protections

The protections to create. Each entry specifies a resource record set name and type, and an optional comment. The list must contain at least one entry and can contain up to 100 entries. Each name and type can appear only once in the list.

Type: Array of ResourceRecordSetProtectionConfig objects

Array Members: Minimum number of 1 item.

Required: Yes

Response Syntax

HTTP/1.1 200

Response Elements

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

Errors

For information about the errors that are common to all actions, see Common Error Types.

InvalidInput

The input is not valid.

message

HTTP Status Code: 400

InvalidResourceRecordSetProtectionBatch

One or more entries in the request couldn't be processed, so Route 53 didn't create or delete any of the protections in the request. The Errors element lists the failing entries and the reason that each one failed.

Errors

The entries that failed, with the reason that each one failed.

Message

A message that explains why Route 53 couldn't process the CreateResourceRecordSetProtections or DeleteResourceRecordSetProtections request.

HTTP Status Code: 400

LimitsExceeded

This operation can't be completed because the current account has reached the limit on the resource you are trying to create. To request a higher limit, create a case with the AWS Support Center.

message

HTTP Status Code: 400

NoSuchHostedZone

No hosted zone exists with the ID that you specified.

message

HTTP Status Code: 404

PriorRequestNotComplete

If Amazon Route 53 can't process a request before the next request arrives, it will reject subsequent requests for the same hosted zone and return an HTTP 400 error (Bad request). If Route 53 returns this error repeatedly for the same request, we recommend that you wait, in intervals of increasing duration, before you try the request again.

HTTP Status Code: 400

ProtectionAlreadyExists

A protection already exists for every name and type in the request, so Route 53 didn't create any protections. The Errors element lists each entry.

Errors

The entries that already have a protection.

Message

A message that explains that a protection already exists for every name and type in the CreateResourceRecordSetProtections request.

HTTP Status Code: 409

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: