Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
phuhung273 committed Dec 13, 2024
1 parent 2afd88d commit 76af4e5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/aws-cdk-lib/aws-ecs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1899,13 +1899,16 @@ taskDefinition.addContainer('TheContainer', {
User data are different between 3 supported OS: Amazon Linux 2023, Amazon Linux 2 and Bottlerocket. You have to specify `machineImageType` accordingly.

```ts
const autoScalingGroup = new autoscaling.AutoScalingGroup(stack, 'asg', {
declare const vpc: ec2.Vpc;
declare const cluster: ecs.Cluster;

const autoScalingGroup = new autoscaling.AutoScalingGroup(this, 'asg', {
vpc,
instanceType: new ec2.InstanceType('t2.micro'),
machineImage: ecs.EcsOptimizedImage.amazonLinux2023(),
});

const capacityProvider = new ecs.AsgCapacityProvider(stack, 'provider', {
const capacityProvider = new ecs.AsgCapacityProvider(this, 'provider', {
autoScalingGroup,
machineImageType: ecs.MachineImageType.AMAZON_LINUX_2023,
});
Expand Down

0 comments on commit 76af4e5

Please sign in to comment.