Skip to content
v2.278.0

VpcContextResponse Struct ​

Properties of a discovered VPC.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { cx_api } from 'aws-cdk-lib';
const vpcContextResponse: cx_api.VpcContextResponse = {
  availabilityZones: ['availabilityZones'],
  vpcId: 'vpcId',

  // the properties below are optional
  isolatedSubnetIds: ['isolatedSubnetIds'],
  isolatedSubnetNames: ['isolatedSubnetNames'],
  isolatedSubnetRouteTableIds: ['isolatedSubnetRouteTableIds'],
  ownerAccountId: 'ownerAccountId',
  privateSubnetIds: ['privateSubnetIds'],
  privateSubnetNames: ['privateSubnetNames'],
  privateSubnetRouteTableIds: ['privateSubnetRouteTableIds'],
  publicSubnetIds: ['publicSubnetIds'],
  publicSubnetNames: ['publicSubnetNames'],
  publicSubnetRouteTableIds: ['publicSubnetRouteTableIds'],
  region: 'region',
  subnetGroups: [{
    name: 'name',
    subnets: [{
      availabilityZone: 'availabilityZone',
      routeTableId: 'routeTableId',
      subnetId: 'subnetId',

      // the properties below are optional
      cidr: 'cidr',
    }],
    type: cx_api.VpcSubnetGroupType.PUBLIC,
  }],
  vpcCidrBlock: 'vpcCidrBlock',
  vpnGatewayId: 'vpnGatewayId',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import cx_api

vpc_context_response = cx_api.VpcContextResponse(
    availability_zones=["availabilityZones"],
    vpc_id="vpcId",

    # the properties below are optional
    isolated_subnet_ids=["isolatedSubnetIds"],
    isolated_subnet_names=["isolatedSubnetNames"],
    isolated_subnet_route_table_ids=["isolatedSubnetRouteTableIds"],
    owner_account_id="ownerAccountId",
    private_subnet_ids=["privateSubnetIds"],
    private_subnet_names=["privateSubnetNames"],
    private_subnet_route_table_ids=["privateSubnetRouteTableIds"],
    public_subnet_ids=["publicSubnetIds"],
    public_subnet_names=["publicSubnetNames"],
    public_subnet_route_table_ids=["publicSubnetRouteTableIds"],
    region="region",
    subnet_groups=[cx_api.VpcSubnetGroup(
        name="name",
        subnets=[cx_api.VpcSubnet(
            availability_zone="availabilityZone",
            route_table_id="routeTableId",
            subnet_id="subnetId",

            # the properties below are optional
            cidr="cidr"
        )],
        type=cx_api.VpcSubnetGroupType.PUBLIC
    )],
    vpc_cidr_block="vpcCidrBlock",
    vpn_gateway_id="vpnGatewayId"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.cxapi.*;

VpcContextResponse vpcContextResponse = VpcContextResponse.builder()
        .availabilityZones(List.of("availabilityZones"))
        .vpcId("vpcId")

        // the properties below are optional
        .isolatedSubnetIds(List.of("isolatedSubnetIds"))
        .isolatedSubnetNames(List.of("isolatedSubnetNames"))
        .isolatedSubnetRouteTableIds(List.of("isolatedSubnetRouteTableIds"))
        .ownerAccountId("ownerAccountId")
        .privateSubnetIds(List.of("privateSubnetIds"))
        .privateSubnetNames(List.of("privateSubnetNames"))
        .privateSubnetRouteTableIds(List.of("privateSubnetRouteTableIds"))
        .publicSubnetIds(List.of("publicSubnetIds"))
        .publicSubnetNames(List.of("publicSubnetNames"))
        .publicSubnetRouteTableIds(List.of("publicSubnetRouteTableIds"))
        .region("region")
        .subnetGroups(List.of(VpcSubnetGroup.builder()
                .name("name")
                .subnets(List.of(VpcSubnet.builder()
                        .availabilityZone("availabilityZone")
                        .routeTableId("routeTableId")
                        .subnetId("subnetId")

                        // the properties below are optional
                        .cidr("cidr")
                        .build()))
                .type(VpcSubnetGroupType.PUBLIC)
                .build()))
        .vpcCidrBlock("vpcCidrBlock")
        .vpnGatewayId("vpnGatewayId")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.CXAPI;

var vpcContextResponse = new VpcContextResponse {
    AvailabilityZones = new [] { "availabilityZones" },
    VpcId = "vpcId",

    // the properties below are optional
    IsolatedSubnetIds = new [] { "isolatedSubnetIds" },
    IsolatedSubnetNames = new [] { "isolatedSubnetNames" },
    IsolatedSubnetRouteTableIds = new [] { "isolatedSubnetRouteTableIds" },
    OwnerAccountId = "ownerAccountId",
    PrivateSubnetIds = new [] { "privateSubnetIds" },
    PrivateSubnetNames = new [] { "privateSubnetNames" },
    PrivateSubnetRouteTableIds = new [] { "privateSubnetRouteTableIds" },
    PublicSubnetIds = new [] { "publicSubnetIds" },
    PublicSubnetNames = new [] { "publicSubnetNames" },
    PublicSubnetRouteTableIds = new [] { "publicSubnetRouteTableIds" },
    Region = "region",
    SubnetGroups = new [] { new VpcSubnetGroup {
        Name = "name",
        Subnets = new [] { new VpcSubnet {
            AvailabilityZone = "availabilityZone",
            RouteTableId = "routeTableId",
            SubnetId = "subnetId",

            // the properties below are optional
            Cidr = "cidr"
        } },
        Type = VpcSubnetGroupType.PUBLIC
    } },
    VpcCidrBlock = "vpcCidrBlock",
    VpnGatewayId = "vpnGatewayId"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

vpcContextResponse := &VpcContextResponse{
	AvailabilityZones: []*string{
		jsii.String("availabilityZones"),
	},
	VpcId: jsii.String("vpcId"),

	// the properties below are optional
	IsolatedSubnetIds: []*string{
		jsii.String("isolatedSubnetIds"),
	},
	IsolatedSubnetNames: []*string{
		jsii.String("isolatedSubnetNames"),
	},
	IsolatedSubnetRouteTableIds: []*string{
		jsii.String("isolatedSubnetRouteTableIds"),
	},
	OwnerAccountId: jsii.String("ownerAccountId"),
	PrivateSubnetIds: []*string{
		jsii.String("privateSubnetIds"),
	},
	PrivateSubnetNames: []*string{
		jsii.String("privateSubnetNames"),
	},
	PrivateSubnetRouteTableIds: []*string{
		jsii.String("privateSubnetRouteTableIds"),
	},
	PublicSubnetIds: []*string{
		jsii.String("publicSubnetIds"),
	},
	PublicSubnetNames: []*string{
		jsii.String("publicSubnetNames"),
	},
	PublicSubnetRouteTableIds: []*string{
		jsii.String("publicSubnetRouteTableIds"),
	},
	Region: jsii.String("region"),
	SubnetGroups: []VpcSubnetGroup{
		&VpcSubnetGroup{
			Name: jsii.String("name"),
			Subnets: []VpcSubnet{
				&VpcSubnet{
					AvailabilityZone: jsii.String("availabilityZone"),
					RouteTableId: jsii.String("routeTableId"),
					SubnetId: jsii.String("subnetId"),

					// the properties below are optional
					Cidr: jsii.String("cidr"),
				},
			},
			Type: awscdk.Cx_api.VpcSubnetGroupType_PUBLIC,
		},
	},
	VpcCidrBlock: jsii.String("vpcCidrBlock"),
	VpnGatewayId: jsii.String("vpnGatewayId"),
}

Properties ​

availabilityZonesstring[]availability_zonestyping.List[str]availabilityZonesList<String>AvailabilityZonesstring[]AvailabilityZones*[]*string required #
AZs.
isolatedSubnetIdsoptionalstring[]isolated_subnet_idsoptionaltyping.List[str]isolatedSubnetIdsoptionalList<String>IsolatedSubnetIdsoptionalstring[]IsolatedSubnetIdsoptional*[]*string #
IDs of all isolated subnets.

Element count: #(availabilityZones) · #(isolatedGroups)

isolatedSubnetNamesoptionalstring[]isolated_subnet_namesoptionaltyping.List[str]isolatedSubnetNamesoptionalList<String>IsolatedSubnetNamesoptionalstring[]IsolatedSubnetNamesoptional*[]*string #
Name of isolated subnet groups.

Element count: #(isolatedGroups)

isolatedSubnetRouteTableIdsoptionalstring[]isolated_subnet_route_table_idsoptionaltyping.List[str]isolatedSubnetRouteTableIdsoptionalList<String>IsolatedSubnetRouteTableIdsoptionalstring[]IsolatedSubnetRouteTableIdsoptional*[]*string #
Route Table IDs of isolated subnet groups.

Element count: #(availabilityZones) · #(isolatedGroups)

ownerAccountIdoptionalstringowner_account_idoptionalstrownerAccountIdoptionalStringOwnerAccountIdoptionalstringOwnerAccountIdoptional*string #
The ID of the AWS account that owns the VPC.

Default: the account id of the parent stack

privateSubnetIdsoptionalstring[]private_subnet_idsoptionaltyping.List[str]privateSubnetIdsoptionalList<String>PrivateSubnetIdsoptionalstring[]PrivateSubnetIdsoptional*[]*string #
IDs of all private subnets.

Element count: #(availabilityZones) · #(privateGroups)

privateSubnetNamesoptionalstring[]private_subnet_namesoptionaltyping.List[str]privateSubnetNamesoptionalList<String>PrivateSubnetNamesoptionalstring[]PrivateSubnetNamesoptional*[]*string #
Name of private subnet groups.

Element count: #(privateGroups)

privateSubnetRouteTableIdsoptionalstring[]private_subnet_route_table_idsoptionaltyping.List[str]privateSubnetRouteTableIdsoptionalList<String>PrivateSubnetRouteTableIdsoptionalstring[]PrivateSubnetRouteTableIdsoptional*[]*string #
Route Table IDs of private subnet groups.

Element count: #(availabilityZones) · #(privateGroups)

publicSubnetIdsoptionalstring[]public_subnet_idsoptionaltyping.List[str]publicSubnetIdsoptionalList<String>PublicSubnetIdsoptionalstring[]PublicSubnetIdsoptional*[]*string #
IDs of all public subnets.

Element count: #(availabilityZones) · #(publicGroups)

publicSubnetNamesoptionalstring[]public_subnet_namesoptionaltyping.List[str]publicSubnetNamesoptionalList<String>PublicSubnetNamesoptionalstring[]PublicSubnetNamesoptional*[]*string #
Name of public subnet groups.

Element count: #(publicGroups)

publicSubnetRouteTableIdsoptionalstring[]public_subnet_route_table_idsoptionaltyping.List[str]publicSubnetRouteTableIdsoptionalList<String>PublicSubnetRouteTableIdsoptionalstring[]PublicSubnetRouteTableIdsoptional*[]*string #
Route Table IDs of public subnet groups.

Element count: #(availabilityZones) · #(publicGroups)

regionoptionalstringregionoptionalstrregionoptionalStringRegionoptionalstringRegionoptional*string #
The region in which the VPC is in.

Default: Region of the parent stack

subnetGroupsoptionalVpcSubnetGroup[]subnet_groupsoptionaltyping.List[VpcSubnetGroup]subnetGroupsoptionalList<VpcSubnetGroup>SubnetGroupsoptionalVpcSubnetGroup[]SubnetGroupsoptional*[]VpcSubnetGroup #
The subnet groups discovered for the given VPC.

Default: no subnet groups will be returned unless VpcContextQuery.returnAsymmetricSubnets is true

Unlike the above properties, this will include asymmetric subnets, if the VPC has any. This property will only be populated if VpcContextQuery.returnAsymmetricSubnets is true.

vpcCidrBlockoptionalstringvpc_cidr_blockoptionalstrvpcCidrBlockoptionalStringVpcCidrBlockoptionalstringVpcCidrBlockoptional*string #
VPC cidr.

Default: CIDR information not available

vpcIdstringvpc_idstrvpcIdStringVpcIdstringVpcId*string required #
VPC id.
vpnGatewayIdoptionalstringvpn_gateway_idoptionalstrvpnGatewayIdoptionalStringVpnGatewayIdoptionalstringVpnGatewayIdoptional*string #
The VPN gateway ID.