Closed darko-mesaros closed 3 years ago
Hi @darko-mesaros!
The missing piece here is you also need to specify machineImage
as a property when you call addCapacity
. I've updated the README with a working example in https://github.com/aws/aws-cdk/pull/14536 -- hope that helps!
Ah good! I was under the impression that I would need to know the AMI ID to be used at all times. This is a much better option! Thanks! 👏
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Okay, so, I wish to launch a Gravion2 ECS Cluster, and I wish to use CDK for that. I am using
.addCapacity
to create the AutoScaling Group for my cluster, and I am only specifying the instance type.Unless I define a
machineImage
property and use the ECS optimized AMI (for aarch64), it will attempt to launch it with the regular x86 ECS optimized AMI. And the launch of EC2 Instances fail:Use Case
We can keep using the dynamic nature of AMI IDs and not have to hardcode the AMI id for the ECS optimized image for Graviton2.
Proposed Solution
Ideally if CDK could verify if the instance type is an ARM based instance, it would use the appropriate AMI.
Other
CDK Version: 1.100.0 (build d996c6d) OS: Mac Os Big Sur Kernel: Darwin m1-air.lan 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101 arm64
This is a :rocket: Feature Request