interface VpcLookupOptions
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.EC2.VpcLookupOptions |
Java | software.amazon.awscdk.services.ec2.VpcLookupOptions |
Python | aws_cdk.aws_ec2.VpcLookupOptions |
TypeScript (source) | @aws-cdk/aws-ec2 » VpcLookupOptions |
Properties for looking up an existing VPC.
The combination of properties must specify filter down to exactly one non-default VPC, otherwise an error is raised.
Example
// create a cloud9 ec2 environment in a new VPC
const vpc = new ec2.Vpc(this, 'VPC', { maxAzs: 3});
new cloud9.Ec2Environment(this, 'Cloud9Env', { vpc });
// or create the cloud9 environment in the default VPC with specific instanceType
const defaultVpc = ec2.Vpc.fromLookup(this, 'DefaultVPC', { isDefault: true });
new cloud9.Ec2Environment(this, 'Cloud9Env2', {
vpc: defaultVpc,
instanceType: new ec2.InstanceType('t3.large'),
});
// or specify in a different subnetSelection
const c9env = new cloud9.Ec2Environment(this, 'Cloud9Env3', {
vpc,
subnetSelection: {
subnetType: ec2.SubnetType.PRIVATE_WITH_NAT,
},
});
// print the Cloud9 IDE URL in the output
new CfnOutput(this, 'URL', { value: c9env.ideUrl });
Properties
Name | Type | Description |
---|---|---|
is | boolean | Whether to match the default VPC. |
region? | string | Optional to override inferred region. |
subnet | string | Optional tag for subnet group name. |
tags? | { [string]: string } | Tags on the VPC. |
vpc | string | The ID of the VPC. |
vpc | string | The name of the VPC. |
isDefault?
Type:
boolean
(optional, default: Don't care whether we return the default VPC)
Whether to match the default VPC.
region?
Type:
string
(optional, default: Current stack's environment region)
Optional to override inferred region.
subnetGroupNameTag?
Type:
string
(optional, default: 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.
tags?
Type:
{ [string]: string }
(optional, default: Don't filter on tags)
Tags on the VPC.
The VPC must have all of these tags
vpcId?
Type:
string
(optional, default: Don't filter on vpcId)
The ID of the VPC.
If given, will import exactly this VPC.
vpcName?
Type:
string
(optional, default: Don't filter on vpcName)
The name of the VPC.
If given, will import the VPC with this name.