GetVpc

aws.ec2.Vpc provides details about a specific VPC.

This resource can prove useful when a module accepts a vpc id as an input variable and needs to, for example, determine the CIDR block of that VPC.

Example Usage

Coming soon!

Coming soon!

Coming soon!

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const config = new pulumi.Config();
const vpcId = config.require("vpcId");

const selected = pulumi.output(aws.ec2.getVpc({
    id: vpcId,
}, { async: true }));
const example = new aws.ec2.Subnet("example", {
    availabilityZone: "us-west-2a",
    cidrBlock: selected.apply(selected => (() => {
        throw "tf2pulumi error: NYI: call to cidrsubnet";
        return (() => { throw "NYI: call to cidrsubnet"; })();
    })()),
    vpcId: selected.id,
});

Using GetVpc

function getVpc(args: GetVpcArgs, opts?: InvokeOptions): Promise<GetVpcResult>
function  get_vpc(cidr_block=None, default=None, dhcp_options_id=None, filters=None, id=None, state=None, tags=None, opts=None)
func LookupVpc(ctx *Context, args *LookupVpcArgs, opts ...InvokeOption) (*LookupVpcResult, error)

Note: This function is named LookupVpc in the Go SDK.

public static class GetVpc {
    public static Task<GetVpcResult> InvokeAsync(GetVpcArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

CidrBlock string

The cidr block of the desired VPC.

Default bool

Boolean constraint on whether the desired VPC is the default VPC for the region.

DhcpOptionsId string

The DHCP options id of the desired VPC.

Filters List<GetVpcFilterArgs>

Custom filter block as described below.

Id string

The id of the specific VPC to retrieve.

State string

The current state of the desired VPC. Can be either "pending" or "available".

Tags Dictionary<string, string>

A map of tags, each pair of which must exactly match a pair on the desired VPC.

CidrBlock string

The cidr block of the desired VPC.

Default bool

Boolean constraint on whether the desired VPC is the default VPC for the region.

DhcpOptionsId string

The DHCP options id of the desired VPC.

Filters []GetVpcFilter

Custom filter block as described below.

Id string

The id of the specific VPC to retrieve.

State string

The current state of the desired VPC. Can be either "pending" or "available".

Tags map[string]string

A map of tags, each pair of which must exactly match a pair on the desired VPC.

cidrBlock string

The cidr block of the desired VPC.

default boolean

Boolean constraint on whether the desired VPC is the default VPC for the region.

dhcpOptionsId string

The DHCP options id of the desired VPC.

filters GetVpcFilter[]

Custom filter block as described below.

id string

The id of the specific VPC to retrieve.

state string

The current state of the desired VPC. Can be either "pending" or "available".

tags {[key: string]: string}

A map of tags, each pair of which must exactly match a pair on the desired VPC.

cidr_block str

The cidr block of the desired VPC.

default bool

Boolean constraint on whether the desired VPC is the default VPC for the region.

dhcp_options_id str

The DHCP options id of the desired VPC.

filters List[GetVpcFilter]

Custom filter block as described below.

id str

The id of the specific VPC to retrieve.

state str

The current state of the desired VPC. Can be either "pending" or "available".

tags Dict[str, str]

A map of tags, each pair of which must exactly match a pair on the desired VPC.

GetVpc Result

The following output properties are available:

Arn string

Amazon Resource Name (ARN) of VPC

CidrBlock string

The CIDR block for the association.

CidrBlockAssociations List<GetVpcCidrBlockAssociation>
Default bool
DhcpOptionsId string
EnableDnsHostnames bool

Whether or not the VPC has DNS hostname support

EnableDnsSupport bool

Whether or not the VPC has DNS support

Id string
InstanceTenancy string

The allowed tenancy of instances launched into the selected VPC. May be any of "default", "dedicated", or "host".

Ipv6AssociationId string

The association ID for the IPv6 CIDR block.

Ipv6CidrBlock string

The IPv6 CIDR block.

MainRouteTableId string

The ID of the main route table associated with this VPC.

OwnerId string

The ID of the AWS account that owns the VPC.

State string

The State of the association.

Tags Dictionary<string, string>
Filters List<GetVpcFilter>
Arn string

Amazon Resource Name (ARN) of VPC

CidrBlock string

The CIDR block for the association.

CidrBlockAssociations []GetVpcCidrBlockAssociation
Default bool
DhcpOptionsId string
EnableDnsHostnames bool

Whether or not the VPC has DNS hostname support

EnableDnsSupport bool

Whether or not the VPC has DNS support

Id string
InstanceTenancy string

The allowed tenancy of instances launched into the selected VPC. May be any of "default", "dedicated", or "host".

Ipv6AssociationId string

The association ID for the IPv6 CIDR block.

Ipv6CidrBlock string

The IPv6 CIDR block.

MainRouteTableId string

The ID of the main route table associated with this VPC.

OwnerId string

The ID of the AWS account that owns the VPC.

State string

The State of the association.

Tags map[string]string
Filters []GetVpcFilter
arn string

Amazon Resource Name (ARN) of VPC

cidrBlock string

The CIDR block for the association.

cidrBlockAssociations GetVpcCidrBlockAssociation[]
default boolean
dhcpOptionsId string
enableDnsHostnames boolean

Whether or not the VPC has DNS hostname support

enableDnsSupport boolean

Whether or not the VPC has DNS support

id string
instanceTenancy string

The allowed tenancy of instances launched into the selected VPC. May be any of "default", "dedicated", or "host".

ipv6AssociationId string

The association ID for the IPv6 CIDR block.

ipv6CidrBlock string

The IPv6 CIDR block.

mainRouteTableId string

The ID of the main route table associated with this VPC.

ownerId string

The ID of the AWS account that owns the VPC.

state string

The State of the association.

tags {[key: string]: string}
filters GetVpcFilter[]
arn str

Amazon Resource Name (ARN) of VPC

cidr_block str

The CIDR block for the association.

cidr_block_associations List[GetVpcCidrBlockAssociation]
default bool
dhcp_options_id str
enable_dns_hostnames bool

Whether or not the VPC has DNS hostname support

enable_dns_support bool

Whether or not the VPC has DNS support

id str
instance_tenancy str

The allowed tenancy of instances launched into the selected VPC. May be any of "default", "dedicated", or "host".

ipv6_association_id str

The association ID for the IPv6 CIDR block.

ipv6_cidr_block str

The IPv6 CIDR block.

main_route_table_id str

The ID of the main route table associated with this VPC.

owner_id str

The ID of the AWS account that owns the VPC.

state str

The State of the association.

tags Dict[str, str]
filters List[GetVpcFilter]

Supporting Types

GetVpcCidrBlockAssociation

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

AssociationId string

The association ID for the the IPv4 CIDR block.

CidrBlock string

The cidr block of the desired VPC.

State string

The current state of the desired VPC. Can be either "pending" or "available".

AssociationId string

The association ID for the the IPv4 CIDR block.

CidrBlock string

The cidr block of the desired VPC.

State string

The current state of the desired VPC. Can be either "pending" or "available".

associationId string

The association ID for the the IPv4 CIDR block.

cidrBlock string

The cidr block of the desired VPC.

state string

The current state of the desired VPC. Can be either "pending" or "available".

association_id str

The association ID for the the IPv4 CIDR block.

cidr_block str

The cidr block of the desired VPC.

state str

The current state of the desired VPC. Can be either "pending" or "available".

GetVpcFilter

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Name string

The name of the field to filter by, as defined by the underlying AWS API.

Values List<string>

Set of values that are accepted for the given field. A VPC will be selected if any one of the given values matches.

Name string

The name of the field to filter by, as defined by the underlying AWS API.

Values []string

Set of values that are accepted for the given field. A VPC will be selected if any one of the given values matches.

name string

The name of the field to filter by, as defined by the underlying AWS API.

values string[]

Set of values that are accepted for the given field. A VPC will be selected if any one of the given values matches.

name str

The name of the field to filter by, as defined by the underlying AWS API.

values List[str]

Set of values that are accepted for the given field. A VPC will be selected if any one of the given values matches.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.