Skip to content

Resource: awsRoute53VpcAssociationAuthorization

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

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.provider.AwsProvider(this, "aws", {});
new aws.provider.AwsProvider(this, "aws_1", {
  alias: "alternate",
});
const awsVpcAlternate = new aws.vpc.Vpc(this, "alternate", {
  cidrBlock: "10.7.0.0/16",
  enableDnsHostnames: true,
  enableDnsSupport: true,
  provider: "aws.alternate",
});
const awsVpcExample = new aws.vpc.Vpc(this, "example", {
  cidrBlock: "10.6.0.0/16",
  enableDnsHostnames: true,
  enableDnsSupport: true,
});
const awsRoute53ZoneExample = new aws.route53Zone.Route53Zone(
  this,
  "example_4",
  {
    name: "example.com",
    vpc: [
      {
        vpcId: awsVpcExample.id,
      },
    ],
  }
);
awsRoute53ZoneExample.addOverride("lifecycle", [
  {
    ignore_changes: ["${vpc}"],
  },
]);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsRoute53ZoneExample.overrideLogicalId("example");
const awsRoute53VpcAssociationAuthorizationExample =
  new aws.route53VpcAssociationAuthorization.Route53VpcAssociationAuthorization(
    this,
    "example_5",
    {
      vpcId: awsVpcAlternate.id,
      zoneId: awsRoute53ZoneExample.id,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsRoute53VpcAssociationAuthorizationExample.overrideLogicalId("example");
const awsRoute53ZoneAssociationExample =
  new aws.route53ZoneAssociation.Route53ZoneAssociation(this, "example_6", {
    provider: "aws.alternate",
    vpcId: awsRoute53VpcAssociationAuthorizationExample.vpcId,
    zoneId: awsRoute53VpcAssociationAuthorizationExample.zoneId,
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsRoute53ZoneAssociationExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • zoneId - (Required) The ID of the private hosted zone that you want to authorize associating a VPC with.
  • vpcId - (Required) The VPC to authorize for association with the private hosted zone.
  • vpcRegion - (Optional) The VPC's region. Defaults to the region of the AWS provider.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - The calculated unique identifier for the association.

Import

Route 53 VPC Association Authorizations can be imported via the Hosted Zone ID and VPC ID, separated by a colon (:), e.g.,

$ terraform import aws_route53_vpc_association_authorization.example Z123456ABCDEFG:vpc-12345678