@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.521Z") @Stability(value=Stable) public interface VpcLookupOptions extends software.amazon.jsii.JsiiSerializable
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
Vpc vpc = Vpc.Builder.create(this, "VPC").maxAzs(3).build();
Ec2Environment.Builder.create(this, "Cloud9Env").vpc(vpc).imageId(ImageId.AMAZON_LINUX_2).build();
// or create the cloud9 environment in the default VPC with specific instanceType
IVpc defaultVpc = Vpc.fromLookup(this, "DefaultVPC", VpcLookupOptions.builder().isDefault(true).build());
Ec2Environment.Builder.create(this, "Cloud9Env2")
.vpc(defaultVpc)
.instanceType(new InstanceType("t3.large"))
.imageId(ImageId.AMAZON_LINUX_2)
.build();
// or specify in a different subnetSelection
Ec2Environment c9env = Ec2Environment.Builder.create(this, "Cloud9Env3")
.vpc(vpc)
.subnetSelection(SubnetSelection.builder()
.subnetType(SubnetType.PRIVATE_WITH_EGRESS)
.build())
.imageId(ImageId.AMAZON_LINUX_2)
.build();
// print the Cloud9 IDE URL in the output
// print the Cloud9 IDE URL in the output
CfnOutput.Builder.create(this, "URL").value(c9env.getIdeUrl()).build();
| Modifier and Type | Interface and Description |
|---|---|
static class |
VpcLookupOptions.Builder
A builder for
VpcLookupOptions |
static class |
VpcLookupOptions.Jsii$Proxy
An implementation for
VpcLookupOptions |
| Modifier and Type | Method and Description |
|---|---|
static VpcLookupOptions.Builder |
builder() |
default Boolean |
getIsDefault()
Whether to match the default VPC.
|
default String |
getRegion()
Optional to override inferred region.
|
default String |
getSubnetGroupNameTag()
Optional tag for subnet group name.
|
default Map<String,String> |
getTags()
Tags on the VPC.
|
default String |
getVpcId()
The ID of the VPC.
|
default String |
getVpcName()
The name of the VPC.
|
@Stability(value=Stable) @Nullable default Boolean getIsDefault()
Default: Don't care whether we return the default VPC
@Stability(value=Stable) @Nullable default String getRegion()
Default: Current stack's environment region
@Stability(value=Stable) @Nullable default String getSubnetGroupNameTag()
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.
Default: aws-cdk:subnet-name
@Stability(value=Stable) @Nullable default Map<String,String> getTags()
The VPC must have all of these tags
Default: Don't filter on tags
@Stability(value=Stable) @Nullable default String getVpcId()
If given, will import exactly this VPC.
Default: Don't filter on vpcId
@Stability(value=Stable) @Nullable default String getVpcName()
If given, will import the VPC with this name.
Default: Don't filter on vpcName
@Stability(value=Stable) static VpcLookupOptions.Builder builder()
VpcLookupOptions.Builder of VpcLookupOptionsCopyright © 2022. All rights reserved.