AWS Route 53 VPC Association Authorization

This page shows how to write Terraform and CloudFormation for Route 53 VPC Association Authorization and write them securely.

code-icon

Fix issues in your cloud & app configurations

Test for misconfigurations of this resource in your cloud.

get-started-button

Terraform Example (aws_route53_vpc_association_authorization)

Authorizes a VPC in a different account to be associated with a local Route53 Hosted Zone.

Parameters

Example Usage (from GitHub)

github-iconcicdenv/cicdenv
resource "aws_route53_vpc_association_authorization" "private" {
  count = terraform.workspace != "main" ? 1 : 0  # only for cross account

  zone_id = local.private_hosted_zone.zone_id
  vpc_id  = module.shared_vpc.vpc.id

github-iconcicdenv/cicdenv
resource "aws_route53_vpc_association_authorization" "private_ecr" {
  count = terraform.workspace != "main" ? 1 : 0  # only for cross account

  zone_id = local.private_dns_zone_ecr_vpce.zone_id
  vpc_id  = module.shared_vpc.vpc.id

github-iconniveklabs/aws
resource "aws_route53_vpc_association_authorization" "this" {
  vpc_id     = var.vpc_id
  vpc_region = var.vpc_region
  zone_id    = var.zone_id
}

github-iconSebastianUA/terraform
resource "aws_route53_vpc_association_authorization" "route53_vpc_association_authorization" {
  count = var.enable_route53_vpc_association_authorization ? 1 : 0

  zone_id = var.route53_vpc_association_authorization_zone_id
  vpc_id  = var.route53_vpc_association_authorization_vpc_id

github-iconasrkata/SebastianUA-terraform
resource "aws_route53_vpc_association_authorization" "route53_vpc_association_authorization" {
  count = var.enable_route53_vpc_association_authorization ? 1 : 0

  zone_id = var.route53_vpc_association_authorization_zone_id
  vpc_id  = var.route53_vpc_association_authorization_vpc_id

CloudFormation Example (AWS::Route53::HostedZone VPC)

Private hosted zones only: A complex type that contains information about an Amazon VPC. Route 53 Resolver uses the records in the private hosted zone to route traffic in that VPC. Note For public hosted zones, omit VPCs, VPCId, and VPCRegion.

Parameters

VPCId Private hosted zones only: The ID of an Amazon VPC.
For public hosted zones, omit VPCs, VPCId, and VPCRegion. Required: Yes
Type: String
Update requires: No interruption

VPCRegion Private hosted zones only: The region that an Amazon VPC was created in.
For public hosted zones, omit VPCs, VPCId, and VPCRegion. Required: Yes
Type: String
Allowed values: af-south-1 | ap-east-1 | ap-northeast-1 | ap-northeast-2 | ap-northeast-3 | ap-south-1 | ap-southeast-1 | ap-southeast-2 | ca-central-1 | cn-north-1 | eu-central-1 | eu-north-1 | eu-south-1 | eu-west-1 | eu-west-2 | eu-west-3 | me-south-1 | sa-east-1 | us-east-1 | us-east-2 | us-gov-east-1 | us-gov-west-1 | us-iso-east-1 | us-isob-east-1 | us-west-1 | us-west-2
Update requires: No interruption

Frequently asked questions

What is AWS Route 53 VPC Association Authorization?

AWS Route 53 VPC Association Authorization is a resource for Route 53 of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Route 53 VPC Association Authorization?

For Terraform, the cicdenv/cicdenv, cicdenv/cicdenv and niveklabs/aws source code examples are useful. See the Terraform Example section for further details.