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:
- Cidr
Block 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 eitherCidrBlock
orIpv4IpamPoolId
. - 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 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 ofhost
during instance launch. You cannot specify a tenancy ofdefault
during instance launch.
Updating
InstanceTenancy
requires no replacement only if you are updating its value fromdedicated
todefault
. UpdatingInstanceTenancy
fromdefault
todedicated
requires replacement.- Ipv4Ipam
Pool 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 either
CidrBlock
orIpv4IpamPoolId
. - Ipv4Netmask
Length 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.
- Cidr
Block 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 eitherCidrBlock
orIpv4IpamPoolId
. - 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 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 ofhost
during instance launch. You cannot specify a tenancy ofdefault
during instance launch.
Updating
InstanceTenancy
requires no replacement only if you are updating its value fromdedicated
todefault
. UpdatingInstanceTenancy
fromdefault
todedicated
requires replacement.- Ipv4Ipam
Pool 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 either
CidrBlock
orIpv4IpamPoolId
. - Ipv4Netmask
Length 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.
- Tag
Args - The tags for the VPC.
- cidr
Block 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 eitherCidrBlock
orIpv4IpamPoolId
. - enable
Dns 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.
- enable
Dns 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.
- instance
Tenancy 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 ofhost
during instance launch. You cannot specify a tenancy ofdefault
during instance launch.
Updating
InstanceTenancy
requires no replacement only if you are updating its value fromdedicated
todefault
. UpdatingInstanceTenancy
fromdefault
todedicated
requires replacement.- ipv4Ipam
Pool 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 either
CidrBlock
orIpv4IpamPoolId
. - ipv4Netmask
Length 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.
- cidr
Block 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 eitherCidrBlock
orIpv4IpamPoolId
. - enable
Dns 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.
- enable
Dns 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.
- instance
Tenancy 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 ofhost
during instance launch. You cannot specify a tenancy ofdefault
during instance launch.
Updating
InstanceTenancy
requires no replacement only if you are updating its value fromdedicated
todefault
. UpdatingInstanceTenancy
fromdefault
todedicated
requires replacement.- ipv4Ipam
Pool 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 either
CidrBlock
orIpv4IpamPoolId
. - ipv4Netmask
Length 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 eitherCidrBlock
orIpv4IpamPoolId
. - 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 ofhost
during instance launch. You cannot specify a tenancy ofdefault
during instance launch.
Updating
InstanceTenancy
requires no replacement only if you are updating its value fromdedicated
todefault
. UpdatingInstanceTenancy
fromdefault
todedicated
requires 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 either
CidrBlock
orIpv4IpamPoolId
. - 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[Tag
Args] - The tags for the VPC.
- cidr
Block 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 eitherCidrBlock
orIpv4IpamPoolId
. - enable
Dns 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.
- enable
Dns 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.
- instance
Tenancy 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 ofhost
during instance launch. You cannot specify a tenancy ofdefault
during instance launch.
Updating
InstanceTenancy
requires no replacement only if you are updating its value fromdedicated
todefault
. UpdatingInstanceTenancy
fromdefault
todedicated
requires replacement.- ipv4Ipam
Pool 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 either
CidrBlock
orIpv4IpamPoolId
. - ipv4Netmask
Length 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:
- Cidr
Block List<string>Associations - The association IDs of the IPv4 CIDR blocks for the VPC. For example, [ vpc-cidr-assoc-0280ab6b ].
- Default
Network stringAcl - The ID of the default network ACL for the VPC. For example, acl-814dafe3.
- Default
Security 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.
- Ipv6Cidr
Blocks List<string> - The IPv6 CIDR blocks for the VPC. For example, [ 2001:db8:1234:1a00::/56 ].
- Vpc
Id string - The ID of the VPC.
- Cidr
Block []stringAssociations - The association IDs of the IPv4 CIDR blocks for the VPC. For example, [ vpc-cidr-assoc-0280ab6b ].
- Default
Network stringAcl - The ID of the default network ACL for the VPC. For example, acl-814dafe3.
- Default
Security 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.
- Ipv6Cidr
Blocks []string - The IPv6 CIDR blocks for the VPC. For example, [ 2001:db8:1234:1a00::/56 ].
- Vpc
Id string - The ID of the VPC.
- cidr
Block List<String>Associations - The association IDs of the IPv4 CIDR blocks for the VPC. For example, [ vpc-cidr-assoc-0280ab6b ].
- default
Network StringAcl - The ID of the default network ACL for the VPC. For example, acl-814dafe3.
- default
Security 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.
- ipv6Cidr
Blocks List<String> - The IPv6 CIDR blocks for the VPC. For example, [ 2001:db8:1234:1a00::/56 ].
- vpc
Id String - The ID of the VPC.
- cidr
Block string[]Associations - The association IDs of the IPv4 CIDR blocks for the VPC. For example, [ vpc-cidr-assoc-0280ab6b ].
- default
Network stringAcl - The ID of the default network ACL for the VPC. For example, acl-814dafe3.
- default
Security 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.
- ipv6Cidr
Blocks string[] - The IPv6 CIDR blocks for the VPC. For example, [ 2001:db8:1234:1a00::/56 ].
- vpc
Id 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.
- cidr
Block List<String>Associations - The association IDs of the IPv4 CIDR blocks for the VPC. For example, [ vpc-cidr-assoc-0280ab6b ].
- default
Network StringAcl - The ID of the default network ACL for the VPC. For example, acl-814dafe3.
- default
Security 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.
- ipv6Cidr
Blocks List<String> - The IPv6 CIDR blocks for the VPC. For example, [ 2001:db8:1234:1a00::/56 ].
- vpc
Id 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.