@pahud/cdktf-aws-ecs
v0.1.92
Published
CDKTF construct library for Amazon ECS
Downloads
1,020
Readme
cdktf-aws-ecs
CDKTF construct library for Amazon ECS.
Usage
The following sample creates:
- A new VPC
- Amazon ECS cluster
- Autoscaling Group capacity provider
- Autoscaling Group with Launch Template
import { Cluster } from '@pahud/cdktf-aws-ecs';
// create the cluster
const cluster = new Cluster(stack, 'EcsCluster');
// create the ASG capacity with capacity provider
cluster.addAsgCapacity('ASGCapacity', {
maxCapacity: 10,
minCapacity: 0,
desiredCapacity: 2,
});
Existing VPC subnets
To deploy in any existing VPC, specify the vpcSubnets
.
cluster.addAsgCapacity('ASGCapacity', {
vpcSubnets: ['subnet-111','subnet-222','subnet-333' ],
});
Bottlerocket support
To create cluster capacity with Bottlerocket machine image:
cluster.addAsgCapacity('BRCapacity', {
machineImage: new BottleRocketImage(stack),
});