Skip to content
v2.277.0

VpcContextQuery Struct ​

Query input for looking up a VPC.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { cloud_assembly_schema } from 'aws-cdk-lib';

declare const assumeRoleAdditionalOptions: any;
const vpcContextQuery: cloud_assembly_schema.VpcContextQuery = {
  account: 'account',
  filter: {
    filterKey: 'filter',
  },
  region: 'region',

  // the properties below are optional
  assumeRoleAdditionalOptions: {
    assumeRoleAdditionalOptionsKey: assumeRoleAdditionalOptions,
  },
  lookupRoleArn: 'lookupRoleArn',
  lookupRoleExternalId: 'lookupRoleExternalId',
  returnAsymmetricSubnets: false,
  returnVpnGateways: false,
  subnetGroupNameTag: 'subnetGroupNameTag',
};
python
from aws_cdk.cloud_assembly_schema import VpcContextQuery
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import cloud_assembly_schema

# assume_role_additional_options: Any

vpc_context_query = VpcContextQuery(
    account="account",
    filter={
        "filter_key": "filter"
    },
    region="region",

    # the properties below are optional
    assume_role_additional_options={
        "assume_role_additional_options_key": assume_role_additional_options
    },
    lookup_role_arn="lookupRoleArn",
    lookup_role_external_id="lookupRoleExternalId",
    return_asymmetric_subnets=False,
    return_vpn_gateways=False,
    subnet_group_name_tag="subnetGroupNameTag"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.cloud_assembly_schema.*;

Object assumeRoleAdditionalOptions;

VpcContextQuery vpcContextQuery = VpcContextQuery.builder()
        .account("account")
        .filter(Map.of(
                "filterKey", "filter"))
        .region("region")

        // the properties below are optional
        .assumeRoleAdditionalOptions(Map.of(
                "assumeRoleAdditionalOptionsKey", assumeRoleAdditionalOptions))
        .lookupRoleArn("lookupRoleArn")
        .lookupRoleExternalId("lookupRoleExternalId")
        .returnAsymmetricSubnets(false)
        .returnVpnGateways(false)
        .subnetGroupNameTag("subnetGroupNameTag")
        .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.Cloud_assembly_schema;

var assumeRoleAdditionalOptions;

var vpcContextQuery = new VpcContextQuery {
    Account = "account",
    Filter = new Dictionary<string, string> {
        { "filterKey", "filter" }
    },
    Region = "region",

    // the properties below are optional
    AssumeRoleAdditionalOptions = new Dictionary<string, object> {
        { "assumeRoleAdditionalOptionsKey", assumeRoleAdditionalOptions }
    },
    LookupRoleArn = "lookupRoleArn",
    LookupRoleExternalId = "lookupRoleExternalId",
    ReturnAsymmetricSubnets = false,
    ReturnVpnGateways = false,
    SubnetGroupNameTag = "subnetGroupNameTag"
};
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"

var assumeRoleAdditionalOptions interface{}

vpcContextQuery := &VpcContextQuery{
	Account: jsii.String("account"),
	Filter: map[string]*string{
		"filterKey": jsii.String("filter"),
	},
	Region: jsii.String("region"),

	// the properties below are optional
	AssumeRoleAdditionalOptions: map[string]interface{}{
		"assumeRoleAdditionalOptionsKey": assumeRoleAdditionalOptions,
	},
	LookupRoleArn: jsii.String("lookupRoleArn"),
	LookupRoleExternalId: jsii.String("lookupRoleExternalId"),
	ReturnAsymmetricSubnets: jsii.Boolean(false),
	ReturnVpnGateways: jsii.Boolean(false),
	SubnetGroupNameTag: jsii.String("subnetGroupNameTag"),
}

Properties ​

accountstringaccountstraccountStringAccountstringAccount*string required #
Query account.
assumeRoleAdditionalOptionsoptional{ [key: string]: any }assume_role_additional_optionsoptionaltyping.Mapping[str, Any]assumeRoleAdditionalOptionsoptionalMap<String, Object>AssumeRoleAdditionalOptionsoptionalIDictionary<string, object>AssumeRoleAdditionalOptionsoptional*map[string]interface{} #
Additional options to pass to STS when assuming the lookup role.

Default: No additional options.

  • RoleArn should not be used. Use the dedicated lookupRoleArn property instead.
  • ExternalId should not be used. Use the dedicated lookupRoleExternalId instead.
filter{ [key: string]: string }filtertyping.Mapping[str, str]filterMap<String, String>FilterIDictionary<string, string>Filter*map[string]*string required #
Filters to apply to the VPC.

Filter parameters are the same as passed to DescribeVpcs.

lookupRoleArnoptionalstringlookup_role_arnoptionalstrlookupRoleArnoptionalStringLookupRoleArnoptionalstringLookupRoleArnoptional*string = None #
The ARN of the role that should be used to look up the missing values.
lookupRoleExternalIdoptionalstringlookup_role_external_idoptionalstrlookupRoleExternalIdoptionalStringLookupRoleExternalIdoptionalstringLookupRoleExternalIdoptional*string #
The ExternalId that needs to be supplied while assuming this role.

Default: No ExternalId will be supplied

regionstringregionstrregionStringRegionstringRegion*string required #
Query region.
returnAsymmetricSubnetsoptionalbooleanreturn_asymmetric_subnetsoptionalboolreturnAsymmetricSubnetsoptionalBooleanReturnAsymmetricSubnetsoptionalboolReturnAsymmetricSubnetsoptional*bool = false #
Whether to populate the subnetGroups field of the `VpcContextResponse`, which contains potentially asymmetric subnet groups.
returnVpnGatewaysoptionalbooleanreturn_vpn_gatewaysoptionalboolreturnVpnGatewaysoptionalBooleanReturnVpnGatewaysoptionalboolReturnVpnGatewaysoptional*bool = true #
Whether to populate the `vpnGatewayId` field of the `VpcContextResponse`, which contains the VPN Gateway ID, if one exists.

You can explicitly disable this in order to avoid the lookup if you know the VPC does not have a VPN Gatway attached.

subnetGroupNameTagoptionalstringsubnet_group_name_tagoptionalstrsubnetGroupNameTagoptionalStringSubnetGroupNameTagoptionalstringSubnetGroupNameTagoptional*string = 'aws-cdk:subnet-name' #
Optional tag for subnet group name.

If not provided, we'll look at the aws-cdk:subnet-name tag. If the subnet does not have the specified tag, we'll use its type as the name.