Vpc
Provides a VPC resource.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var main = new Aws.Ec2.Vpc("main", new Aws.Ec2.VpcArgs
{
CidrBlock = "10.0.0.0/16",
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v2/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
})
}import pulumi
import pulumi_aws as aws
main = aws.ec2.Vpc("main", cidr_block="10.0.0.0/16")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",
});Create a Vpc Resource
new Vpc(name: string, args: VpcArgs, opts?: CustomResourceOptions);def Vpc(resource_name, opts=None, assign_generated_ipv6_cidr_block=None, cidr_block=None, enable_classiclink=None, enable_classiclink_dns_support=None, enable_dns_hostnames=None, enable_dns_support=None, instance_tenancy=None, tags=None, __props__=None);public Vpc(string name, VpcArgs args, CustomResourceOptions? opts = null)- 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.
- opts ResourceOptions
- A bag of options that control this 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.
Vpc Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Vpc resource accepts the following input properties:
- Cidr
Block string The CIDR block for the VPC.
- Assign
Generated boolIpv6Cidr Block 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.- Enable
Classiclink bool A boolean flag to enable/disable ClassicLink for the VPC. Only valid in regions and accounts that support EC2 Classic. See the ClassicLink documentation for more information. Defaults false.
- Enable
Classiclink boolDns Support A boolean flag to enable/disable ClassicLink DNS Support for the VPC. Only valid in regions and accounts that support EC2 Classic.
- Enable
Dns boolHostnames A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false.
- Enable
Dns boolSupport A boolean flag to enable/disable DNS support in the VPC. Defaults true.
- Instance
Tenancy string A tenancy option for instances launched into the VPC. Default is
default, which makes your instances shared on the host. Using either of the other options (dedicatedorhost) costs at least $2/hr.- Dictionary<string, string>
A map of tags to assign to the resource.
- Cidr
Block string The CIDR block for the VPC.
- Assign
Generated boolIpv6Cidr Block 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.- Enable
Classiclink bool A boolean flag to enable/disable ClassicLink for the VPC. Only valid in regions and accounts that support EC2 Classic. See the ClassicLink documentation for more information. Defaults false.
- Enable
Classiclink boolDns Support A boolean flag to enable/disable ClassicLink DNS Support for the VPC. Only valid in regions and accounts that support EC2 Classic.
- Enable
Dns boolHostnames A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false.
- Enable
Dns boolSupport A boolean flag to enable/disable DNS support in the VPC. Defaults true.
- Instance
Tenancy string A tenancy option for instances launched into the VPC. Default is
default, which makes your instances shared on the host. Using either of the other options (dedicatedorhost) costs at least $2/hr.- map[string]string
A map of tags to assign to the resource.
- cidr
Block string The CIDR block for the VPC.
- assign
Generated booleanIpv6Cidr Block 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.- enable
Classiclink boolean A boolean flag to enable/disable ClassicLink for the VPC. Only valid in regions and accounts that support EC2 Classic. See the ClassicLink documentation for more information. Defaults false.
- enable
Classiclink booleanDns Support A boolean flag to enable/disable ClassicLink DNS Support for the VPC. Only valid in regions and accounts that support EC2 Classic.
- enable
Dns booleanHostnames A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false.
- enable
Dns booleanSupport A boolean flag to enable/disable DNS support in the VPC. Defaults true.
- instance
Tenancy string A tenancy option for instances launched into the VPC. Default is
default, which makes your instances shared on the host. Using either of the other options (dedicatedorhost) costs at least $2/hr.- {[key: string]: string}
A map of tags to assign to the resource.
- cidr_
block str The CIDR block for the VPC.
- assign_
generated_ boolipv6_ cidr_ block 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.- enable_
classiclink bool A boolean flag to enable/disable ClassicLink for the VPC. Only valid in regions and accounts that support EC2 Classic. See the ClassicLink documentation for more information. Defaults false.
- enable_
classiclink_ booldns_ support A boolean flag to enable/disable ClassicLink DNS Support for the VPC. Only valid in regions and accounts that support EC2 Classic.
- enable_
dns_ boolhostnames A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false.
- enable_
dns_ boolsupport A boolean flag to enable/disable DNS support in the VPC. Defaults true.
- instance_
tenancy str A tenancy option for instances launched into the VPC. Default is
default, which makes your instances shared on the host. Using either of the other options (dedicatedorhost) costs at least $2/hr.- Dict[str, str]
A map of tags to assign to the resource.
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
- Default
Network stringAcl Id The ID of the network ACL created by default on VPC creation
- Default
Route stringTable Id The ID of the route table created by default on VPC creation
- Default
Security stringGroup Id The ID of the security group created by default on VPC creation
- Dhcp
Options stringId - Id string
- The provider-assigned unique ID for this managed resource.
- Ipv6Association
Id string The association ID for the IPv6 CIDR block.
- Ipv6Cidr
Block string The IPv6 CIDR block.
- Main
Route stringTable Id 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 string The ID of the AWS account that owns the VPC.
- Arn string
Amazon Resource Name (ARN) of VPC
- Default
Network stringAcl Id The ID of the network ACL created by default on VPC creation
- Default
Route stringTable Id The ID of the route table created by default on VPC creation
- Default
Security stringGroup Id The ID of the security group created by default on VPC creation
- Dhcp
Options stringId - Id string
- The provider-assigned unique ID for this managed resource.
- Ipv6Association
Id string The association ID for the IPv6 CIDR block.
- Ipv6Cidr
Block string The IPv6 CIDR block.
- Main
Route stringTable Id 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 string The ID of the AWS account that owns the VPC.
- arn string
Amazon Resource Name (ARN) of VPC
- default
Network stringAcl Id The ID of the network ACL created by default on VPC creation
- default
Route stringTable Id The ID of the route table created by default on VPC creation
- default
Security stringGroup Id The ID of the security group created by default on VPC creation
- dhcp
Options stringId - id string
- The provider-assigned unique ID for this managed resource.
- ipv6Association
Id string The association ID for the IPv6 CIDR block.
- ipv6Cidr
Block string The IPv6 CIDR block.
- main
Route stringTable Id 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 string The ID of the AWS account that owns the VPC.
- arn str
Amazon Resource Name (ARN) of VPC
- default_
network_ stracl_ id The ID of the network ACL created by default on VPC creation
- default_
route_ strtable_ id The ID of the route table created by default on VPC creation
- default_
security_ strgroup_ id The ID of the security group created by default on VPC creation
- dhcp_
options_ strid - id str
- The provider-assigned unique ID for this managed resource.
- ipv6_
association_ strid The association ID for the IPv6 CIDR block.
- ipv6_
cidr_ strblock The IPv6 CIDR block.
- main_
route_ strtable_ id 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.
Look up an 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): Vpcstatic get(resource_name, id, opts=None, arn=None, assign_generated_ipv6_cidr_block=None, cidr_block=None, default_network_acl_id=None, default_route_table_id=None, default_security_group_id=None, dhcp_options_id=None, enable_classiclink=None, enable_classiclink_dns_support=None, enable_dns_hostnames=None, enable_dns_support=None, instance_tenancy=None, ipv6_association_id=None, ipv6_cidr_block=None, main_route_table_id=None, owner_id=None, tags=None, __props__=None);public static Vpc Get(string name, Input<string> id, VpcState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Arn string
Amazon Resource Name (ARN) of VPC
- Assign
Generated boolIpv6Cidr Block 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.- Cidr
Block string The CIDR block for the VPC.
- Default
Network stringAcl Id The ID of the network ACL created by default on VPC creation
- Default
Route stringTable Id The ID of the route table created by default on VPC creation
- Default
Security stringGroup Id The ID of the security group created by default on VPC creation
- Dhcp
Options stringId - Enable
Classiclink bool A boolean flag to enable/disable ClassicLink for the VPC. Only valid in regions and accounts that support EC2 Classic. See the ClassicLink documentation for more information. Defaults false.
- Enable
Classiclink boolDns Support A boolean flag to enable/disable ClassicLink DNS Support for the VPC. Only valid in regions and accounts that support EC2 Classic.
- Enable
Dns boolHostnames A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false.
- Enable
Dns boolSupport A boolean flag to enable/disable DNS support in the VPC. Defaults true.
- Instance
Tenancy string A tenancy option for instances launched into the VPC. Default is
default, which makes your instances shared on the host. Using either of the other options (dedicatedorhost) costs at least $2/hr.- Ipv6Association
Id string The association ID for the IPv6 CIDR block.
- Ipv6Cidr
Block string The IPv6 CIDR block.
- Main
Route stringTable Id 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 string The ID of the AWS account that owns the VPC.
- Dictionary<string, string>
A map of tags to assign to the resource.
- Arn string
Amazon Resource Name (ARN) of VPC
- Assign
Generated boolIpv6Cidr Block 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.- Cidr
Block string The CIDR block for the VPC.
- Default
Network stringAcl Id The ID of the network ACL created by default on VPC creation
- Default
Route stringTable Id The ID of the route table created by default on VPC creation
- Default
Security stringGroup Id The ID of the security group created by default on VPC creation
- Dhcp
Options stringId - Enable
Classiclink bool A boolean flag to enable/disable ClassicLink for the VPC. Only valid in regions and accounts that support EC2 Classic. See the ClassicLink documentation for more information. Defaults false.
- Enable
Classiclink boolDns Support A boolean flag to enable/disable ClassicLink DNS Support for the VPC. Only valid in regions and accounts that support EC2 Classic.
- Enable
Dns boolHostnames A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false.
- Enable
Dns boolSupport A boolean flag to enable/disable DNS support in the VPC. Defaults true.
- Instance
Tenancy string A tenancy option for instances launched into the VPC. Default is
default, which makes your instances shared on the host. Using either of the other options (dedicatedorhost) costs at least $2/hr.- Ipv6Association
Id string The association ID for the IPv6 CIDR block.
- Ipv6Cidr
Block string The IPv6 CIDR block.
- Main
Route stringTable Id 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 string The ID of the AWS account that owns the VPC.
- map[string]string
A map of tags to assign to the resource.
- arn string
Amazon Resource Name (ARN) of VPC
- assign
Generated booleanIpv6Cidr Block 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.- cidr
Block string The CIDR block for the VPC.
- default
Network stringAcl Id The ID of the network ACL created by default on VPC creation
- default
Route stringTable Id The ID of the route table created by default on VPC creation
- default
Security stringGroup Id The ID of the security group created by default on VPC creation
- dhcp
Options stringId - enable
Classiclink boolean A boolean flag to enable/disable ClassicLink for the VPC. Only valid in regions and accounts that support EC2 Classic. See the ClassicLink documentation for more information. Defaults false.
- enable
Classiclink booleanDns Support A boolean flag to enable/disable ClassicLink DNS Support for the VPC. Only valid in regions and accounts that support EC2 Classic.
- enable
Dns booleanHostnames A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false.
- enable
Dns booleanSupport A boolean flag to enable/disable DNS support in the VPC. Defaults true.
- instance
Tenancy string A tenancy option for instances launched into the VPC. Default is
default, which makes your instances shared on the host. Using either of the other options (dedicatedorhost) costs at least $2/hr.- ipv6Association
Id string The association ID for the IPv6 CIDR block.
- ipv6Cidr
Block string The IPv6 CIDR block.
- main
Route stringTable Id 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 string The ID of the AWS account that owns the VPC.
- {[key: string]: string}
A map of tags to assign to the resource.
- arn str
Amazon Resource Name (ARN) of VPC
- assign_
generated_ boolipv6_ cidr_ block 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.- cidr_
block str The CIDR block for the VPC.
- default_
network_ stracl_ id The ID of the network ACL created by default on VPC creation
- default_
route_ strtable_ id The ID of the route table created by default on VPC creation
- default_
security_ strgroup_ id The ID of the security group created by default on VPC creation
- dhcp_
options_ strid - enable_
classiclink bool A boolean flag to enable/disable ClassicLink for the VPC. Only valid in regions and accounts that support EC2 Classic. See the ClassicLink documentation for more information. Defaults false.
- enable_
classiclink_ booldns_ support A boolean flag to enable/disable ClassicLink DNS Support for the VPC. Only valid in regions and accounts that support EC2 Classic.
- enable_
dns_ boolhostnames A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false.
- enable_
dns_ boolsupport A boolean flag to enable/disable DNS support in the VPC. Defaults true.
- instance_
tenancy str A tenancy option for instances launched into the VPC. Default is
default, which makes your instances shared on the host. Using either of the other options (dedicatedorhost) costs at least $2/hr.- ipv6_
association_ strid The association ID for the IPv6 CIDR block.
- ipv6_
cidr_ strblock The IPv6 CIDR block.
- main_
route_ strtable_ id 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.
- Dict[str, str]
A map of tags to assign to the resource.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.