Interface VpcLookupOptions

All Superinterfaces:
All Known Implementing Classes:

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:39.564Z") @Stability(Stable) public interface VpcLookupOptions extends
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.


 // 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).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")
         .instanceType(new InstanceType("t3.large"))
 // or specify in a different subnetSelection
 Ec2Environment c9env = Ec2Environment.Builder.create(this, "Cloud9Env3")
 // 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();
  • Method Details

    • getIsDefault

      @Stability(Stable) @Nullable default Boolean getIsDefault()
      Whether to match the default VPC.

      Default: Don't care whether we return the default VPC

    • getRegion

      @Stability(Stable) @Nullable default String getRegion()
      Optional to override inferred region.

      Default: Current stack's environment region

    • getSubnetGroupNameTag

      @Stability(Stable) @Nullable default String getSubnetGroupNameTag()
      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.

      Default: aws-cdk:subnet-name

    • getTags

      @Stability(Stable) @Nullable default Map<String,String> getTags()
      Tags on the VPC.

      The VPC must have all of these tags

      Default: Don't filter on tags

    • getVpcId

      @Stability(Stable) @Nullable default String getVpcId()
      The ID of the VPC.

      If given, will import exactly this VPC.

      Default: Don't filter on vpcId

    • getVpcName

      @Stability(Stable) @Nullable default String getVpcName()
      The name of the VPC.

      If given, will import the VPC with this name.

      Default: Don't filter on vpcName

    • builder

      @Stability(Stable) static VpcLookupOptions.Builder builder()
      a VpcLookupOptions.Builder of VpcLookupOptions