Menu
Amazon Route 53
API Reference

DisassociateVPCFromHostedZone

Disassociates a VPC from a Amazon Route 53 private hosted zone.

Note

You can't disassociate the last VPC from a private hosted zone.

Important

You can't disassociate a VPC from a private hosted zone when only one VPC is associated with the hosted zone. You also can't convert a private hosted zone into a public hosted zone.

Request Syntax

Copy
POST /2013-04-01/hostedzone/Id/disassociatevpc HTTP/1.1 <?xml version="1.0" encoding="UTF-8"?> <DisassociateVPCFromHostedZoneRequest xmlns="https://route53.amazonaws.com/doc/2013-04-01/"> <Comment>string</Comment> <VPC> <VPCId>string</VPCId> <VPCRegion>string</VPCRegion> </VPC> </DisassociateVPCFromHostedZoneRequest>

URI Request Parameters

The request requires the following URI parameters.

Id

The ID of the private hosted zone that you want to disassociate a VPC from.

Length Constraints: Maximum length of 32.

Request Body

The request accepts the following data in XML format.

DisassociateVPCFromHostedZoneRequest

Root level tag for the DisassociateVPCFromHostedZoneRequest parameters.

Required: Yes

Comment

Optional: A comment about the disassociation request.

Type: String

Required: No

VPC

A complex type that contains information about the VPC that you're disassociating from the specified hosted zone.

Type: VPC object

Required: Yes

Response Syntax

Copy
HTTP/1.1 200 <?xml version="1.0" encoding="UTF-8"?> <DisassociateVPCFromHostedZoneResponse> <ChangeInfo> <Comment>string</Comment> <Id>string</Id> <Status>string</Status> <SubmittedAt>timestamp</SubmittedAt> </ChangeInfo> </DisassociateVPCFromHostedZoneResponse>

Response Elements

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

The following data is returned in XML format by the service.

DisassociateVPCFromHostedZoneResponse

Root level tag for the DisassociateVPCFromHostedZoneResponse parameters.

Required: Yes

ChangeInfo

A complex type that describes the changes made to the specified private hosted zone.

Type: ChangeInfo object

Errors

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

InvalidInput

The input is not valid.

HTTP Status Code: 400

InvalidVPCId

The VPC ID that you specified either isn't a valid ID or the current account is not authorized to access this VPC.

HTTP Status Code: 400

LastVPCAssociation

The VPC that you're trying to disassociate from the private hosted zone is the last VPC that is associated with the hosted zone. Amazon Route 53 doesn't support disassociating the last VPC from a hosted zone.

HTTP Status Code: 400

NoSuchHostedZone

No hosted zone exists with the ID that you specified.

HTTP Status Code: 404

VPCAssociationNotFound

The specified VPC and hosted zone are not currently associated.

HTTP Status Code: 404

Examples

Example Request

Copy
POST /2013-04-01/hostedzone/Z1PA6795UKMFR9/disassociatevpc HTTP/1.1 <?xml version="1.0"?> <VPC> <VPCId>vpc-a1b2c3d4e5</VPCId> <VPCRegion>us-east-2</VPCRegion> </VPC> </DisassociateVPCFromHostedZoneRequest>

Example Response

Copy
HTTP/1.1 200 OK <?xml version="1.0" encoding="UTF-8"?> <DisassociateVPCFromHostedZoneResponse xmlns="https://route53.amazonaws.com/doc/2013-04-01/"> <ChangeInfo> <Id>/change/a1b2c3d4</Id> <Status>INSYNC</Status> <SubmittedAt>2017-03-31T01:36:41.958Z</SubmittedAt> </ChangeInfo> </DisassociateVPCFromHostedZoneResponse>

See Also

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