@Generated(value="jsii-pacmak/1.50.0 (build d1830a4)", date="2022-01-04T15:39:06.795Z") @Stability(value=Experimental) 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()
(experimental) Whether to match the default VPC.
|
default String |
getRegion()
(experimental) Optional to override inferred region.
|
default String |
getSubnetGroupNameTag()
(experimental) Optional tag for subnet group name.
|
default Map<String,String> |
getTags()
(experimental) Tags on the VPC.
|
default String |
getVpcId()
(experimental) The ID of the VPC.
|
default String |
getVpcName()
(experimental) The name of the VPC.
|
@Stability(value=Experimental) @Nullable default Boolean getIsDefault()
Default: Don't care whether we return the default VPC
@Stability(value=Experimental) @Nullable default String getRegion()
Default: Current stack's environment region
@Stability(value=Experimental) @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=Experimental) @Nullable default Map<String,String> getTags()
The VPC must have all of these tags
Default: Don't filter on tags
@Stability(value=Experimental) @Nullable default String getVpcId()
If given, will import exactly this VPC.
Default: Don't filter on vpcId
@Stability(value=Experimental) @Nullable default String getVpcName()
If given, will import the VPC with this name.
Default: Don't filter on vpcName
@Stability(value=Experimental) static VpcLookupOptions.Builder builder()
VpcLookupOptions.Builder of VpcLookupOptionsCopyright © 2022. All rights reserved.