-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(events-targets): allow all ECS TaskOverrides #32344
Conversation
*/ | ||
export interface EphemeralStorageOverride { | ||
/** | ||
* The total amount, in GiB, of ephemeral storage to set for the task. |
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.
I copied these docstrings from the Task Override docs: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TaskOverride.html
@@ -50,6 +50,54 @@ export interface EcsTaskProps extends TargetBaseProps { | |||
*/ | |||
readonly containerOverrides?: ContainerOverride[]; | |||
|
|||
/** | |||
* The CPU override for the task. |
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.
Again, copied from the upstream docs: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TaskOverride.html
const taskCount = this.taskCount; | ||
const taskDefinitionArn = this.taskDefinition.taskDefinitionArn; | ||
const propagateTags = this.propagateTags; | ||
const tagList = this.tags; | ||
const enableExecuteCommand = this.enableExecuteCommand; | ||
const input = this.createInput(); |
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.
Since this logic is more complex now, I refactored it to a dedicated private method.
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.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #32344 +/- ##
=======================================
Coverage 80.90% 80.90%
=======================================
Files 236 236
Lines 14261 14261
Branches 2493 2493
=======================================
Hits 11538 11538
Misses 2438 2438
Partials 285 285
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Thanks for adding this! Looks good, just a few nits
packages/aws-cdk-lib/aws-events-targets/test/ecs/event-rule-target.test.ts
Outdated
Show resolved
Hide resolved
...aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-fargate-task.ts
Show resolved
Hide resolved
Thanks for the thorough and diligent review @aaythapa . From my perspective, this is good to go. Let me know if you need any more changes from my end. |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
LGTM, thanks as always for your contribution |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
This pull request has been removed from the queue for the following reason: The pull request can't be updated You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. If you want to requeue this pull request, you need to post a comment with the text: |
@Mergifyio requeue |
❌ Command disallowed due to command restrictions in the Mergify configuration.
|
Pull request has been modified.
@aaythapa I think you'll need to re-queue this. It looks like |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Comments on closed issues and PRs are hard for our team to see. |
Issue #32217
Closes #32217.
Reason for this change
ECS targets can override any item in the
TaskOverride
structure via theinput
parameter, according to the docs.However, today, only the
containerOverrides
option is exposed:aws-cdk/packages/aws-cdk-lib/aws-events-targets/lib/ecs-task.ts
Lines 225 to 227 in 1b7265b
Description of changes
This PR adds all
TaskOverride
properties to theinput
parameter.Description of how you validated changes
I add unit tests. I also updated the existing integration tests to include additional overrides. I validated them in my AWS account.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license