Skip to content
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

Merged
merged 13 commits into from
Feb 12, 2025

Conversation

blimmer
Copy link
Contributor

@blimmer blimmer commented Dec 1, 2024

Issue #32217

Closes #32217.

Reason for this change

ECS targets can override any item in the TaskOverride structure via the input parameter, according to the docs.

However, today, only the containerOverrides option is exposed:

const containerOverrides = this.props.containerOverrides && this.props.containerOverrides
.map(({ containerName, ...overrides }) => ({ name: containerName, ...overrides }));
const input = { containerOverrides };

Description of changes

This PR adds all TaskOverride properties to the input 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

@github-actions github-actions bot added effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 labels Dec 1, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team December 1, 2024 17:34
@github-actions github-actions bot added the admired-contributor [Pilot] contributed between 13-24 PRs to the CDK label Dec 1, 2024
*/
export interface EphemeralStorageOverride {
/**
* The total amount, in GiB, of ephemeral storage to set for the task.
Copy link
Contributor Author

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.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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();
Copy link
Contributor Author

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.

Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a 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.

@blimmer blimmer changed the title feat(events-targets): add all ECS task properties for overrides feat(events-targets): allow all ECS TaskOverrides Dec 1, 2024
@aws-cdk-automation aws-cdk-automation dismissed their stale review December 1, 2024 17:44

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

Copy link

codecov bot commented Dec 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.90%. Comparing base (a0fa042) to head (fccb178).

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           
Flag Coverage Δ
suite.unit 80.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
packages/aws-cdk 79.74% <ø> (ø)
packages/aws-cdk-lib/core 82.16% <ø> (ø)

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Dec 1, 2024
Copy link
Contributor

@aaythapa aaythapa left a 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

@aaythapa aaythapa self-assigned this Feb 10, 2025
@blimmer
Copy link
Contributor Author

blimmer commented Feb 12, 2025

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.

aaythapa
aaythapa previously approved these changes Feb 12, 2025
Copy link
Contributor

mergify bot commented Feb 12, 2025

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).

@aaythapa
Copy link
Contributor

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.

LGTM, thanks as always for your contribution

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Feb 12, 2025
Copy link
Contributor

mergify bot commented Feb 12, 2025

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).

Copy link
Contributor

mergify bot commented Feb 12, 2025

This pull request has been removed from the queue for the following reason: pull request branch update failed.

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

@blimmer
Copy link
Contributor Author

blimmer commented Feb 12, 2025

@Mergifyio requeue

Copy link
Contributor

mergify bot commented Feb 12, 2025

requeue

❌ Command disallowed due to command restrictions in the Mergify configuration.

  • sender-permission >= write

@mergify mergify bot dismissed aaythapa’s stale review February 12, 2025 22:38

Pull request has been modified.

@blimmer
Copy link
Contributor Author

blimmer commented Feb 12, 2025

@aaythapa I think you'll need to re-queue this. It looks like main updated a workflow, so mergify rejected it.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: fccb178
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Feb 12, 2025
Copy link
Contributor

mergify bot commented Feb 12, 2025

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).

@mergify mergify bot merged commit aebb331 into aws:main Feb 12, 2025
26 checks passed
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2025
@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Feb 12, 2025
@blimmer blimmer deleted the add-all-ecs-task-overrides branch February 13, 2025 01:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
admired-contributor [Pilot] contributed between 13-24 PRs to the CDK effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(events-targets): Support all input overrides for EcsTask target
3 participants