1. Packages
  2. AWS Classic
  3. API Docs
  4. ec2
  5. Vpc

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

aws.ec2.Vpc

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

    Provides a VPC resource.

    Example Usage

    Basic usage:

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const main = new aws.ec2.Vpc("main", {cidrBlock: "10.0.0.0/16"});
    
    import pulumi
    import pulumi_aws as aws
    
    main = aws.ec2.Vpc("main", cidr_block="10.0.0.0/16")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ec2.NewVpc(ctx, "main", &ec2.VpcArgs{
    			CidrBlock: pulumi.String("10.0.0.0/16"),
    		})
    		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 main = new Aws.Ec2.Vpc("main", new()
        {
            CidrBlock = "10.0.0.0/16",
        });
    
    });
    
    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 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 main = new Vpc("main", VpcArgs.builder()
                .cidrBlock("10.0.0.0/16")
                .build());
    
        }
    }
    
    resources:
      main:
        type: aws:ec2:Vpc
        properties:
          cidrBlock: 10.0.0.0/16
    

    Basic usage with tags:

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const main = new aws.ec2.Vpc("main", {
        cidrBlock: "10.0.0.0/16",
        instanceTenancy: "default",
        tags: {
            Name: "main",
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    main = aws.ec2.Vpc("main",
        cidr_block="10.0.0.0/16",
        instance_tenancy="default",
        tags={
            "Name": "main",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ec2.NewVpc(ctx, "main", &ec2.VpcArgs{
    			CidrBlock:       pulumi.String("10.0.0.0/16"),
    			InstanceTenancy: pulumi.String("default"),
    			Tags: pulumi.StringMap{
    				"Name": pulumi.String("main"),
    			},
    		})
    		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 main = new Aws.Ec2.Vpc("main", new()
        {
            CidrBlock = "10.0.0.0/16",
            InstanceTenancy = "default",
            Tags = 
            {
                { "Name", "main" },
            },
        });
    
    });
    
    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 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 main = new Vpc("main", VpcArgs.builder()
                .cidrBlock("10.0.0.0/16")
                .instanceTenancy("default")
                .tags(Map.of("Name", "main"))
                .build());
    
        }
    }
    
    resources:
      main:
        type: aws:ec2:Vpc
        properties:
          cidrBlock: 10.0.0.0/16
          instanceTenancy: default
          tags:
            Name: main
    

    VPC with CIDR from AWS IPAM:

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const current = aws.getRegion({});
    const test = new aws.ec2.VpcIpam("test", {operatingRegions: [{
        regionName: current.then(current => current.name),
    }]});
    const testVpcIpamPool = new aws.ec2.VpcIpamPool("test", {
        addressFamily: "ipv4",
        ipamScopeId: test.privateDefaultScopeId,
        locale: current.then(current => current.name),
    });
    const testVpcIpamPoolCidr = new aws.ec2.VpcIpamPoolCidr("test", {
        ipamPoolId: testVpcIpamPool.id,
        cidr: "172.20.0.0/16",
    });
    const testVpc = new aws.ec2.Vpc("test", {
        ipv4IpamPoolId: testVpcIpamPool.id,
        ipv4NetmaskLength: 28,
    }, {
        dependsOn: [testVpcIpamPoolCidr],
    });
    
    import pulumi
    import pulumi_aws as aws
    
    current = aws.get_region()
    test = aws.ec2.VpcIpam("test", operating_regions=[{
        "regionName": current.name,
    }])
    test_vpc_ipam_pool = aws.ec2.VpcIpamPool("test",
        address_family="ipv4",
        ipam_scope_id=test.private_default_scope_id,
        locale=current.name)
    test_vpc_ipam_pool_cidr = aws.ec2.VpcIpamPoolCidr("test",
        ipam_pool_id=test_vpc_ipam_pool.id,
        cidr="172.20.0.0/16")
    test_vpc = aws.ec2.Vpc("test",
        ipv4_ipam_pool_id=test_vpc_ipam_pool.id,
        ipv4_netmask_length=28,
        opts = pulumi.ResourceOptions(depends_on=[test_vpc_ipam_pool_cidr]))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		current, err := aws.GetRegion(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		test, err := ec2.NewVpcIpam(ctx, "test", &ec2.VpcIpamArgs{
    			OperatingRegions: ec2.VpcIpamOperatingRegionArray{
    				&ec2.VpcIpamOperatingRegionArgs{
    					RegionName: pulumi.String(current.Name),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		testVpcIpamPool, err := ec2.NewVpcIpamPool(ctx, "test", &ec2.VpcIpamPoolArgs{
    			AddressFamily: pulumi.String("ipv4"),
    			IpamScopeId:   test.PrivateDefaultScopeId,
    			Locale:        pulumi.String(current.Name),
    		})
    		if err != nil {
    			return err
    		}
    		testVpcIpamPoolCidr, err := ec2.NewVpcIpamPoolCidr(ctx, "test", &ec2.VpcIpamPoolCidrArgs{
    			IpamPoolId: testVpcIpamPool.ID(),
    			Cidr:       pulumi.String("172.20.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ec2.NewVpc(ctx, "test", &ec2.VpcArgs{
    			Ipv4IpamPoolId:    testVpcIpamPool.ID(),
    			Ipv4NetmaskLength: pulumi.Int(28),
    		}, pulumi.DependsOn([]pulumi.Resource{
    			testVpcIpamPoolCidr,
    		}))
    		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 current = Aws.GetRegion.Invoke();
    
        var test = new Aws.Ec2.VpcIpam("test", new()
        {
            OperatingRegions = new[]
            {
                new Aws.Ec2.Inputs.VpcIpamOperatingRegionArgs
                {
                    RegionName = current.Apply(getRegionResult => getRegionResult.Name),
                },
            },
        });
    
        var testVpcIpamPool = new Aws.Ec2.VpcIpamPool("test", new()
        {
            AddressFamily = "ipv4",
            IpamScopeId = test.PrivateDefaultScopeId,
            Locale = current.Apply(getRegionResult => getRegionResult.Name),
        });
    
        var testVpcIpamPoolCidr = new Aws.Ec2.VpcIpamPoolCidr("test", new()
        {
            IpamPoolId = testVpcIpamPool.Id,
            Cidr = "172.20.0.0/16",
        });
    
        var testVpc = new Aws.Ec2.Vpc("test", new()
        {
            Ipv4IpamPoolId = testVpcIpamPool.Id,
            Ipv4NetmaskLength = 28,
        }, new CustomResourceOptions
        {
            DependsOn =
            {
                testVpcIpamPoolCidr,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.AwsFunctions;
    import com.pulumi.aws.inputs.GetRegionArgs;
    import com.pulumi.aws.ec2.VpcIpam;
    import com.pulumi.aws.ec2.VpcIpamArgs;
    import com.pulumi.aws.ec2.inputs.VpcIpamOperatingRegionArgs;
    import com.pulumi.aws.ec2.VpcIpamPool;
    import com.pulumi.aws.ec2.VpcIpamPoolArgs;
    import com.pulumi.aws.ec2.VpcIpamPoolCidr;
    import com.pulumi.aws.ec2.VpcIpamPoolCidrArgs;
    import com.pulumi.aws.ec2.Vpc;
    import com.pulumi.aws.ec2.VpcArgs;
    import com.pulumi.resources.CustomResourceOptions;
    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) {
            final var current = AwsFunctions.getRegion();
    
            var test = new VpcIpam("test", VpcIpamArgs.builder()
                .operatingRegions(VpcIpamOperatingRegionArgs.builder()
                    .regionName(current.applyValue(getRegionResult -> getRegionResult.name()))
                    .build())
                .build());
    
            var testVpcIpamPool = new VpcIpamPool("testVpcIpamPool", VpcIpamPoolArgs.builder()
                .addressFamily("ipv4")
                .ipamScopeId(test.privateDefaultScopeId())
                .locale(current.applyValue(getRegionResult -> getRegionResult.name()))
                .build());
    
            var testVpcIpamPoolCidr = new VpcIpamPoolCidr("testVpcIpamPoolCidr", VpcIpamPoolCidrArgs.builder()
                .ipamPoolId(testVpcIpamPool.id())
                .cidr("172.20.0.0/16")
                .build());
    
            var testVpc = new Vpc("testVpc", VpcArgs.builder()
                .ipv4IpamPoolId(testVpcIpamPool.id())
                .ipv4NetmaskLength(28)
                .build(), CustomResourceOptions.builder()
                    .dependsOn(testVpcIpamPoolCidr)
                    .build());
    
        }
    }
    
    resources:
      test:
        type: aws:ec2:VpcIpam
        properties:
          operatingRegions:
            - regionName: ${current.name}
      testVpcIpamPool:
        type: aws:ec2:VpcIpamPool
        name: test
        properties:
          addressFamily: ipv4
          ipamScopeId: ${test.privateDefaultScopeId}
          locale: ${current.name}
      testVpcIpamPoolCidr:
        type: aws:ec2:VpcIpamPoolCidr
        name: test
        properties:
          ipamPoolId: ${testVpcIpamPool.id}
          cidr: 172.20.0.0/16
      testVpc:
        type: aws:ec2:Vpc
        name: test
        properties:
          ipv4IpamPoolId: ${testVpcIpamPool.id}
          ipv4NetmaskLength: 28
        options:
          dependson:
            - ${testVpcIpamPoolCidr}
    variables:
      current:
        fn::invoke:
          Function: aws:getRegion
          Arguments: {}
    

    Create Vpc Resource

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

    Constructor syntax

    new Vpc(name: string, args?: VpcArgs, opts?: CustomResourceOptions);
    @overload
    def Vpc(resource_name: str,
            args: Optional[VpcArgs] = None,
            opts: Optional[ResourceOptions] = None)
    
    @overload
    def Vpc(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            assign_generated_ipv6_cidr_block: Optional[bool] = None,
            cidr_block: Optional[str] = None,
            enable_dns_hostnames: Optional[bool] = None,
            enable_dns_support: Optional[bool] = None,
            enable_network_address_usage_metrics: Optional[bool] = None,
            instance_tenancy: Optional[str] = None,
            ipv4_ipam_pool_id: Optional[str] = None,
            ipv4_netmask_length: Optional[int] = None,
            ipv6_cidr_block: Optional[str] = None,
            ipv6_cidr_block_network_border_group: Optional[str] = None,
            ipv6_ipam_pool_id: Optional[str] = None,
            ipv6_netmask_length: Optional[int] = None,
            tags: Optional[Mapping[str, str]] = None)
    func NewVpc(ctx *Context, name string, args *VpcArgs, opts ...ResourceOption) (*Vpc, error)
    public Vpc(string name, VpcArgs? args = null, CustomResourceOptions? opts = null)
    public Vpc(String name, VpcArgs args)
    public Vpc(String name, VpcArgs args, CustomResourceOptions options)
    
    type: aws:ec2:Vpc
    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 VpcArgs
    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 VpcArgs
    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 VpcArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VpcArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VpcArgs
    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 vpcResource = new Aws.Ec2.Vpc("vpcResource", new()
    {
        AssignGeneratedIpv6CidrBlock = false,
        CidrBlock = "string",
        EnableDnsHostnames = false,
        EnableDnsSupport = false,
        EnableNetworkAddressUsageMetrics = false,
        InstanceTenancy = "string",
        Ipv4IpamPoolId = "string",
        Ipv4NetmaskLength = 0,
        Ipv6CidrBlock = "string",
        Ipv6CidrBlockNetworkBorderGroup = "string",
        Ipv6IpamPoolId = "string",
        Ipv6NetmaskLength = 0,
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := ec2.NewVpc(ctx, "vpcResource", &ec2.VpcArgs{
    	AssignGeneratedIpv6CidrBlock:     pulumi.Bool(false),
    	CidrBlock:                        pulumi.String("string"),
    	EnableDnsHostnames:               pulumi.Bool(false),
    	EnableDnsSupport:                 pulumi.Bool(false),
    	EnableNetworkAddressUsageMetrics: pulumi.Bool(false),
    	InstanceTenancy:                  pulumi.String("string"),
    	Ipv4IpamPoolId:                   pulumi.String("string"),
    	Ipv4NetmaskLength:                pulumi.Int(0),
    	Ipv6CidrBlock:                    pulumi.String("string"),
    	Ipv6CidrBlockNetworkBorderGroup:  pulumi.String("string"),
    	Ipv6IpamPoolId:                   pulumi.String("string"),
    	Ipv6NetmaskLength:                pulumi.Int(0),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var vpcResource = new Vpc("vpcResource", VpcArgs.builder()
        .assignGeneratedIpv6CidrBlock(false)
        .cidrBlock("string")
        .enableDnsHostnames(false)
        .enableDnsSupport(false)
        .enableNetworkAddressUsageMetrics(false)
        .instanceTenancy("string")
        .ipv4IpamPoolId("string")
        .ipv4NetmaskLength(0)
        .ipv6CidrBlock("string")
        .ipv6CidrBlockNetworkBorderGroup("string")
        .ipv6IpamPoolId("string")
        .ipv6NetmaskLength(0)
        .tags(Map.of("string", "string"))
        .build());
    
    vpc_resource = aws.ec2.Vpc("vpcResource",
        assign_generated_ipv6_cidr_block=False,
        cidr_block="string",
        enable_dns_hostnames=False,
        enable_dns_support=False,
        enable_network_address_usage_metrics=False,
        instance_tenancy="string",
        ipv4_ipam_pool_id="string",
        ipv4_netmask_length=0,
        ipv6_cidr_block="string",
        ipv6_cidr_block_network_border_group="string",
        ipv6_ipam_pool_id="string",
        ipv6_netmask_length=0,
        tags={
            "string": "string",
        })
    
    const vpcResource = new aws.ec2.Vpc("vpcResource", {
        assignGeneratedIpv6CidrBlock: false,
        cidrBlock: "string",
        enableDnsHostnames: false,
        enableDnsSupport: false,
        enableNetworkAddressUsageMetrics: false,
        instanceTenancy: "string",
        ipv4IpamPoolId: "string",
        ipv4NetmaskLength: 0,
        ipv6CidrBlock: "string",
        ipv6CidrBlockNetworkBorderGroup: "string",
        ipv6IpamPoolId: "string",
        ipv6NetmaskLength: 0,
        tags: {
            string: "string",
        },
    });
    
    type: aws:ec2:Vpc
    properties:
        assignGeneratedIpv6CidrBlock: false
        cidrBlock: string
        enableDnsHostnames: false
        enableDnsSupport: false
        enableNetworkAddressUsageMetrics: false
        instanceTenancy: string
        ipv4IpamPoolId: string
        ipv4NetmaskLength: 0
        ipv6CidrBlock: string
        ipv6CidrBlockNetworkBorderGroup: string
        ipv6IpamPoolId: string
        ipv6NetmaskLength: 0
        tags:
            string: string
    

    Vpc 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 Vpc resource accepts the following input properties:

    AssignGeneratedIpv6CidrBlock bool
    Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or the size of the CIDR block. Default is false. Conflicts with ipv6_ipam_pool_id
    CidrBlock string
    The IPv4 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using ipv4_netmask_length.
    EnableDnsHostnames bool
    A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false.
    EnableDnsSupport bool
    A boolean flag to enable/disable DNS support in the VPC. Defaults to true.
    EnableNetworkAddressUsageMetrics bool
    Indicates whether Network Address Usage metrics are enabled for your VPC. Defaults to false.
    InstanceTenancy string
    A tenancy option for instances launched into the VPC. Default is default, which ensures that EC2 instances launched in this VPC use the EC2 instance tenancy attribute specified when the EC2 instance is launched. The only other option is dedicated, which ensures that EC2 instances launched in this VPC are run on dedicated tenancy instances regardless of the tenancy attribute specified at launch. This has a dedicated per region fee of $2 per hour, plus an hourly per instance usage fee.
    Ipv4IpamPoolId string
    The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts. Using IPAM you can monitor IP address usage throughout your AWS Organization.
    Ipv4NetmaskLength int
    The netmask length of the IPv4 CIDR you want to allocate to this VPC. Requires specifying a ipv4_ipam_pool_id.
    Ipv6CidrBlock string
    IPv6 CIDR block to request from an IPAM Pool. Can be set explicitly or derived from IPAM using ipv6_netmask_length.
    Ipv6CidrBlockNetworkBorderGroup string
    By default when an IPv6 CIDR is assigned to a VPC a default ipv6_cidr_block_network_border_group will be set to the region of the VPC. This can be changed to restrict advertisement of public addresses to specific Network Border Groups such as LocalZones.
    Ipv6IpamPoolId string
    IPAM Pool ID for a IPv6 pool. Conflicts with assign_generated_ipv6_cidr_block.
    Ipv6NetmaskLength int
    Netmask length to request from IPAM Pool. Conflicts with ipv6_cidr_block. This can be omitted if IPAM pool as a allocation_default_netmask_length set. Valid values: 56.
    Tags Dictionary<string, string>
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    AssignGeneratedIpv6CidrBlock bool
    Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or the size of the CIDR block. Default is false. Conflicts with ipv6_ipam_pool_id
    CidrBlock string
    The IPv4 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using ipv4_netmask_length.
    EnableDnsHostnames bool
    A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false.
    EnableDnsSupport bool
    A boolean flag to enable/disable DNS support in the VPC. Defaults to true.
    EnableNetworkAddressUsageMetrics bool
    Indicates whether Network Address Usage metrics are enabled for your VPC. Defaults to false.
    InstanceTenancy string
    A tenancy option for instances launched into the VPC. Default is default, which ensures that EC2 instances launched in this VPC use the EC2 instance tenancy attribute specified when the EC2 instance is launched. The only other option is dedicated, which ensures that EC2 instances launched in this VPC are run on dedicated tenancy instances regardless of the tenancy attribute specified at launch. This has a dedicated per region fee of $2 per hour, plus an hourly per instance usage fee.
    Ipv4IpamPoolId string
    The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts. Using IPAM you can monitor IP address usage throughout your AWS Organization.
    Ipv4NetmaskLength int
    The netmask length of the IPv4 CIDR you want to allocate to this VPC. Requires specifying a ipv4_ipam_pool_id.
    Ipv6CidrBlock string
    IPv6 CIDR block to request from an IPAM Pool. Can be set explicitly or derived from IPAM using ipv6_netmask_length.
    Ipv6CidrBlockNetworkBorderGroup string
    By default when an IPv6 CIDR is assigned to a VPC a default ipv6_cidr_block_network_border_group will be set to the region of the VPC. This can be changed to restrict advertisement of public addresses to specific Network Border Groups such as LocalZones.
    Ipv6IpamPoolId string
    IPAM Pool ID for a IPv6 pool. Conflicts with assign_generated_ipv6_cidr_block.
    Ipv6NetmaskLength int
    Netmask length to request from IPAM Pool. Conflicts with ipv6_cidr_block. This can be omitted if IPAM pool as a allocation_default_netmask_length set. Valid values: 56.
    Tags map[string]string
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    assignGeneratedIpv6CidrBlock Boolean
    Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or the size of the CIDR block. Default is false. Conflicts with ipv6_ipam_pool_id
    cidrBlock String
    The IPv4 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using ipv4_netmask_length.
    enableDnsHostnames Boolean
    A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false.
    enableDnsSupport Boolean
    A boolean flag to enable/disable DNS support in the VPC. Defaults to true.
    enableNetworkAddressUsageMetrics Boolean
    Indicates whether Network Address Usage metrics are enabled for your VPC. Defaults to false.
    instanceTenancy String
    A tenancy option for instances launched into the VPC. Default is default, which ensures that EC2 instances launched in this VPC use the EC2 instance tenancy attribute specified when the EC2 instance is launched. The only other option is dedicated, which ensures that EC2 instances launched in this VPC are run on dedicated tenancy instances regardless of the tenancy attribute specified at launch. This has a dedicated per region fee of $2 per hour, plus an hourly per instance usage fee.
    ipv4IpamPoolId String
    The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts. Using IPAM you can monitor IP address usage throughout your AWS Organization.
    ipv4NetmaskLength Integer
    The netmask length of the IPv4 CIDR you want to allocate to this VPC. Requires specifying a ipv4_ipam_pool_id.
    ipv6CidrBlock String
    IPv6 CIDR block to request from an IPAM Pool. Can be set explicitly or derived from IPAM using ipv6_netmask_length.
    ipv6CidrBlockNetworkBorderGroup String
    By default when an IPv6 CIDR is assigned to a VPC a default ipv6_cidr_block_network_border_group will be set to the region of the VPC. This can be changed to restrict advertisement of public addresses to specific Network Border Groups such as LocalZones.
    ipv6IpamPoolId String
    IPAM Pool ID for a IPv6 pool. Conflicts with assign_generated_ipv6_cidr_block.
    ipv6NetmaskLength Integer
    Netmask length to request from IPAM Pool. Conflicts with ipv6_cidr_block. This can be omitted if IPAM pool as a allocation_default_netmask_length set. Valid values: 56.
    tags Map<String,String>
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    assignGeneratedIpv6CidrBlock boolean
    Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or the size of the CIDR block. Default is false. Conflicts with ipv6_ipam_pool_id
    cidrBlock string
    The IPv4 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using ipv4_netmask_length.
    enableDnsHostnames boolean
    A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false.
    enableDnsSupport boolean
    A boolean flag to enable/disable DNS support in the VPC. Defaults to true.
    enableNetworkAddressUsageMetrics boolean
    Indicates whether Network Address Usage metrics are enabled for your VPC. Defaults to false.
    instanceTenancy string
    A tenancy option for instances launched into the VPC. Default is default, which ensures that EC2 instances launched in this VPC use the EC2 instance tenancy attribute specified when the EC2 instance is launched. The only other option is dedicated, which ensures that EC2 instances launched in this VPC are run on dedicated tenancy instances regardless of the tenancy attribute specified at launch. This has a dedicated per region fee of $2 per hour, plus an hourly per instance usage fee.
    ipv4IpamPoolId string
    The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts. Using IPAM you can monitor IP address usage throughout your AWS Organization.
    ipv4NetmaskLength number
    The netmask length of the IPv4 CIDR you want to allocate to this VPC. Requires specifying a ipv4_ipam_pool_id.
    ipv6CidrBlock string
    IPv6 CIDR block to request from an IPAM Pool. Can be set explicitly or derived from IPAM using ipv6_netmask_length.
    ipv6CidrBlockNetworkBorderGroup string
    By default when an IPv6 CIDR is assigned to a VPC a default ipv6_cidr_block_network_border_group will be set to the region of the VPC. This can be changed to restrict advertisement of public addresses to specific Network Border Groups such as LocalZones.
    ipv6IpamPoolId string
    IPAM Pool ID for a IPv6 pool. Conflicts with assign_generated_ipv6_cidr_block.
    ipv6NetmaskLength number
    Netmask length to request from IPAM Pool. Conflicts with ipv6_cidr_block. This can be omitted if IPAM pool as a allocation_default_netmask_length set. Valid values: 56.
    tags {[key: string]: string}
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    assign_generated_ipv6_cidr_block bool
    Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or the size of the CIDR block. Default is false. Conflicts with ipv6_ipam_pool_id
    cidr_block str
    The IPv4 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using ipv4_netmask_length.
    enable_dns_hostnames bool
    A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false.
    enable_dns_support bool
    A boolean flag to enable/disable DNS support in the VPC. Defaults to true.
    enable_network_address_usage_metrics bool
    Indicates whether Network Address Usage metrics are enabled for your VPC. Defaults to false.
    instance_tenancy str
    A tenancy option for instances launched into the VPC. Default is default, which ensures that EC2 instances launched in this VPC use the EC2 instance tenancy attribute specified when the EC2 instance is launched. The only other option is dedicated, which ensures that EC2 instances launched in this VPC are run on dedicated tenancy instances regardless of the tenancy attribute specified at launch. This has a dedicated per region fee of $2 per hour, plus an hourly per instance usage fee.
    ipv4_ipam_pool_id str
    The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts. Using IPAM you can monitor IP address usage throughout your AWS Organization.
    ipv4_netmask_length int
    The netmask length of the IPv4 CIDR you want to allocate to this VPC. Requires specifying a ipv4_ipam_pool_id.
    ipv6_cidr_block str
    IPv6 CIDR block to request from an IPAM Pool. Can be set explicitly or derived from IPAM using ipv6_netmask_length.
    ipv6_cidr_block_network_border_group str
    By default when an IPv6 CIDR is assigned to a VPC a default ipv6_cidr_block_network_border_group will be set to the region of the VPC. This can be changed to restrict advertisement of public addresses to specific Network Border Groups such as LocalZones.
    ipv6_ipam_pool_id str
    IPAM Pool ID for a IPv6 pool. Conflicts with assign_generated_ipv6_cidr_block.
    ipv6_netmask_length int
    Netmask length to request from IPAM Pool. Conflicts with ipv6_cidr_block. This can be omitted if IPAM pool as a allocation_default_netmask_length set. Valid values: 56.
    tags Mapping[str, str]
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    assignGeneratedIpv6CidrBlock Boolean
    Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or the size of the CIDR block. Default is false. Conflicts with ipv6_ipam_pool_id
    cidrBlock String
    The IPv4 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using ipv4_netmask_length.
    enableDnsHostnames Boolean
    A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false.
    enableDnsSupport Boolean
    A boolean flag to enable/disable DNS support in the VPC. Defaults to true.
    enableNetworkAddressUsageMetrics Boolean
    Indicates whether Network Address Usage metrics are enabled for your VPC. Defaults to false.
    instanceTenancy String
    A tenancy option for instances launched into the VPC. Default is default, which ensures that EC2 instances launched in this VPC use the EC2 instance tenancy attribute specified when the EC2 instance is launched. The only other option is dedicated, which ensures that EC2 instances launched in this VPC are run on dedicated tenancy instances regardless of the tenancy attribute specified at launch. This has a dedicated per region fee of $2 per hour, plus an hourly per instance usage fee.
    ipv4IpamPoolId String
    The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts. Using IPAM you can monitor IP address usage throughout your AWS Organization.
    ipv4NetmaskLength Number
    The netmask length of the IPv4 CIDR you want to allocate to this VPC. Requires specifying a ipv4_ipam_pool_id.
    ipv6CidrBlock String
    IPv6 CIDR block to request from an IPAM Pool. Can be set explicitly or derived from IPAM using ipv6_netmask_length.
    ipv6CidrBlockNetworkBorderGroup String
    By default when an IPv6 CIDR is assigned to a VPC a default ipv6_cidr_block_network_border_group will be set to the region of the VPC. This can be changed to restrict advertisement of public addresses to specific Network Border Groups such as LocalZones.
    ipv6IpamPoolId String
    IPAM Pool ID for a IPv6 pool. Conflicts with assign_generated_ipv6_cidr_block.
    ipv6NetmaskLength Number
    Netmask length to request from IPAM Pool. Conflicts with ipv6_cidr_block. This can be omitted if IPAM pool as a allocation_default_netmask_length set. Valid values: 56.
    tags Map<String>
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Vpc resource produces the following output properties:

    Arn string
    Amazon Resource Name (ARN) of VPC
    DefaultNetworkAclId string
    The ID of the network ACL created by default on VPC creation
    DefaultRouteTableId string
    The ID of the route table created by default on VPC creation
    DefaultSecurityGroupId string
    The ID of the security group created by default on VPC creation
    DhcpOptionsId string
    DHCP options id of the desired VPC.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ipv6AssociationId string
    The association ID for the IPv6 CIDR block.
    MainRouteTableId string
    The ID of the main route table associated with this VPC. Note that you can change a VPC's main route table by using an aws.ec2.MainRouteTableAssociation.
    OwnerId string
    The ID of the AWS account that owns the VPC.
    TagsAll Dictionary<string, string>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Arn string
    Amazon Resource Name (ARN) of VPC
    DefaultNetworkAclId string
    The ID of the network ACL created by default on VPC creation
    DefaultRouteTableId string
    The ID of the route table created by default on VPC creation
    DefaultSecurityGroupId string
    The ID of the security group created by default on VPC creation
    DhcpOptionsId string
    DHCP options id of the desired VPC.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ipv6AssociationId string
    The association ID for the IPv6 CIDR block.
    MainRouteTableId string
    The ID of the main route table associated with this VPC. Note that you can change a VPC's main route table by using an aws.ec2.MainRouteTableAssociation.
    OwnerId string
    The ID of the AWS account that owns the VPC.
    TagsAll map[string]string
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn String
    Amazon Resource Name (ARN) of VPC
    defaultNetworkAclId String
    The ID of the network ACL created by default on VPC creation
    defaultRouteTableId String
    The ID of the route table created by default on VPC creation
    defaultSecurityGroupId String
    The ID of the security group created by default on VPC creation
    dhcpOptionsId String
    DHCP options id of the desired VPC.
    id String
    The provider-assigned unique ID for this managed resource.
    ipv6AssociationId String
    The association ID for the IPv6 CIDR block.
    mainRouteTableId String
    The ID of the main route table associated with this VPC. Note that you can change a VPC's main route table by using an aws.ec2.MainRouteTableAssociation.
    ownerId String
    The ID of the AWS account that owns the VPC.
    tagsAll Map<String,String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn string
    Amazon Resource Name (ARN) of VPC
    defaultNetworkAclId string
    The ID of the network ACL created by default on VPC creation
    defaultRouteTableId string
    The ID of the route table created by default on VPC creation
    defaultSecurityGroupId string
    The ID of the security group created by default on VPC creation
    dhcpOptionsId string
    DHCP options id of the desired VPC.
    id string
    The provider-assigned unique ID for this managed resource.
    ipv6AssociationId string
    The association ID for the IPv6 CIDR block.
    mainRouteTableId string
    The ID of the main route table associated with this VPC. Note that you can change a VPC's main route table by using an aws.ec2.MainRouteTableAssociation.
    ownerId string
    The ID of the AWS account that owns the VPC.
    tagsAll {[key: string]: string}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn str
    Amazon Resource Name (ARN) of VPC
    default_network_acl_id str
    The ID of the network ACL created by default on VPC creation
    default_route_table_id str
    The ID of the route table created by default on VPC creation
    default_security_group_id str
    The ID of the security group created by default on VPC creation
    dhcp_options_id str
    DHCP options id of the desired VPC.
    id str
    The provider-assigned unique ID for this managed resource.
    ipv6_association_id str
    The association ID for the IPv6 CIDR block.
    main_route_table_id str
    The ID of the main route table associated with this VPC. Note that you can change a VPC's main route table by using an aws.ec2.MainRouteTableAssociation.
    owner_id str
    The ID of the AWS account that owns the VPC.
    tags_all Mapping[str, str]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn String
    Amazon Resource Name (ARN) of VPC
    defaultNetworkAclId String
    The ID of the network ACL created by default on VPC creation
    defaultRouteTableId String
    The ID of the route table created by default on VPC creation
    defaultSecurityGroupId String
    The ID of the security group created by default on VPC creation
    dhcpOptionsId String
    DHCP options id of the desired VPC.
    id String
    The provider-assigned unique ID for this managed resource.
    ipv6AssociationId String
    The association ID for the IPv6 CIDR block.
    mainRouteTableId String
    The ID of the main route table associated with this VPC. Note that you can change a VPC's main route table by using an aws.ec2.MainRouteTableAssociation.
    ownerId String
    The ID of the AWS account that owns the VPC.
    tagsAll Map<String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Look up Existing Vpc Resource

    Get an existing Vpc 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?: VpcState, opts?: CustomResourceOptions): Vpc
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            arn: Optional[str] = None,
            assign_generated_ipv6_cidr_block: Optional[bool] = None,
            cidr_block: Optional[str] = None,
            default_network_acl_id: Optional[str] = None,
            default_route_table_id: Optional[str] = None,
            default_security_group_id: Optional[str] = None,
            dhcp_options_id: Optional[str] = None,
            enable_dns_hostnames: Optional[bool] = None,
            enable_dns_support: Optional[bool] = None,
            enable_network_address_usage_metrics: Optional[bool] = None,
            instance_tenancy: Optional[str] = None,
            ipv4_ipam_pool_id: Optional[str] = None,
            ipv4_netmask_length: Optional[int] = None,
            ipv6_association_id: Optional[str] = None,
            ipv6_cidr_block: Optional[str] = None,
            ipv6_cidr_block_network_border_group: Optional[str] = None,
            ipv6_ipam_pool_id: Optional[str] = None,
            ipv6_netmask_length: Optional[int] = None,
            main_route_table_id: Optional[str] = None,
            owner_id: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            tags_all: Optional[Mapping[str, str]] = None) -> Vpc
    func GetVpc(ctx *Context, name string, id IDInput, state *VpcState, opts ...ResourceOption) (*Vpc, error)
    public static Vpc Get(string name, Input<string> id, VpcState? state, CustomResourceOptions? opts = null)
    public static Vpc get(String name, Output<String> id, VpcState 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:
    Arn string
    Amazon Resource Name (ARN) of VPC
    AssignGeneratedIpv6CidrBlock bool
    Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or the size of the CIDR block. Default is false. Conflicts with ipv6_ipam_pool_id
    CidrBlock string
    The IPv4 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using ipv4_netmask_length.
    DefaultNetworkAclId string
    The ID of the network ACL created by default on VPC creation
    DefaultRouteTableId string
    The ID of the route table created by default on VPC creation
    DefaultSecurityGroupId string
    The ID of the security group created by default on VPC creation
    DhcpOptionsId string
    DHCP options id of the desired VPC.
    EnableDnsHostnames bool
    A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false.
    EnableDnsSupport bool
    A boolean flag to enable/disable DNS support in the VPC. Defaults to true.
    EnableNetworkAddressUsageMetrics bool
    Indicates whether Network Address Usage metrics are enabled for your VPC. Defaults to false.
    InstanceTenancy string
    A tenancy option for instances launched into the VPC. Default is default, which ensures that EC2 instances launched in this VPC use the EC2 instance tenancy attribute specified when the EC2 instance is launched. The only other option is dedicated, which ensures that EC2 instances launched in this VPC are run on dedicated tenancy instances regardless of the tenancy attribute specified at launch. This has a dedicated per region fee of $2 per hour, plus an hourly per instance usage fee.
    Ipv4IpamPoolId string
    The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts. Using IPAM you can monitor IP address usage throughout your AWS Organization.
    Ipv4NetmaskLength int
    The netmask length of the IPv4 CIDR you want to allocate to this VPC. Requires specifying a ipv4_ipam_pool_id.
    Ipv6AssociationId string
    The association ID for the IPv6 CIDR block.
    Ipv6CidrBlock string
    IPv6 CIDR block to request from an IPAM Pool. Can be set explicitly or derived from IPAM using ipv6_netmask_length.
    Ipv6CidrBlockNetworkBorderGroup string
    By default when an IPv6 CIDR is assigned to a VPC a default ipv6_cidr_block_network_border_group will be set to the region of the VPC. This can be changed to restrict advertisement of public addresses to specific Network Border Groups such as LocalZones.
    Ipv6IpamPoolId string
    IPAM Pool ID for a IPv6 pool. Conflicts with assign_generated_ipv6_cidr_block.
    Ipv6NetmaskLength int
    Netmask length to request from IPAM Pool. Conflicts with ipv6_cidr_block. This can be omitted if IPAM pool as a allocation_default_netmask_length set. Valid values: 56.
    MainRouteTableId string
    The ID of the main route table associated with this VPC. Note that you can change a VPC's main route table by using an aws.ec2.MainRouteTableAssociation.
    OwnerId string
    The ID of the AWS account that owns the VPC.
    Tags Dictionary<string, string>
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll Dictionary<string, string>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Arn string
    Amazon Resource Name (ARN) of VPC
    AssignGeneratedIpv6CidrBlock bool
    Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or the size of the CIDR block. Default is false. Conflicts with ipv6_ipam_pool_id
    CidrBlock string
    The IPv4 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using ipv4_netmask_length.
    DefaultNetworkAclId string
    The ID of the network ACL created by default on VPC creation
    DefaultRouteTableId string
    The ID of the route table created by default on VPC creation
    DefaultSecurityGroupId string
    The ID of the security group created by default on VPC creation
    DhcpOptionsId string
    DHCP options id of the desired VPC.
    EnableDnsHostnames bool
    A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false.
    EnableDnsSupport bool
    A boolean flag to enable/disable DNS support in the VPC. Defaults to true.
    EnableNetworkAddressUsageMetrics bool
    Indicates whether Network Address Usage metrics are enabled for your VPC. Defaults to false.
    InstanceTenancy string
    A tenancy option for instances launched into the VPC. Default is default, which ensures that EC2 instances launched in this VPC use the EC2 instance tenancy attribute specified when the EC2 instance is launched. The only other option is dedicated, which ensures that EC2 instances launched in this VPC are run on dedicated tenancy instances regardless of the tenancy attribute specified at launch. This has a dedicated per region fee of $2 per hour, plus an hourly per instance usage fee.
    Ipv4IpamPoolId string
    The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts. Using IPAM you can monitor IP address usage throughout your AWS Organization.
    Ipv4NetmaskLength int
    The netmask length of the IPv4 CIDR you want to allocate to this VPC. Requires specifying a ipv4_ipam_pool_id.
    Ipv6AssociationId string
    The association ID for the IPv6 CIDR block.
    Ipv6CidrBlock string
    IPv6 CIDR block to request from an IPAM Pool. Can be set explicitly or derived from IPAM using ipv6_netmask_length.
    Ipv6CidrBlockNetworkBorderGroup string
    By default when an IPv6 CIDR is assigned to a VPC a default ipv6_cidr_block_network_border_group will be set to the region of the VPC. This can be changed to restrict advertisement of public addresses to specific Network Border Groups such as LocalZones.
    Ipv6IpamPoolId string
    IPAM Pool ID for a IPv6 pool. Conflicts with assign_generated_ipv6_cidr_block.
    Ipv6NetmaskLength int
    Netmask length to request from IPAM Pool. Conflicts with ipv6_cidr_block. This can be omitted if IPAM pool as a allocation_default_netmask_length set. Valid values: 56.
    MainRouteTableId string
    The ID of the main route table associated with this VPC. Note that you can change a VPC's main route table by using an aws.ec2.MainRouteTableAssociation.
    OwnerId string
    The ID of the AWS account that owns the VPC.
    Tags map[string]string
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll map[string]string
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn String
    Amazon Resource Name (ARN) of VPC
    assignGeneratedIpv6CidrBlock Boolean
    Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or the size of the CIDR block. Default is false. Conflicts with ipv6_ipam_pool_id
    cidrBlock String
    The IPv4 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using ipv4_netmask_length.
    defaultNetworkAclId String
    The ID of the network ACL created by default on VPC creation
    defaultRouteTableId String
    The ID of the route table created by default on VPC creation
    defaultSecurityGroupId String
    The ID of the security group created by default on VPC creation
    dhcpOptionsId String
    DHCP options id of the desired VPC.
    enableDnsHostnames Boolean
    A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false.
    enableDnsSupport Boolean
    A boolean flag to enable/disable DNS support in the VPC. Defaults to true.
    enableNetworkAddressUsageMetrics Boolean
    Indicates whether Network Address Usage metrics are enabled for your VPC. Defaults to false.
    instanceTenancy String
    A tenancy option for instances launched into the VPC. Default is default, which ensures that EC2 instances launched in this VPC use the EC2 instance tenancy attribute specified when the EC2 instance is launched. The only other option is dedicated, which ensures that EC2 instances launched in this VPC are run on dedicated tenancy instances regardless of the tenancy attribute specified at launch. This has a dedicated per region fee of $2 per hour, plus an hourly per instance usage fee.
    ipv4IpamPoolId String
    The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts. Using IPAM you can monitor IP address usage throughout your AWS Organization.
    ipv4NetmaskLength Integer
    The netmask length of the IPv4 CIDR you want to allocate to this VPC. Requires specifying a ipv4_ipam_pool_id.
    ipv6AssociationId String
    The association ID for the IPv6 CIDR block.
    ipv6CidrBlock String
    IPv6 CIDR block to request from an IPAM Pool. Can be set explicitly or derived from IPAM using ipv6_netmask_length.
    ipv6CidrBlockNetworkBorderGroup String
    By default when an IPv6 CIDR is assigned to a VPC a default ipv6_cidr_block_network_border_group will be set to the region of the VPC. This can be changed to restrict advertisement of public addresses to specific Network Border Groups such as LocalZones.
    ipv6IpamPoolId String
    IPAM Pool ID for a IPv6 pool. Conflicts with assign_generated_ipv6_cidr_block.
    ipv6NetmaskLength Integer
    Netmask length to request from IPAM Pool. Conflicts with ipv6_cidr_block. This can be omitted if IPAM pool as a allocation_default_netmask_length set. Valid values: 56.
    mainRouteTableId String
    The ID of the main route table associated with this VPC. Note that you can change a VPC's main route table by using an aws.ec2.MainRouteTableAssociation.
    ownerId String
    The ID of the AWS account that owns the VPC.
    tags Map<String,String>
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String,String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn string
    Amazon Resource Name (ARN) of VPC
    assignGeneratedIpv6CidrBlock boolean
    Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or the size of the CIDR block. Default is false. Conflicts with ipv6_ipam_pool_id
    cidrBlock string
    The IPv4 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using ipv4_netmask_length.
    defaultNetworkAclId string
    The ID of the network ACL created by default on VPC creation
    defaultRouteTableId string
    The ID of the route table created by default on VPC creation
    defaultSecurityGroupId string
    The ID of the security group created by default on VPC creation
    dhcpOptionsId string
    DHCP options id of the desired VPC.
    enableDnsHostnames boolean
    A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false.
    enableDnsSupport boolean
    A boolean flag to enable/disable DNS support in the VPC. Defaults to true.
    enableNetworkAddressUsageMetrics boolean
    Indicates whether Network Address Usage metrics are enabled for your VPC. Defaults to false.
    instanceTenancy string
    A tenancy option for instances launched into the VPC. Default is default, which ensures that EC2 instances launched in this VPC use the EC2 instance tenancy attribute specified when the EC2 instance is launched. The only other option is dedicated, which ensures that EC2 instances launched in this VPC are run on dedicated tenancy instances regardless of the tenancy attribute specified at launch. This has a dedicated per region fee of $2 per hour, plus an hourly per instance usage fee.
    ipv4IpamPoolId string
    The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts. Using IPAM you can monitor IP address usage throughout your AWS Organization.
    ipv4NetmaskLength number
    The netmask length of the IPv4 CIDR you want to allocate to this VPC. Requires specifying a ipv4_ipam_pool_id.
    ipv6AssociationId string
    The association ID for the IPv6 CIDR block.
    ipv6CidrBlock string
    IPv6 CIDR block to request from an IPAM Pool. Can be set explicitly or derived from IPAM using ipv6_netmask_length.
    ipv6CidrBlockNetworkBorderGroup string
    By default when an IPv6 CIDR is assigned to a VPC a default ipv6_cidr_block_network_border_group will be set to the region of the VPC. This can be changed to restrict advertisement of public addresses to specific Network Border Groups such as LocalZones.
    ipv6IpamPoolId string
    IPAM Pool ID for a IPv6 pool. Conflicts with assign_generated_ipv6_cidr_block.
    ipv6NetmaskLength number
    Netmask length to request from IPAM Pool. Conflicts with ipv6_cidr_block. This can be omitted if IPAM pool as a allocation_default_netmask_length set. Valid values: 56.
    mainRouteTableId string
    The ID of the main route table associated with this VPC. Note that you can change a VPC's main route table by using an aws.ec2.MainRouteTableAssociation.
    ownerId string
    The ID of the AWS account that owns the VPC.
    tags {[key: string]: string}
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll {[key: string]: string}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn str
    Amazon Resource Name (ARN) of VPC
    assign_generated_ipv6_cidr_block bool
    Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or the size of the CIDR block. Default is false. Conflicts with ipv6_ipam_pool_id
    cidr_block str
    The IPv4 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using ipv4_netmask_length.
    default_network_acl_id str
    The ID of the network ACL created by default on VPC creation
    default_route_table_id str
    The ID of the route table created by default on VPC creation
    default_security_group_id str
    The ID of the security group created by default on VPC creation
    dhcp_options_id str
    DHCP options id of the desired VPC.
    enable_dns_hostnames bool
    A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false.
    enable_dns_support bool
    A boolean flag to enable/disable DNS support in the VPC. Defaults to true.
    enable_network_address_usage_metrics bool
    Indicates whether Network Address Usage metrics are enabled for your VPC. Defaults to false.
    instance_tenancy str
    A tenancy option for instances launched into the VPC. Default is default, which ensures that EC2 instances launched in this VPC use the EC2 instance tenancy attribute specified when the EC2 instance is launched. The only other option is dedicated, which ensures that EC2 instances launched in this VPC are run on dedicated tenancy instances regardless of the tenancy attribute specified at launch. This has a dedicated per region fee of $2 per hour, plus an hourly per instance usage fee.
    ipv4_ipam_pool_id str
    The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts. Using IPAM you can monitor IP address usage throughout your AWS Organization.
    ipv4_netmask_length int
    The netmask length of the IPv4 CIDR you want to allocate to this VPC. Requires specifying a ipv4_ipam_pool_id.
    ipv6_association_id str
    The association ID for the IPv6 CIDR block.
    ipv6_cidr_block str
    IPv6 CIDR block to request from an IPAM Pool. Can be set explicitly or derived from IPAM using ipv6_netmask_length.
    ipv6_cidr_block_network_border_group str
    By default when an IPv6 CIDR is assigned to a VPC a default ipv6_cidr_block_network_border_group will be set to the region of the VPC. This can be changed to restrict advertisement of public addresses to specific Network Border Groups such as LocalZones.
    ipv6_ipam_pool_id str
    IPAM Pool ID for a IPv6 pool. Conflicts with assign_generated_ipv6_cidr_block.
    ipv6_netmask_length int
    Netmask length to request from IPAM Pool. Conflicts with ipv6_cidr_block. This can be omitted if IPAM pool as a allocation_default_netmask_length set. Valid values: 56.
    main_route_table_id str
    The ID of the main route table associated with this VPC. Note that you can change a VPC's main route table by using an aws.ec2.MainRouteTableAssociation.
    owner_id str
    The ID of the AWS account that owns the VPC.
    tags Mapping[str, str]
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tags_all Mapping[str, str]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn String
    Amazon Resource Name (ARN) of VPC
    assignGeneratedIpv6CidrBlock Boolean
    Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or the size of the CIDR block. Default is false. Conflicts with ipv6_ipam_pool_id
    cidrBlock String
    The IPv4 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using ipv4_netmask_length.
    defaultNetworkAclId String
    The ID of the network ACL created by default on VPC creation
    defaultRouteTableId String
    The ID of the route table created by default on VPC creation
    defaultSecurityGroupId String
    The ID of the security group created by default on VPC creation
    dhcpOptionsId String
    DHCP options id of the desired VPC.
    enableDnsHostnames Boolean
    A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false.
    enableDnsSupport Boolean
    A boolean flag to enable/disable DNS support in the VPC. Defaults to true.
    enableNetworkAddressUsageMetrics Boolean
    Indicates whether Network Address Usage metrics are enabled for your VPC. Defaults to false.
    instanceTenancy String
    A tenancy option for instances launched into the VPC. Default is default, which ensures that EC2 instances launched in this VPC use the EC2 instance tenancy attribute specified when the EC2 instance is launched. The only other option is dedicated, which ensures that EC2 instances launched in this VPC are run on dedicated tenancy instances regardless of the tenancy attribute specified at launch. This has a dedicated per region fee of $2 per hour, plus an hourly per instance usage fee.
    ipv4IpamPoolId String
    The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts. Using IPAM you can monitor IP address usage throughout your AWS Organization.
    ipv4NetmaskLength Number
    The netmask length of the IPv4 CIDR you want to allocate to this VPC. Requires specifying a ipv4_ipam_pool_id.
    ipv6AssociationId String
    The association ID for the IPv6 CIDR block.
    ipv6CidrBlock String
    IPv6 CIDR block to request from an IPAM Pool. Can be set explicitly or derived from IPAM using ipv6_netmask_length.
    ipv6CidrBlockNetworkBorderGroup String
    By default when an IPv6 CIDR is assigned to a VPC a default ipv6_cidr_block_network_border_group will be set to the region of the VPC. This can be changed to restrict advertisement of public addresses to specific Network Border Groups such as LocalZones.
    ipv6IpamPoolId String
    IPAM Pool ID for a IPv6 pool. Conflicts with assign_generated_ipv6_cidr_block.
    ipv6NetmaskLength Number
    Netmask length to request from IPAM Pool. Conflicts with ipv6_cidr_block. This can be omitted if IPAM pool as a allocation_default_netmask_length set. Valid values: 56.
    mainRouteTableId String
    The ID of the main route table associated with this VPC. Note that you can change a VPC's main route table by using an aws.ec2.MainRouteTableAssociation.
    ownerId String
    The ID of the AWS account that owns the VPC.
    tags Map<String>
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Import

    Using pulumi import, import VPCs using the VPC id. For example:

    $ pulumi import aws:ec2/vpc:Vpc test_vpc vpc-a01106c2
    

    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

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi