Amazon Route 53
API Reference


Associates an Amazon VPC with a private hosted zone.


To perform the association, the VPC and the private hosted zone must already exist. You can't convert a public hosted zone into a private hosted zone.


If you want to associate a VPC that was created by using one AWS account with a private hosted zone that was created by using a different account, the AWS account that created the private hosted zone must first submit a CreateVPCAssociationAuthorization request. Then the account that created the VPC must submit an AssociateVPCWithHostedZone request.

Request Syntax

POST /2013-04-01/hostedzone/Id/associatevpc HTTP/1.1
<?xml version="1.0" encoding="UTF-8"?>
<AssociateVPCWithHostedZoneRequest xmlns="">

URI Request Parameters

The request requires the following URI parameters.


The ID of the private hosted zone that you want to associate an Amazon VPC with.

Note that you can't associate a VPC with a hosted zone that doesn't have an existing VPC association.

Length Constraints: Maximum length of 32.

Request Body

The request accepts the following data in XML format.


Root level tag for the AssociateVPCWithHostedZoneRequest parameters.

Required: Yes


Optional: A comment about the association request.

Type: String

Required: No


A complex type that contains information about the VPC that you want to associate with a private hosted zone.

Type: VPC object

Required: Yes

Response Syntax

HTTP/1.1 200
<?xml version="1.0" encoding="UTF-8"?>

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.


Root level tag for the AssociateVPCWithHostedZoneResponse parameters.

Required: Yes


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

Type: ChangeInfo object


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


The cause of this error depends on whether you're trying to create a public or a private hosted zone:

  • Public hosted zone: Two hosted zones that have the same name or that have a parent/child relationship ( and can't have any common name servers. You tried to create a hosted zone that has the same name as an existing hosted zone or that's the parent or child of an existing hosted zone, and you specified a delegation set that shares one or more name servers with the existing hosted zone.

  • Private hosted zone: You specified an Amazon VPC that you're already using for another hosted zone, and the domain that you specified for one of the hosted zones is a subdomain of the domain that you specified for the other hosted zone. For example, you can't use the same Amazon VPC for the hosted zones for and

HTTP Status Code: 400


The input is not valid.

HTTP Status Code: 400


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


The limits specified for a resource have been exceeded.

HTTP Status Code: 400


No hosted zone exists with the ID that you specified.

HTTP Status Code: 404


Associating the specified VPC with the specified hosted zone has not been authorized.

HTTP Status Code: 401


You're trying to associate a VPC with a public hosted zone. Amazon Route 53 doesn't support associating a VPC with a public hosted zone.

HTTP Status Code: 400


Example Request

POST /2013-04-01/hostedzone/Z1PA6795UKMFR9/associatevpc HTTP/1.1 <?xml version="1.0" encoding="UTF-8"?> <AssociateVPCWithHostedZoneRequest xmlns=""> <VPC> <VPCId>vpc-a1b2c3d4e5</VPCId> <VPCRegion>us-east-2</VPCRegion> <VPC> </AssociateVPCWithHostedZoneRequest>

Example Response

HTTP/1.1 200 OK <?xml version="1.0" encoding="UTF-8"?> <AssociateVPCWithHostedZoneResponse xmlns=""> <ChangeInfo> <Id>/change/a1b2c3d4</Id> <Status>INSYNC</Status> <SubmittedAt>2017-03-31T01:36:41.958Z</SubmittedAt> </ChangeInfo> </AssociateVPCWithHostedZoneResponse>

See Also

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