1. Packages
  2. AWS
  3. API Docs
  4. route53
  5. VpcAssociationAuthorization
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.route53.VpcAssociationAuthorization

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

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

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.ec2.Vpc("example", {
        cidrBlock: "10.6.0.0/16",
        enableDnsHostnames: true,
        enableDnsSupport: true,
    });
    const exampleZone = new aws.route53.Zone("example", {
        name: "example.com",
        vpcs: [{
            vpcId: example.id,
        }],
    });
    const alternate = new aws.ec2.Vpc("alternate", {
        cidrBlock: "10.7.0.0/16",
        enableDnsHostnames: true,
        enableDnsSupport: true,
    });
    const exampleVpcAssociationAuthorization = new aws.route53.VpcAssociationAuthorization("example", {
        vpcId: alternate.id,
        zoneId: exampleZone.id,
    });
    const exampleZoneAssociation = new aws.route53.ZoneAssociation("example", {
        vpcId: exampleVpcAssociationAuthorization.vpcId,
        zoneId: exampleVpcAssociationAuthorization.zoneId,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2.Vpc("example",
        cidr_block="10.6.0.0/16",
        enable_dns_hostnames=True,
        enable_dns_support=True)
    example_zone = aws.route53.Zone("example",
        name="example.com",
        vpcs=[{
            "vpc_id": example.id,
        }])
    alternate = aws.ec2.Vpc("alternate",
        cidr_block="10.7.0.0/16",
        enable_dns_hostnames=True,
        enable_dns_support=True)
    example_vpc_association_authorization = aws.route53.VpcAssociationAuthorization("example",
        vpc_id=alternate.id,
        zone_id=example_zone.id)
    example_zone_association = aws.route53.ZoneAssociation("example",
        vpc_id=example_vpc_association_authorization.vpc_id,
        zone_id=example_vpc_association_authorization.zone_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/route53"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := ec2.NewVpc(ctx, "example", &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, "example", &route53.ZoneArgs{
    			Name: pulumi.String("example.com"),
    			Vpcs: route53.ZoneVpcArray{
    				&route53.ZoneVpcArgs{
    					VpcId: example.ID(),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		alternate, err := ec2.NewVpc(ctx, "alternate", &ec2.VpcArgs{
    			CidrBlock:          pulumi.String("10.7.0.0/16"),
    			EnableDnsHostnames: pulumi.Bool(true),
    			EnableDnsSupport:   pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		exampleVpcAssociationAuthorization, err := route53.NewVpcAssociationAuthorization(ctx, "example", &route53.VpcAssociationAuthorizationArgs{
    			VpcId:  alternate.ID(),
    			ZoneId: exampleZone.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = route53.NewZoneAssociation(ctx, "example", &route53.ZoneAssociationArgs{
    			VpcId:  exampleVpcAssociationAuthorization.VpcId,
    			ZoneId: exampleVpcAssociationAuthorization.ZoneId,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.Ec2.Vpc("example", new()
        {
            CidrBlock = "10.6.0.0/16",
            EnableDnsHostnames = true,
            EnableDnsSupport = true,
        });
    
        var exampleZone = new Aws.Route53.Zone("example", new()
        {
            Name = "example.com",
            Vpcs = new[]
            {
                new Aws.Route53.Inputs.ZoneVpcArgs
                {
                    VpcId = example.Id,
                },
            },
        });
    
        var alternate = new Aws.Ec2.Vpc("alternate", new()
        {
            CidrBlock = "10.7.0.0/16",
            EnableDnsHostnames = true,
            EnableDnsSupport = true,
        });
    
        var exampleVpcAssociationAuthorization = new Aws.Route53.VpcAssociationAuthorization("example", new()
        {
            VpcId = alternate.Id,
            ZoneId = exampleZone.Id,
        });
    
        var exampleZoneAssociation = new Aws.Route53.ZoneAssociation("example", new()
        {
            VpcId = exampleVpcAssociationAuthorization.VpcId,
            ZoneId = exampleVpcAssociationAuthorization.ZoneId,
        });
    
    });
    
    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.VpcAssociationAuthorization;
    import com.pulumi.aws.route53.VpcAssociationAuthorizationArgs;
    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 example = new Vpc("example", VpcArgs.builder()
                .cidrBlock("10.6.0.0/16")
                .enableDnsHostnames(true)
                .enableDnsSupport(true)
                .build());
    
            var exampleZone = new Zone("exampleZone", ZoneArgs.builder()
                .name("example.com")
                .vpcs(ZoneVpcArgs.builder()
                    .vpcId(example.id())
                    .build())
                .build());
    
            var alternate = new Vpc("alternate", VpcArgs.builder()
                .cidrBlock("10.7.0.0/16")
                .enableDnsHostnames(true)
                .enableDnsSupport(true)
                .build());
    
            var exampleVpcAssociationAuthorization = new VpcAssociationAuthorization("exampleVpcAssociationAuthorization", VpcAssociationAuthorizationArgs.builder()
                .vpcId(alternate.id())
                .zoneId(exampleZone.id())
                .build());
    
            var exampleZoneAssociation = new ZoneAssociation("exampleZoneAssociation", ZoneAssociationArgs.builder()
                .vpcId(exampleVpcAssociationAuthorization.vpcId())
                .zoneId(exampleVpcAssociationAuthorization.zoneId())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:ec2:Vpc
        properties:
          cidrBlock: 10.6.0.0/16
          enableDnsHostnames: true
          enableDnsSupport: true
      exampleZone:
        type: aws:route53:Zone
        name: example
        properties:
          name: example.com
          vpcs:
            - vpcId: ${example.id}
      alternate:
        type: aws:ec2:Vpc
        properties:
          cidrBlock: 10.7.0.0/16
          enableDnsHostnames: true
          enableDnsSupport: true
      exampleVpcAssociationAuthorization:
        type: aws:route53:VpcAssociationAuthorization
        name: example
        properties:
          vpcId: ${alternate.id}
          zoneId: ${exampleZone.id}
      exampleZoneAssociation:
        type: aws:route53:ZoneAssociation
        name: example
        properties:
          vpcId: ${exampleVpcAssociationAuthorization.vpcId}
          zoneId: ${exampleVpcAssociationAuthorization.zoneId}
    

    Create VpcAssociationAuthorization Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new VpcAssociationAuthorization(name: string, args: VpcAssociationAuthorizationArgs, opts?: CustomResourceOptions);
    @overload
    def VpcAssociationAuthorization(resource_name: str,
                                    args: VpcAssociationAuthorizationArgs,
                                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def VpcAssociationAuthorization(resource_name: str,
                                    opts: Optional[ResourceOptions] = None,
                                    vpc_id: Optional[str] = None,
                                    zone_id: Optional[str] = None,
                                    vpc_region: Optional[str] = None)
    func NewVpcAssociationAuthorization(ctx *Context, name string, args VpcAssociationAuthorizationArgs, opts ...ResourceOption) (*VpcAssociationAuthorization, error)
    public VpcAssociationAuthorization(string name, VpcAssociationAuthorizationArgs args, CustomResourceOptions? opts = null)
    public VpcAssociationAuthorization(String name, VpcAssociationAuthorizationArgs args)
    public VpcAssociationAuthorization(String name, VpcAssociationAuthorizationArgs args, CustomResourceOptions options)
    
    type: aws:route53:VpcAssociationAuthorization
    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 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.
    name String
    The unique name of the resource.
    args VpcAssociationAuthorizationArgs
    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 vpcAssociationAuthorizationResource = new Aws.Route53.VpcAssociationAuthorization("vpcAssociationAuthorizationResource", new()
    {
        VpcId = "string",
        ZoneId = "string",
        VpcRegion = "string",
    });
    
    example, err := route53.NewVpcAssociationAuthorization(ctx, "vpcAssociationAuthorizationResource", &route53.VpcAssociationAuthorizationArgs{
    	VpcId:     pulumi.String("string"),
    	ZoneId:    pulumi.String("string"),
    	VpcRegion: pulumi.String("string"),
    })
    
    var vpcAssociationAuthorizationResource = new VpcAssociationAuthorization("vpcAssociationAuthorizationResource", VpcAssociationAuthorizationArgs.builder()
        .vpcId("string")
        .zoneId("string")
        .vpcRegion("string")
        .build());
    
    vpc_association_authorization_resource = aws.route53.VpcAssociationAuthorization("vpcAssociationAuthorizationResource",
        vpc_id="string",
        zone_id="string",
        vpc_region="string")
    
    const vpcAssociationAuthorizationResource = new aws.route53.VpcAssociationAuthorization("vpcAssociationAuthorizationResource", {
        vpcId: "string",
        zoneId: "string",
        vpcRegion: "string",
    });
    
    type: aws:route53:VpcAssociationAuthorization
    properties:
        vpcId: string
        vpcRegion: string
        zoneId: string
    

    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

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    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.
    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.
    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.

    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 string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up 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)
    public static VpcAssociationAuthorization get(String name, Output<String> id, VpcAssociationAuthorizationState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    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.
    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.
    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.

    Import

    Using pulumi import, import Route 53 VPC Association Authorizations using the Hosted Zone ID and VPC ID, separated by a colon (:). For example:

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

    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 aws Terraform Provider.
    aws logo
    AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi