Skip to content

Conversation

kg-aws
Copy link
Contributor

@kg-aws kg-aws commented Oct 7, 2025

Issue # (if applicable)

Closes #.

Reason for this change

Description of changes

Added support for ecs service hook details field. AWS::ECS::Service only accepts JSON object as a string for this field.

Public Doc: https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-properties-ecs-service-deploymentlifecyclehook.html#cfn-ecs-service-deploymentlifecyclehook-hookdetails

Describe any new or updated permissions being added

Description of how you validated changes

  • Added unit tests
  • Updated integration tests

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@kg-aws kg-aws had a problem deploying to deployment-integ-test October 7, 2025 18:26 — with GitHub Actions Error
@github-actions github-actions bot added the p2 label Oct 7, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team October 7, 2025 18:26
@github-actions github-actions bot added the beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK label Oct 7, 2025
@kg-aws kg-aws marked this pull request as ready for review October 8, 2025 13:53
@kg-aws kg-aws had a problem deploying to deployment-integ-test October 8, 2025 14:00 — with GitHub Actions Error
@kg-aws kg-aws had a problem deploying to deployment-integ-test October 8, 2025 14:24 — with GitHub Actions Error
@kg-aws kg-aws had a problem deploying to deployment-integ-test October 8, 2025 16:57 — with GitHub Actions Error
@aemada-aws
Copy link
Contributor

aemada-aws commented Oct 10, 2025

PR title start with feat(ecs) since you are adding a new feature. it will also require an integ test

@kg-aws kg-aws changed the title chore(ecs): add support for ecs service hook details field feat(ecs): add support for ecs service hook details field Oct 10, 2025
*
* @default - No custom parameters will be passed
*/
readonly hookDetails?: any;
Copy link
Contributor

@aemada-aws aemada-aws Oct 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
readonly hookDetails?: any;
readonly hookDetails?: { [key: string]: any };

then you don't need the validate function, just Fn.toJsonString(hookDetails)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that challenge is CFN only accepts JSON object as string for this field while Fn.toJsonString can convert any primitive datatype or JSON array to string which we need to guard against in CFN.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you type it as an object, which is the suggested code change, then you won’t need to validate if it is an object.

Copy link
Contributor Author

@kg-aws kg-aws Oct 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we limit it to just an object, can we edit to type any in the future in CDK in case CFN implementation supports primitive types as JSON string?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@aemada-aws aemada-aws self-assigned this Oct 10, 2025
@mergify mergify bot dismissed aemada-aws’s stale review October 10, 2025 16:43

Pull request has been modified.

@kg-aws
Copy link
Contributor Author

kg-aws commented Oct 10, 2025

PR title start with feat(ecs) since you are adding a new feature. it will also require an integ test

Fixed the title and I have updated an existing ecs B/G integ-test with HookDetails field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants