Skip to content

error during route53 private zon association for different vpc

0

User: arn:aws:sts::1234567:assumed-role/privatezone-as-AWS679f/privatezone-as-AWS679f is not authorized to perform: route53:AssociateVPCWithHostedZone on resource: arn:aws:ec2:region:1234567:vpc/vpc- because no resource-based policy allows the route53:AssociateVPCWithHostedZone action (RequestId: 90874869-2ffd-42f1-a23d-c9bae25f6108),

which policy required for above error

asked 2 months ago82 views
3 Answers
1

The error occurs because associating a VPC with a private hosted zone across accounts in Amazon Route 53 requires both IAM permissions and an explicit authorization from the hosted zone owner. In addition to having the route53:AssociateVPCWithHostedZone permission on your IAM role, you must create a VPC association authorization in the account that owns the hosted zone. here more info: https://docs.aws.amazon.com/Route53/latest/APIReference/API_AssociateVPCWithHostedZone.html

AWS
answered 2 months ago
EXPERT
reviewed 2 months ago
0
Accepted Answer

This is a common error when associating a Route 53 Private Hosted Zone with a VPC that lives in a different AWS account. The key phrase in the error is "no resource-based policy allows the route53:AssociateVPCWithHostedZone action".

Here's what's happening and how to fix it:

Cross-Account Private Hosted Zone Association

When the VPC and the Private Hosted Zone are in different accounts, you need a two-step authorization process:

Step 1 — From the Hosted Zone account, create an authorization:

aws route53 create-vpc-association-authorization
--hosted-zone-id Z1234567890ABC
--vpc VPCRegion=<region>,VPCId=vpc-oooooooo

This grants the VPC's account permission to associate.

Step 2 — From the VPC account, perform the association:

aws route53 associate-vpc-with-hosted-zone
--hosted-zone-id Z1234567890ABC
--vpc VPCRegion=<region>,VPCId=vpc-oooooooo

Step 3 (cleanup) — From the Hosted Zone account, delete the authorization after association succeeds:

aws route53 delete-vpc-association-authorization
--hosted-zone-id Z1234567890ABC
--vpc VPCRegion=<region>,VPCId=vpc-oooooooo

If both are in the same account

Then the issue is IAM permissions. The role privatezone-as-AWS679f needs:

json { "Effect": "Allow", "Action": [ "route53:AssociateVPCWithHostedZone", "ec2:DescribeVpcs" ], "Resource": "*" }

The ec2:DescribeVpcs permission is also required for the association call to succeed.

  • The authorization in Step 1 must be created before Step 2 — there's no resource-based policy on the hosted zone by default.
  • If using CloudFormation/CDK, you may need a Custom Resource to handle the cross-account authorization flow since AWS::Route53::HostedZoneVPCAssociation doesn't natively support cross- account.
  • The VPC must not already be associated with another private hosted zone that has the same domain name.
AWS
EXPERT
answered 2 months ago
EXPERT
reviewed 2 months ago
0

You need to grant the IAM role explicit permission for the route53:AssociateVPCWithHostedZone action, and in cross‑account scenarios using CreateVPCAssociationAuthorization.

https://docs.aws.amazon.com/Route53/latest/APIReference/route53-apiref.pdf

https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/specifying-conditions-route53.html

EXPERT
answered 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.