CDKTF construct library for Amazon ECS
npm install @pahud/cdktf-aws-ecs



CDKTF construct library for Amazon ECS.
The following sample creates:
1. A new VPC
1. Amazon ECS cluster
2. Autoscaling Group capacity provider
3. Autoscaling Group with Launch Template
``ts
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,
});
`
To deploy in any existing VPC, specify the vpcSubnets.
`ts`
cluster.addAsgCapacity('ASGCapacity', {
vpcSubnets: ['subnet-111','subnet-222','subnet-333' ],
});
To create cluster capacity with Bottlerocket machine image:
`ts``
cluster.addAsgCapacity('BRCapacity', {
machineImage: new BottleRocketImage(stack),
});