-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat(ecs): add support for ecs service hook details field #35691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
1c8cbfe
to
f78320c
Compare
f78320c
to
1d2eda2
Compare
PR title start with feat(ecs) since you are adding a new feature. it will also require an integ test |
packages/aws-cdk-lib/aws-ecs/lib/deployment-lifecycle-hook-target.ts
Outdated
Show resolved
Hide resolved
* | ||
* @default - No custom parameters will be passed | ||
*/ | ||
readonly hookDetails?: any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
readonly hookDetails?: any; | |
readonly hookDetails?: { [key: string]: any }; |
then you don't need the validate function, just Fn.toJsonString(hookDetails)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
Pull request has been modified.
Fixed the title and I have updated an existing ecs B/G integ-test with HookDetails field. |
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
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license