published on Tuesday, Mar 10, 2026 by Pulumi
published on Tuesday, Mar 10, 2026 by Pulumi
Manages a Route53 Hosted Zone VPC association. VPC associations can only be made on private zones. See the aws.route53.VpcAssociationAuthorization resource for setting up cross-account associations.
NOTE: Unless explicit association ordering is required (e.g., a separate cross-account association authorization), usage of this resource is not recommended. Use the
vpcconfiguration blocks available within theaws.route53.Zoneresource instead.
NOTE: This provider provides both this standalone Zone VPC Association resource and exclusive VPC associations defined in-line in the
aws.route53.Zoneresource viavpcconfiguration blocks. At this time, you cannot use those in-line VPC associations in conjunction with this resource and the same zone ID otherwise it will cause a perpetual difference in plan output. You can optionally useignoreChangesin theaws.route53.Zoneresource to manage additional associations via this resource.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var primary = new Aws.Ec2.Vpc("primary", new()
{
CidrBlock = "10.6.0.0/16",
EnableDnsHostnames = true,
EnableDnsSupport = true,
});
var secondaryVpc = new Aws.Ec2.Vpc("secondaryVpc", new()
{
CidrBlock = "10.7.0.0/16",
EnableDnsHostnames = true,
EnableDnsSupport = true,
});
var example = new Aws.Route53.Zone("example", new()
{
Vpcs = new[]
{
new Aws.Route53.Inputs.ZoneVpcArgs
{
VpcId = primary.Id,
},
},
});
var secondaryZoneAssociation = new Aws.Route53.ZoneAssociation("secondaryZoneAssociation", new()
{
ZoneId = example.ZoneId,
VpcId = secondaryVpc.Id,
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ec2"
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/route53"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
primary, err := ec2.NewVpc(ctx, "primary", &ec2.VpcArgs{
CidrBlock: pulumi.String("10.6.0.0/16"),
EnableDnsHostnames: pulumi.Bool(true),
EnableDnsSupport: pulumi.Bool(true),
})
if err != nil {
return err
}
secondaryVpc, err := ec2.NewVpc(ctx, "secondaryVpc", &ec2.VpcArgs{
CidrBlock: pulumi.String("10.7.0.0/16"),
EnableDnsHostnames: pulumi.Bool(true),
EnableDnsSupport: pulumi.Bool(true),
})
if err != nil {
return err
}
example, err := route53.NewZone(ctx, "example", &route53.ZoneArgs{
Vpcs: route53.ZoneVpcArray{
&route53.ZoneVpcArgs{
VpcId: primary.ID(),
},
},
})
if err != nil {
return err
}
_, err = route53.NewZoneAssociation(ctx, "secondaryZoneAssociation", &route53.ZoneAssociationArgs{
ZoneId: example.ZoneId,
VpcId: secondaryVpc.ID(),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Vpc;
import com.pulumi.aws.ec2.VpcArgs;
import com.pulumi.aws.route53.Zone;
import com.pulumi.aws.route53.ZoneArgs;
import com.pulumi.aws.route53.inputs.ZoneVpcArgs;
import com.pulumi.aws.route53.ZoneAssociation;
import com.pulumi.aws.route53.ZoneAssociationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var primary = new Vpc("primary", VpcArgs.builder()
.cidrBlock("10.6.0.0/16")
.enableDnsHostnames(true)
.enableDnsSupport(true)
.build());
var secondaryVpc = new Vpc("secondaryVpc", VpcArgs.builder()
.cidrBlock("10.7.0.0/16")
.enableDnsHostnames(true)
.enableDnsSupport(true)
.build());
var example = new Zone("example", ZoneArgs.builder()
.vpcs(ZoneVpcArgs.builder()
.vpcId(primary.id())
.build())
.build());
var secondaryZoneAssociation = new ZoneAssociation("secondaryZoneAssociation", ZoneAssociationArgs.builder()
.zoneId(example.zoneId())
.vpcId(secondaryVpc.id())
.build());
}
}
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const primary = new aws.ec2.Vpc("primary", {
cidrBlock: "10.6.0.0/16",
enableDnsHostnames: true,
enableDnsSupport: true,
});
const secondaryVpc = new aws.ec2.Vpc("secondaryVpc", {
cidrBlock: "10.7.0.0/16",
enableDnsHostnames: true,
enableDnsSupport: true,
});
const example = new aws.route53.Zone("example", {vpcs: [{
vpcId: primary.id,
}]});
const secondaryZoneAssociation = new aws.route53.ZoneAssociation("secondaryZoneAssociation", {
zoneId: example.zoneId,
vpcId: secondaryVpc.id,
});
import pulumi
import pulumi_aws as aws
primary = aws.ec2.Vpc("primary",
cidr_block="10.6.0.0/16",
enable_dns_hostnames=True,
enable_dns_support=True)
secondary_vpc = aws.ec2.Vpc("secondaryVpc",
cidr_block="10.7.0.0/16",
enable_dns_hostnames=True,
enable_dns_support=True)
example = aws.route53.Zone("example", vpcs=[aws.route53.ZoneVpcArgs(
vpc_id=primary.id,
)])
secondary_zone_association = aws.route53.ZoneAssociation("secondaryZoneAssociation",
zone_id=example.zone_id,
vpc_id=secondary_vpc.id)
resources:
primary:
type: aws:ec2:Vpc
properties:
cidrBlock: 10.6.0.0/16
enableDnsHostnames: true
enableDnsSupport: true
secondaryVpc:
type: aws:ec2:Vpc
properties:
cidrBlock: 10.7.0.0/16
enableDnsHostnames: true
enableDnsSupport: true
example:
type: aws:route53:Zone
properties:
# NOTE: The aws_route53_zone vpc argument accepts multiple configuration
# # blocks. The below usage of the single vpc configuration, the
# # lifecycle configuration, and the aws_route53_zone_association
# # resource is for illustrative purposes (e.g., for a separate
# # cross-account authorization process, which is not shown here).
vpcs:
- vpcId: ${primary.id}
secondaryZoneAssociation:
type: aws:route53:ZoneAssociation
properties:
zoneId: ${example.zoneId}
vpcId: ${secondaryVpc.id}
Create ZoneAssociation Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ZoneAssociation(name: string, args: ZoneAssociationArgs, opts?: CustomResourceOptions);@overload
def ZoneAssociation(resource_name: str,
args: ZoneAssociationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ZoneAssociation(resource_name: str,
opts: Optional[ResourceOptions] = None,
vpc_id: Optional[str] = None,
zone_id: Optional[str] = None,
vpc_region: Optional[str] = None)func NewZoneAssociation(ctx *Context, name string, args ZoneAssociationArgs, opts ...ResourceOption) (*ZoneAssociation, error)public ZoneAssociation(string name, ZoneAssociationArgs args, CustomResourceOptions? opts = null)
public ZoneAssociation(String name, ZoneAssociationArgs args)
public ZoneAssociation(String name, ZoneAssociationArgs args, CustomResourceOptions options)
type: aws:route53:ZoneAssociation
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ZoneAssociationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ZoneAssociationArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ZoneAssociationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ZoneAssociationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ZoneAssociationArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var zoneAssociationResource = new Aws.Route53.ZoneAssociation("zoneAssociationResource", new()
{
VpcId = "string",
ZoneId = "string",
VpcRegion = "string",
});
example, err := route53.NewZoneAssociation(ctx, "zoneAssociationResource", &route53.ZoneAssociationArgs{
VpcId: pulumi.String("string"),
ZoneId: pulumi.String("string"),
VpcRegion: pulumi.String("string"),
})
var zoneAssociationResource = new ZoneAssociation("zoneAssociationResource", ZoneAssociationArgs.builder()
.vpcId("string")
.zoneId("string")
.vpcRegion("string")
.build());
zone_association_resource = aws.route53.ZoneAssociation("zoneAssociationResource",
vpc_id="string",
zone_id="string",
vpc_region="string")
const zoneAssociationResource = new aws.route53.ZoneAssociation("zoneAssociationResource", {
vpcId: "string",
zoneId: "string",
vpcRegion: "string",
});
type: aws:route53:ZoneAssociation
properties:
vpcId: string
vpcRegion: string
zoneId: string
ZoneAssociation Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ZoneAssociation resource accepts the following input properties:
- vpc_
id str - The VPC to associate with the private hosted zone.
- zone_
id str - The private hosted zone to associate.
- vpc_
region str - The VPC's region. Defaults to the region of the AWS provider.
Outputs
All input properties are implicitly available as output properties. Additionally, the ZoneAssociation resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Owning
Account string - The account ID of the account that created the hosted zone.
- Id string
- The provider-assigned unique ID for this managed resource.
- Owning
Account string - The account ID of the account that created the hosted zone.
- id String
- The provider-assigned unique ID for this managed resource.
- owning
Account String - The account ID of the account that created the hosted zone.
- id string
- The provider-assigned unique ID for this managed resource.
- owning
Account string - The account ID of the account that created the hosted zone.
- id str
- The provider-assigned unique ID for this managed resource.
- owning_
account str - The account ID of the account that created the hosted zone.
- id String
- The provider-assigned unique ID for this managed resource.
- owning
Account String - The account ID of the account that created the hosted zone.
Look up Existing ZoneAssociation Resource
Get an existing ZoneAssociation resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ZoneAssociationState, opts?: CustomResourceOptions): ZoneAssociation@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
owning_account: Optional[str] = None,
vpc_id: Optional[str] = None,
vpc_region: Optional[str] = None,
zone_id: Optional[str] = None) -> ZoneAssociationfunc GetZoneAssociation(ctx *Context, name string, id IDInput, state *ZoneAssociationState, opts ...ResourceOption) (*ZoneAssociation, error)public static ZoneAssociation Get(string name, Input<string> id, ZoneAssociationState? state, CustomResourceOptions? opts = null)public static ZoneAssociation get(String name, Output<String> id, ZoneAssociationState state, CustomResourceOptions options)resources: _: type: aws:route53:ZoneAssociation get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Owning
Account string - The account ID of the account that created the hosted zone.
- Vpc
Id string - The VPC to associate with the private hosted zone.
- Vpc
Region string - The VPC's region. Defaults to the region of the AWS provider.
- Zone
Id string - The private hosted zone to associate.
- Owning
Account string - The account ID of the account that created the hosted zone.
- Vpc
Id string - The VPC to associate with the private hosted zone.
- Vpc
Region string - The VPC's region. Defaults to the region of the AWS provider.
- Zone
Id string - The private hosted zone to associate.
- owning
Account String - The account ID of the account that created the hosted zone.
- vpc
Id String - The VPC to associate with the private hosted zone.
- vpc
Region String - The VPC's region. Defaults to the region of the AWS provider.
- zone
Id String - The private hosted zone to associate.
- owning
Account string - The account ID of the account that created the hosted zone.
- vpc
Id string - The VPC to associate with the private hosted zone.
- vpc
Region string - The VPC's region. Defaults to the region of the AWS provider.
- zone
Id string - The private hosted zone to associate.
- owning_
account str - The account ID of the account that created the hosted zone.
- vpc_
id str - The VPC to associate with the private hosted zone.
- vpc_
region str - The VPC's region. Defaults to the region of the AWS provider.
- zone_
id str - The private hosted zone to associate.
- owning
Account String - The account ID of the account that created the hosted zone.
- vpc
Id String - The VPC to associate with the private hosted zone.
- vpc
Region String - The VPC's region. Defaults to the region of the AWS provider.
- zone
Id String - The private hosted zone to associate.
Import
Route 53 Hosted Zone Associations can be imported via the Hosted Zone ID and VPC ID, separated by a colon (:), e.g.,
$ pulumi import aws:route53/zoneAssociation:ZoneAssociation example Z123456ABCDEFG:vpc-12345678
If the VPC is in a different region than the provider region configuration, the VPC Region can be added to the end. e.g.
$ pulumi import aws:route53/zoneAssociation:ZoneAssociation example Z123456ABCDEFG:vpc-12345678:us-east-2
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.
published on Tuesday, Mar 10, 2026 by Pulumi
