@Generated(value="jsii-pacmak/1.47.0 (build 86d2c33)", date="2021-12-22T10:27:17.154Z") @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:
IVpc vpc = Vpc.fromLookup(this, "Vpc", VpcLookupOptions.builder()
.isDefault(true)
.build());
Cluster cluster = Cluster.Builder.create(this, "Ec2Cluster").vpc(vpc).build();
cluster.addCapacity("DefaultAutoScalingGroup", AddCapacityOptions.builder()
.instanceType(new InstanceType("t2.micro"))
.vpcSubnets(SubnetSelection.builder().subnetType(SubnetType.PUBLIC).build())
.build());
TaskDefinition taskDefinition = TaskDefinition.Builder.create(this, "TD")
.compatibility(Compatibility.EC2)
.build();
taskDefinition.addContainer("TheContainer", ContainerDefinitionOptions.builder()
.image(ContainerImage.fromRegistry("foo/bar"))
.memoryLimitMiB(256)
.build());
EcsRunTask runTask = EcsRunTask.Builder.create(this, "Run")
.integrationPattern(IntegrationPattern.RUN_JOB)
.cluster(cluster)
.taskDefinition(taskDefinition)
.launchTarget(EcsEc2LaunchTarget.Builder.create()
.placementStrategies(List.of(PlacementStrategy.spreadAcrossInstances(), PlacementStrategy.packedByCpu(), PlacementStrategy.randomly()))
.placementConstraints(List.of(PlacementConstraint.memberOf("blieptuut")))
.build())
.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 © 2021. All rights reserved.