Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

AWS Classic

v4.30.0 published on Tuesday, Nov 30, 2021 by Pulumi

VpcAssociationAuthorization

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

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var alternate = new Aws.Provider("alternate", new Aws.ProviderArgs
        {
        });
        var exampleVpc = new Aws.Ec2.Vpc("exampleVpc", new Aws.Ec2.VpcArgs
        {
            CidrBlock = "10.6.0.0/16",
            EnableDnsHostnames = true,
            EnableDnsSupport = true,
        });
        var exampleZone = new Aws.Route53.Zone("exampleZone", new Aws.Route53.ZoneArgs
        {
            Vpcs = 
            {
                new Aws.Route53.Inputs.ZoneVpcArgs
                {
                    VpcId = exampleVpc.Id,
                },
            },
        });
        var alternateVpc = new Aws.Ec2.Vpc("alternateVpc", new Aws.Ec2.VpcArgs
        {
            CidrBlock = "10.7.0.0/16",
            EnableDnsHostnames = true,
            EnableDnsSupport = true,
        }, new CustomResourceOptions
        {
            Provider = "aws.alternate",
        });
        var exampleVpcAssociationAuthorization = new Aws.Route53.VpcAssociationAuthorization("exampleVpcAssociationAuthorization", new Aws.Route53.VpcAssociationAuthorizationArgs
        {
            VpcId = alternateVpc.Id,
            ZoneId = exampleZone.Id,
        });
        var exampleZoneAssociation = new Aws.Route53.ZoneAssociation("exampleZoneAssociation", new Aws.Route53.ZoneAssociationArgs
        {
            VpcId = exampleVpcAssociationAuthorization.VpcId,
            ZoneId = exampleVpcAssociationAuthorization.ZoneId,
        }, new CustomResourceOptions
        {
            Provider = "aws.alternate",
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/providers"
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/route53"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := providers.Newaws(ctx, "alternate", nil)
		if err != nil {
			return err
		}
		exampleVpc, err := ec2.NewVpc(ctx, "exampleVpc", &ec2.VpcArgs{
			CidrBlock:          pulumi.String("10.6.0.0/16"),
			EnableDnsHostnames: pulumi.Bool(true),
			EnableDnsSupport:   pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		exampleZone, err := route53.NewZone(ctx, "exampleZone", &route53.ZoneArgs{
			Vpcs: route53.ZoneVpcArray{
				&route53.ZoneVpcArgs{
					VpcId: exampleVpc.ID(),
				},
			},
		})
		if err != nil {
			return err
		}
		alternateVpc, err := ec2.NewVpc(ctx, "alternateVpc", &ec2.VpcArgs{
			CidrBlock:          pulumi.String("10.7.0.0/16"),
			EnableDnsHostnames: pulumi.Bool(true),
			EnableDnsSupport:   pulumi.Bool(true),
		}, pulumi.Provider("aws.alternate"))
		if err != nil {
			return err
		}
		exampleVpcAssociationAuthorization, err := route53.NewVpcAssociationAuthorization(ctx, "exampleVpcAssociationAuthorization", &route53.VpcAssociationAuthorizationArgs{
			VpcId:  alternateVpc.ID(),
			ZoneId: exampleZone.ID(),
		})
		if err != nil {
			return err
		}
		_, err = route53.NewZoneAssociation(ctx, "exampleZoneAssociation", &route53.ZoneAssociationArgs{
			VpcId:  exampleVpcAssociationAuthorization.VpcId,
			ZoneId: exampleVpcAssociationAuthorization.ZoneId,
		}, pulumi.Provider("aws.alternate"))
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws
import pulumi_pulumi as pulumi

alternate = pulumi.providers.Aws("alternate")
example_vpc = aws.ec2.Vpc("exampleVpc",
    cidr_block="10.6.0.0/16",
    enable_dns_hostnames=True,
    enable_dns_support=True)
example_zone = aws.route53.Zone("exampleZone", vpcs=[aws.route53.ZoneVpcArgs(
    vpc_id=example_vpc.id,
)])
alternate_vpc = aws.ec2.Vpc("alternateVpc",
    cidr_block="10.7.0.0/16",
    enable_dns_hostnames=True,
    enable_dns_support=True,
    opts=pulumi.ResourceOptions(provider="aws.alternate"))
example_vpc_association_authorization = aws.route53.VpcAssociationAuthorization("exampleVpcAssociationAuthorization",
    vpc_id=alternate_vpc.id,
    zone_id=example_zone.id)
example_zone_association = aws.route53.ZoneAssociation("exampleZoneAssociation",
    vpc_id=example_vpc_association_authorization.vpc_id,
    zone_id=example_vpc_association_authorization.zone_id,
    opts=pulumi.ResourceOptions(provider="aws.alternate"))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const alternate = new aws.Provider("alternate", {});
const exampleVpc = new aws.ec2.Vpc("exampleVpc", {
    cidrBlock: "10.6.0.0/16",
    enableDnsHostnames: true,
    enableDnsSupport: true,
});
const exampleZone = new aws.route53.Zone("exampleZone", {vpcs: [{
    vpcId: exampleVpc.id,
}]});
const alternateVpc = new aws.ec2.Vpc("alternateVpc", {
    cidrBlock: "10.7.0.0/16",
    enableDnsHostnames: true,
    enableDnsSupport: true,
}, {
    provider: "aws.alternate",
});
const exampleVpcAssociationAuthorization = new aws.route53.VpcAssociationAuthorization("exampleVpcAssociationAuthorization", {
    vpcId: alternateVpc.id,
    zoneId: exampleZone.id,
});
const exampleZoneAssociation = new aws.route53.ZoneAssociation("exampleZoneAssociation", {
    vpcId: exampleVpcAssociationAuthorization.vpcId,
    zoneId: exampleVpcAssociationAuthorization.zoneId,
}, {
    provider: "aws.alternate",
});

Create a VpcAssociationAuthorization Resource

new VpcAssociationAuthorization(name: string, args: VpcAssociationAuthorizationArgs, opts?: CustomResourceOptions);
@overload
def VpcAssociationAuthorization(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                vpc_id: Optional[str] = None,
                                vpc_region: Optional[str] = None,
                                zone_id: Optional[str] = None)
@overload
def VpcAssociationAuthorization(resource_name: str,
                                args: VpcAssociationAuthorizationArgs,
                                opts: Optional[ResourceOptions] = None)
func NewVpcAssociationAuthorization(ctx *Context, name string, args VpcAssociationAuthorizationArgs, opts ...ResourceOption) (*VpcAssociationAuthorization, error)
public VpcAssociationAuthorization(string name, VpcAssociationAuthorizationArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args VpcAssociationAuthorizationArgs
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 VpcAssociationAuthorizationArgs
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 VpcAssociationAuthorizationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args VpcAssociationAuthorizationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

VpcAssociationAuthorization Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The VpcAssociationAuthorization resource accepts the following input properties:

VpcId string
The VPC to authorize for association with the private hosted zone.
ZoneId string
The ID of the private hosted zone that you want to authorize associating a VPC with.
VpcRegion string
The VPC’s region. Defaults to the region of the AWS provider.
VpcId string
The VPC to authorize for association with the private hosted zone.
ZoneId string
The ID of the private hosted zone that you want to authorize associating a VPC with.
VpcRegion string
The VPC’s region. Defaults to the region of the AWS provider.
vpcId string
The VPC to authorize for association with the private hosted zone.
zoneId string
The ID of the private hosted zone that you want to authorize associating a VPC with.
vpcRegion string
The VPC’s region. Defaults to the region of the AWS provider.
vpc_id str
The VPC to authorize for association with the private hosted zone.
zone_id str
The ID of the private hosted zone that you want to authorize associating a VPC with.
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 VpcAssociationAuthorization resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing VpcAssociationAuthorization Resource

Get an existing VpcAssociationAuthorization 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?: VpcAssociationAuthorizationState, opts?: CustomResourceOptions): VpcAssociationAuthorization
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        vpc_id: Optional[str] = None,
        vpc_region: Optional[str] = None,
        zone_id: Optional[str] = None) -> VpcAssociationAuthorization
func GetVpcAssociationAuthorization(ctx *Context, name string, id IDInput, state *VpcAssociationAuthorizationState, opts ...ResourceOption) (*VpcAssociationAuthorization, error)
public static VpcAssociationAuthorization Get(string name, Input<string> id, VpcAssociationAuthorizationState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

VpcId string
The VPC to authorize for association with the private hosted zone.
VpcRegion string
The VPC’s region. Defaults to the region of the AWS provider.
ZoneId string
The ID of the private hosted zone that you want to authorize associating a VPC with.
VpcId string
The VPC to authorize for association with the private hosted zone.
VpcRegion string
The VPC’s region. Defaults to the region of the AWS provider.
ZoneId string
The ID of the private hosted zone that you want to authorize associating a VPC with.
vpcId string
The VPC to authorize for association with the private hosted zone.
vpcRegion string
The VPC’s region. Defaults to the region of the AWS provider.
zoneId string
The ID of the private hosted zone that you want to authorize associating a VPC with.
vpc_id str
The VPC to authorize for association with the private hosted zone.
vpc_region str
The VPC’s region. Defaults to the region of the AWS provider.
zone_id str
The ID of the private hosted zone that you want to authorize associating a VPC with.

Import

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

 $ pulumi import aws:route53/vpcAssociationAuthorization:VpcAssociationAuthorization example Z123456ABCDEFG:vpc-12345678

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.