DisassociateVPCFromHostedZone
Disassociates an Amazon Virtual Private Cloud (Amazon VPC) from an Amazon Route 53 private hosted zone. Note the following:
-
You can't disassociate the last Amazon VPC from a private hosted zone.
-
You can't convert a private hosted zone into a public hosted zone.
-
You can submit a
DisassociateVPCFromHostedZone
request using either the account that created the hosted zone or the account that created the Amazon VPC. -
Some services, such as AWS Cloud Map and Amazon Elastic File System (Amazon EFS) automatically create hosted zones and associate VPCs with the hosted zones. A service can create a hosted zone using your account or using its own account. You can disassociate a VPC from a hosted zone only if the service created the hosted zone using your account.
When you run DisassociateVPCFromHostedZone, if the hosted zone has a value for
OwningAccount
, you can useDisassociateVPCFromHostedZone
. If the hosted zone has a value forOwningService
, you can't useDisassociateVPCFromHostedZone
.
Note
When revoking access, the hosted zone and the Amazon VPC must belong to the same partition. A partition is a group of AWS Regions. Each AWS account is scoped to one partition.
The following are the supported partitions:
-
aws
- AWS Regions -
aws-cn
- China Regions -
aws-us-gov
- AWS GovCloud (US) Region
For more information, see Access Management in the AWS General Reference.
Request Syntax
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 uses 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.
Required: Yes
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
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
This example illustrates one usage of DisassociateVPCFromHostedZone.
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
This example illustrates one usage of DisassociateVPCFromHostedZone.
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: