aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.55k stars 3.87k forks source link

aws_ecs: L2 support for restartpolicy #31425

Open raoz opened 2 weeks ago

raoz commented 2 weeks ago

Describe the feature

The RestartPolicy L1 construct is now available https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.CfnTaskDefinition.RestartPolicyProperty.html, but it cannot be conveniently set up using L2 ContainerDefinition.

Use Case

I use L2 constructs for setting up ECS services and need to set the restart policy for a container.

Proposed Solution

Add restartPolicy field to ContainerDefinition.

Other Information

No response

Acknowledgements

CDK version used

2.158.0

Environment details (OS name and version, etc.)

Typescript

ashishdhingra commented 2 weeks ago

RestartPolicy was added in L1 construct as a result of CFN schema change, refer https://github.com/aws/aws-cdk/issues/31127 and CfnTaskDefinition.ContainerDefinitionProperty. This should now be supported in L2 construct.

go-to-k commented 2 weeks ago

The PR has been submitted. It is now awaiting review.

https://github.com/aws/aws-cdk/pull/31228

toplac commented 1 week ago

Hey @go-to-k do you have any idea when this PR is ready to be merged? We are eagerly awaiting this feature

go-to-k commented 1 week ago

Right now I'm waiting for a review and I don't know when it will be reviewed as it depends on the status of the team. I can't wait either.

If we get more reactions to this issue, it will be prioritized.

go-to-k commented 3 days ago

The PR has been merged!