We recommend new projects start with resources from the AWS provider.
aws-native.ec2.getVpc
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.
Using getVpc
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getVpc(args: GetVpcArgs, opts?: InvokeOptions): Promise<GetVpcResult>
function getVpcOutput(args: GetVpcOutputArgs, opts?: InvokeOptions): Output<GetVpcResult>def get_vpc(vpc_id: Optional[str] = None,
            opts: Optional[InvokeOptions] = None) -> GetVpcResult
def get_vpc_output(vpc_id: Optional[pulumi.Input[str]] = None,
            opts: Optional[InvokeOptions] = None) -> Output[GetVpcResult]func LookupVpc(ctx *Context, args *LookupVpcArgs, opts ...InvokeOption) (*LookupVpcResult, error)
func LookupVpcOutput(ctx *Context, args *LookupVpcOutputArgs, opts ...InvokeOption) LookupVpcResultOutput> Note: This function is named LookupVpc in the Go SDK.
public static class GetVpc 
{
    public static Task<GetVpcResult> InvokeAsync(GetVpcArgs args, InvokeOptions? opts = null)
    public static Output<GetVpcResult> Invoke(GetVpcInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetVpcResult> getVpc(GetVpcArgs args, InvokeOptions options)
public static Output<GetVpcResult> getVpc(GetVpcArgs args, InvokeOptions options)
fn::invoke:
  function: aws-native:ec2:getVpc
  arguments:
    # arguments dictionaryThe following arguments are supported:
- VpcId string
- The ID of the VPC.
- VpcId string
- The ID of the VPC.
- vpcId String
- The ID of the VPC.
- vpcId string
- The ID of the VPC.
- vpc_id str
- The ID of the VPC.
- vpcId String
- The ID of the VPC.
getVpc Result
The following output properties are available:
- 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.
- 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.
- Ipv6CidrBlocks List<string>
- The IPv6 CIDR blocks for the VPC. For example, [ 2001:db8:1234:1a00::/56 ].
- 
List<Pulumi.Aws Native. Outputs. Tag> 
- The tags for the VPC.
- 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.
- 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.
- Ipv6CidrBlocks []string
- The IPv6 CIDR blocks for the VPC. For example, [ 2001:db8:1234:1a00::/56 ].
- Tag
- The tags for the VPC.
- 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.
- 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.
- ipv6CidrBlocks List<String>
- The IPv6 CIDR blocks for the VPC. For example, [ 2001:db8:1234:1a00::/56 ].
- List<Tag>
- The tags for the VPC.
- 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.
- 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.
- ipv6CidrBlocks string[]
- The IPv6 CIDR blocks for the VPC. For example, [ 2001:db8:1234:1a00::/56 ].
- Tag[]
- The tags for the VPC.
- 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.
- 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.
- ipv6_cidr_ Sequence[str]blocks 
- The IPv6 CIDR blocks for the VPC. For example, [ 2001:db8:1234:1a00::/56 ].
- Sequence[root_Tag]
- The tags for the VPC.
- 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.
- 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.
- ipv6CidrBlocks List<String>
- The IPv6 CIDR blocks for the VPC. For example, [ 2001:db8:1234:1a00::/56 ].
- List<Property Map>
- The tags for the VPC.
- vpcId String
- The ID of the VPC.
Supporting Types
Tag
Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0
We recommend new projects start with resources from the AWS provider.