We recommend new projects start with resources from the AWS provider.
aws-native.ec2.Vpc
Explore with Pulumi AI
We recommend new projects start with resources from the AWS provider.
Specifies a virtual private cloud (VPC). To add an IPv6 CIDR block to the VPC, see AWS::EC2::VPCCidrBlock. For more information, see Virtual private clouds (VPC) in the Amazon VPC User Guide.
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,
        cidr_block: Optional[str] = None,
        enable_dns_hostnames: Optional[bool] = None,
        enable_dns_support: Optional[bool] = None,
        instance_tenancy: Optional[str] = None,
        ipv4_ipam_pool_id: Optional[str] = None,
        ipv4_netmask_length: Optional[int] = None,
        tags: Optional[Sequence[_root_inputs.TagArgs]] = None)func NewVpc(ctx *Context, name string, args *VpcArgs, opts ...ResourceOption) (*Vpc, error)public Vpc(string name, VpcArgs? args = null, CustomResourceOptions? opts = null)type: aws-native: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.
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Vpc resource accepts the following input properties:
- CidrBlock string
- The IPv4 network range for the VPC, in CIDR notation. For example, 10.0.0.0/16. We modify the specified CIDR block to its canonical form; for example, if you specify100.68.0.18/18, we modify it to100.68.0.0/18. You must specify eitherCidrBlockorIpv4IpamPoolId.
- EnableDns boolHostnames 
- Indicates whether the instances launched in the VPC get DNS hostnames. If enabled, instances in the VPC get DNS hostnames; otherwise, they do not. Disabled by default for nondefault VPCs. For more information, see DNS attributes in your VPC. You can only enable DNS hostnames if you've enabled DNS support.
- EnableDns boolSupport 
- Indicates whether the DNS resolution is supported for the VPC. If enabled, queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or the reserved IP address at the base of the VPC network range "plus two" succeed. If disabled, the Amazon provided DNS service in the VPC that resolves public DNS hostnames to IP addresses is not enabled. Enabled by default. For more information, see DNS attributes in your VPC.
- InstanceTenancy string
- The allowed tenancy of instances launched into the VPC. - default: An instance launched into the VPC runs on shared hardware by default, unless you explicitly specify a different tenancy during instance launch.
- dedicated: An instance launched into the VPC runs on dedicated hardware by default, unless you explicitly specify a tenancy of- hostduring instance launch. You cannot specify a tenancy of- defaultduring instance launch.
 - Updating - InstanceTenancyrequires no replacement only if you are updating its value from- dedicatedto- default. Updating- InstanceTenancyfrom- defaultto- dedicatedrequires replacement.
- Ipv4IpamPool stringId 
- The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. For more information, see What is IPAM? in the Amazon VPC IPAM User Guide.
You must specify eitherCidrBlockorIpv4IpamPoolId.
- Ipv4NetmaskLength int
- The netmask length of the IPv4 CIDR you want to allocate to this VPC from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see What is IPAM? in the Amazon VPC IPAM User Guide.
- 
List<Pulumi.Aws Native. Inputs. Tag> 
- The tags for the VPC.
- CidrBlock string
- The IPv4 network range for the VPC, in CIDR notation. For example, 10.0.0.0/16. We modify the specified CIDR block to its canonical form; for example, if you specify100.68.0.18/18, we modify it to100.68.0.0/18. You must specify eitherCidrBlockorIpv4IpamPoolId.
- EnableDns boolHostnames 
- Indicates whether the instances launched in the VPC get DNS hostnames. If enabled, instances in the VPC get DNS hostnames; otherwise, they do not. Disabled by default for nondefault VPCs. For more information, see DNS attributes in your VPC. You can only enable DNS hostnames if you've enabled DNS support.
- EnableDns boolSupport 
- Indicates whether the DNS resolution is supported for the VPC. If enabled, queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or the reserved IP address at the base of the VPC network range "plus two" succeed. If disabled, the Amazon provided DNS service in the VPC that resolves public DNS hostnames to IP addresses is not enabled. Enabled by default. For more information, see DNS attributes in your VPC.
- InstanceTenancy string
- The allowed tenancy of instances launched into the VPC. - default: An instance launched into the VPC runs on shared hardware by default, unless you explicitly specify a different tenancy during instance launch.
- dedicated: An instance launched into the VPC runs on dedicated hardware by default, unless you explicitly specify a tenancy of- hostduring instance launch. You cannot specify a tenancy of- defaultduring instance launch.
 - Updating - InstanceTenancyrequires no replacement only if you are updating its value from- dedicatedto- default. Updating- InstanceTenancyfrom- defaultto- dedicatedrequires replacement.
- Ipv4IpamPool stringId 
- The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. For more information, see What is IPAM? in the Amazon VPC IPAM User Guide.
You must specify eitherCidrBlockorIpv4IpamPoolId.
- Ipv4NetmaskLength int
- The netmask length of the IPv4 CIDR you want to allocate to this VPC from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see What is IPAM? in the Amazon VPC IPAM User Guide.
- 
TagArgs 
- The tags for the VPC.
- cidrBlock String
- The IPv4 network range for the VPC, in CIDR notation. For example, 10.0.0.0/16. We modify the specified CIDR block to its canonical form; for example, if you specify100.68.0.18/18, we modify it to100.68.0.0/18. You must specify eitherCidrBlockorIpv4IpamPoolId.
- enableDns BooleanHostnames 
- Indicates whether the instances launched in the VPC get DNS hostnames. If enabled, instances in the VPC get DNS hostnames; otherwise, they do not. Disabled by default for nondefault VPCs. For more information, see DNS attributes in your VPC. You can only enable DNS hostnames if you've enabled DNS support.
- enableDns BooleanSupport 
- Indicates whether the DNS resolution is supported for the VPC. If enabled, queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or the reserved IP address at the base of the VPC network range "plus two" succeed. If disabled, the Amazon provided DNS service in the VPC that resolves public DNS hostnames to IP addresses is not enabled. Enabled by default. For more information, see DNS attributes in your VPC.
- instanceTenancy String
- The allowed tenancy of instances launched into the VPC. - default: An instance launched into the VPC runs on shared hardware by default, unless you explicitly specify a different tenancy during instance launch.
- dedicated: An instance launched into the VPC runs on dedicated hardware by default, unless you explicitly specify a tenancy of- hostduring instance launch. You cannot specify a tenancy of- defaultduring instance launch.
 - Updating - InstanceTenancyrequires no replacement only if you are updating its value from- dedicatedto- default. Updating- InstanceTenancyfrom- defaultto- dedicatedrequires replacement.
- ipv4IpamPool StringId 
- The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. For more information, see What is IPAM? in the Amazon VPC IPAM User Guide.
You must specify eitherCidrBlockorIpv4IpamPoolId.
- ipv4NetmaskLength Integer
- The netmask length of the IPv4 CIDR you want to allocate to this VPC from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see What is IPAM? in the Amazon VPC IPAM User Guide.
- List<Tag>
- The tags for the VPC.
- cidrBlock string
- The IPv4 network range for the VPC, in CIDR notation. For example, 10.0.0.0/16. We modify the specified CIDR block to its canonical form; for example, if you specify100.68.0.18/18, we modify it to100.68.0.0/18. You must specify eitherCidrBlockorIpv4IpamPoolId.
- enableDns booleanHostnames 
- Indicates whether the instances launched in the VPC get DNS hostnames. If enabled, instances in the VPC get DNS hostnames; otherwise, they do not. Disabled by default for nondefault VPCs. For more information, see DNS attributes in your VPC. You can only enable DNS hostnames if you've enabled DNS support.
- enableDns booleanSupport 
- Indicates whether the DNS resolution is supported for the VPC. If enabled, queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or the reserved IP address at the base of the VPC network range "plus two" succeed. If disabled, the Amazon provided DNS service in the VPC that resolves public DNS hostnames to IP addresses is not enabled. Enabled by default. For more information, see DNS attributes in your VPC.
- instanceTenancy string
- The allowed tenancy of instances launched into the VPC. - default: An instance launched into the VPC runs on shared hardware by default, unless you explicitly specify a different tenancy during instance launch.
- dedicated: An instance launched into the VPC runs on dedicated hardware by default, unless you explicitly specify a tenancy of- hostduring instance launch. You cannot specify a tenancy of- defaultduring instance launch.
 - Updating - InstanceTenancyrequires no replacement only if you are updating its value from- dedicatedto- default. Updating- InstanceTenancyfrom- defaultto- dedicatedrequires replacement.
- ipv4IpamPool stringId 
- The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. For more information, see What is IPAM? in the Amazon VPC IPAM User Guide.
You must specify eitherCidrBlockorIpv4IpamPoolId.
- ipv4NetmaskLength number
- The netmask length of the IPv4 CIDR you want to allocate to this VPC from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see What is IPAM? in the Amazon VPC IPAM User Guide.
- Tag[]
- The tags for the VPC.
- cidr_block str
- The IPv4 network range for the VPC, in CIDR notation. For example, 10.0.0.0/16. We modify the specified CIDR block to its canonical form; for example, if you specify100.68.0.18/18, we modify it to100.68.0.0/18. You must specify eitherCidrBlockorIpv4IpamPoolId.
- enable_dns_ boolhostnames 
- Indicates whether the instances launched in the VPC get DNS hostnames. If enabled, instances in the VPC get DNS hostnames; otherwise, they do not. Disabled by default for nondefault VPCs. For more information, see DNS attributes in your VPC. You can only enable DNS hostnames if you've enabled DNS support.
- enable_dns_ boolsupport 
- Indicates whether the DNS resolution is supported for the VPC. If enabled, queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or the reserved IP address at the base of the VPC network range "plus two" succeed. If disabled, the Amazon provided DNS service in the VPC that resolves public DNS hostnames to IP addresses is not enabled. Enabled by default. For more information, see DNS attributes in your VPC.
- instance_tenancy str
- The allowed tenancy of instances launched into the VPC. - default: An instance launched into the VPC runs on shared hardware by default, unless you explicitly specify a different tenancy during instance launch.
- dedicated: An instance launched into the VPC runs on dedicated hardware by default, unless you explicitly specify a tenancy of- hostduring instance launch. You cannot specify a tenancy of- defaultduring instance launch.
 - Updating - InstanceTenancyrequires no replacement only if you are updating its value from- dedicatedto- default. Updating- InstanceTenancyfrom- defaultto- dedicatedrequires replacement.
- ipv4_ipam_ strpool_ id 
- The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. For more information, see What is IPAM? in the Amazon VPC IPAM User Guide.
You must specify eitherCidrBlockorIpv4IpamPoolId.
- ipv4_netmask_ intlength 
- The netmask length of the IPv4 CIDR you want to allocate to this VPC from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see What is IPAM? in the Amazon VPC IPAM User Guide.
- 
Sequence[TagArgs] 
- The tags for the VPC.
- cidrBlock String
- The IPv4 network range for the VPC, in CIDR notation. For example, 10.0.0.0/16. We modify the specified CIDR block to its canonical form; for example, if you specify100.68.0.18/18, we modify it to100.68.0.0/18. You must specify eitherCidrBlockorIpv4IpamPoolId.
- enableDns BooleanHostnames 
- Indicates whether the instances launched in the VPC get DNS hostnames. If enabled, instances in the VPC get DNS hostnames; otherwise, they do not. Disabled by default for nondefault VPCs. For more information, see DNS attributes in your VPC. You can only enable DNS hostnames if you've enabled DNS support.
- enableDns BooleanSupport 
- Indicates whether the DNS resolution is supported for the VPC. If enabled, queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or the reserved IP address at the base of the VPC network range "plus two" succeed. If disabled, the Amazon provided DNS service in the VPC that resolves public DNS hostnames to IP addresses is not enabled. Enabled by default. For more information, see DNS attributes in your VPC.
- instanceTenancy String
- The allowed tenancy of instances launched into the VPC. - default: An instance launched into the VPC runs on shared hardware by default, unless you explicitly specify a different tenancy during instance launch.
- dedicated: An instance launched into the VPC runs on dedicated hardware by default, unless you explicitly specify a tenancy of- hostduring instance launch. You cannot specify a tenancy of- defaultduring instance launch.
 - Updating - InstanceTenancyrequires no replacement only if you are updating its value from- dedicatedto- default. Updating- InstanceTenancyfrom- defaultto- dedicatedrequires replacement.
- ipv4IpamPool StringId 
- The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. For more information, see What is IPAM? in the Amazon VPC IPAM User Guide.
You must specify eitherCidrBlockorIpv4IpamPoolId.
- ipv4NetmaskLength Number
- The netmask length of the IPv4 CIDR you want to allocate to this VPC from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see What is IPAM? in the Amazon VPC IPAM User Guide.
- List<Property Map>
- The tags for the VPC.
Outputs
All input properties are implicitly available as output properties. Additionally, the Vpc resource produces the following output properties:
- CidrBlock List<string>Associations 
- The association IDs of the IPv4 CIDR blocks for the VPC. For example, [ vpc-cidr-assoc-0280ab6b ].
- DefaultNetwork stringAcl 
- The ID of the default network ACL for the VPC. For example, acl-814dafe3.
- DefaultSecurity stringGroup 
- The ID of the default security group for the VPC. For example, sg-b178e0d3.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ipv6CidrBlocks List<string>
- The IPv6 CIDR blocks for the VPC. For example, [ 2001:db8:1234:1a00::/56 ].
- VpcId string
- The ID of the VPC.
- CidrBlock []stringAssociations 
- The association IDs of the IPv4 CIDR blocks for the VPC. For example, [ vpc-cidr-assoc-0280ab6b ].
- DefaultNetwork stringAcl 
- The ID of the default network ACL for the VPC. For example, acl-814dafe3.
- DefaultSecurity stringGroup 
- The ID of the default security group for the VPC. For example, sg-b178e0d3.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ipv6CidrBlocks []string
- The IPv6 CIDR blocks for the VPC. For example, [ 2001:db8:1234:1a00::/56 ].
- VpcId string
- The ID of the VPC.
- cidrBlock List<String>Associations 
- The association IDs of the IPv4 CIDR blocks for the VPC. For example, [ vpc-cidr-assoc-0280ab6b ].
- defaultNetwork StringAcl 
- The ID of the default network ACL for the VPC. For example, acl-814dafe3.
- defaultSecurity StringGroup 
- The ID of the default security group for the VPC. For example, sg-b178e0d3.
- id String
- The provider-assigned unique ID for this managed resource.
- ipv6CidrBlocks List<String>
- The IPv6 CIDR blocks for the VPC. For example, [ 2001:db8:1234:1a00::/56 ].
- vpcId String
- The ID of the VPC.
- cidrBlock string[]Associations 
- The association IDs of the IPv4 CIDR blocks for the VPC. For example, [ vpc-cidr-assoc-0280ab6b ].
- defaultNetwork stringAcl 
- The ID of the default network ACL for the VPC. For example, acl-814dafe3.
- defaultSecurity stringGroup 
- The ID of the default security group for the VPC. For example, sg-b178e0d3.
- id string
- The provider-assigned unique ID for this managed resource.
- ipv6CidrBlocks string[]
- The IPv6 CIDR blocks for the VPC. For example, [ 2001:db8:1234:1a00::/56 ].
- vpcId string
- The ID of the VPC.
- cidr_block_ Sequence[str]associations 
- The association IDs of the IPv4 CIDR blocks for the VPC. For example, [ vpc-cidr-assoc-0280ab6b ].
- default_network_ stracl 
- The ID of the default network ACL for the VPC. For example, acl-814dafe3.
- default_security_ strgroup 
- The ID of the default security group for the VPC. For example, sg-b178e0d3.
- id str
- The provider-assigned unique ID for this managed resource.
- ipv6_cidr_ Sequence[str]blocks 
- The IPv6 CIDR blocks for the VPC. For example, [ 2001:db8:1234:1a00::/56 ].
- vpc_id str
- The ID of the VPC.
- cidrBlock List<String>Associations 
- The association IDs of the IPv4 CIDR blocks for the VPC. For example, [ vpc-cidr-assoc-0280ab6b ].
- defaultNetwork StringAcl 
- The ID of the default network ACL for the VPC. For example, acl-814dafe3.
- defaultSecurity StringGroup 
- The ID of the default security group for the VPC. For example, sg-b178e0d3.
- id String
- The provider-assigned unique ID for this managed resource.
- ipv6CidrBlocks List<String>
- The IPv6 CIDR blocks for the VPC. For example, [ 2001:db8:1234:1a00::/56 ].
- vpcId String
- The ID of the VPC.
Supporting Types
Tag, TagArgs  
Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0
We recommend new projects start with resources from the AWS provider.