aws-cdk/aws-ecs : Add support for ECS_IMAGE_PULL_BEHAVIOR
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the feature
Allow the user to configure ECS_IMAGE_PULL_BEHAVIOR through cdk
### Use Case
Improves ECS task startup as the container instance can use a cached image
### Proposed Solution
Add a new prop `ecsImagePullBehavior` to `AsgCapacityProviderProps`. Update this section https://github.com/aws/aws-cdk/blob/cea1039e3664fdfa89c6f00cdaeb1a0185a12678/packages/%40aws-cdk/aws-ecs/lib/cluster.ts#L389-L426 with a conditional that checks if `props.ecsImagePullBehavior` is specified.
For Bottlerocket, add this line to userData `image-pull-behavior = "once"` (taken from https://github.com/bottlerocket-os/bottlerocket#amazon-ecs-settings) where the value is based on `ecsImagePullBehavior`. Didn't have a chance to look at AL2's implementation.
### Other Information
_No response_
### Acknowledgements
- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
### CDK version used
2.60.0
### Environment details (OS name and version, etc.)
Linux
Contributor guide
Research direction
Start in packages/@aws-cdk/aws-ecs/lib/cluster.ts, at the AsgCapacityProviderProps section linked in the issue, and trace how user data is generated for Bottlerocket and AL2. Implement the ecsImagePullBehavior prop and verify that the corresponding conditional emits the configured behavior for each supported operating system.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100