Skip to content

Conversation

GavinZZ
Copy link
Contributor

@GavinZZ GavinZZ commented Apr 15, 2025

Reverts #33608
Closes #34157

This is a breaking change because cpu property allows input like 1vcpu although it's not documented in the public CFN documentation.

This would mean that the reverted PR will cause regression on CDK app that looks like below

const taskDefinition = new TaskDefinition(this, 'MyFargateTaskDef', {
      compatibility: Compatibility.FARGATE,
      family: "update-service-test-fargate-taskdef-small-cpu",
      memoryMiB: "2gb",
      cpu: "1 vcpu",
      networkMode: NetworkMode.AWS_VPC
    });

@aws-cdk-automation aws-cdk-automation requested a review from a team April 15, 2025 19:13
@github-actions github-actions bot added the p2 label Apr 15, 2025
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Apr 15, 2025
Copy link

codecov bot commented Apr 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.00%. Comparing base (54e8222) to head (558f89f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #34155   +/-   ##
=======================================
  Coverage   84.00%   84.00%           
=======================================
  Files         121      121           
  Lines        6984     6984           
  Branches     1179     1179           
=======================================
  Hits         5867     5867           
  Misses       1005     1005           
  Partials      112      112           
Flag Coverage Δ
suite.unit 84.00% <ø> (ø)

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

Components Coverage Δ
packages/aws-cdk ∅ <ø> (∅)
packages/aws-cdk-lib/core 84.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

}
} else {
throw new Error(`If operatingSystemFamily is ${runtimePlatform.operatingSystemFamily!._operatingSystemFamily}, then cpu must be in 1024 (1 vCPU), 2048 (2 vCPU), or 4096 (4 vCPU). Provided value was: ${cpu}`);
if (Number(cpu) === 1024) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Going back to no token check is worrying me a bit. But given that this PR is a pure revert, I am biasing toward approving.

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 think this should be safe because Number(any non-number value) will be a NaN.

Copy link
Contributor

@samson-keung samson-keung left a comment

Choose a reason for hiding this comment

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

One comment but approving

@GavinZZ GavinZZ added the pr/do-not-merge This PR should not be merged at this time. label Apr 15, 2025
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@GavinZZ GavinZZ removed the pr/do-not-merge This PR should not be merged at this time. label Apr 15, 2025
Copy link
Contributor

mergify bot commented Apr 15, 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 c4fd9fd into main Apr 15, 2025
47 checks passed
@mergify mergify bot deleted the revert-33608-ecs-mem-validations branch April 15, 2025 20:12
Copy link
Contributor

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 Apr 15, 2025
@github-actions github-actions bot added bug This issue is a bug. p1 and removed p2 labels Apr 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug This issue is a bug. contribution/core This is a PR that came from AWS. p1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(ecs): cpu/memory validation for TaskDefinition failed with valid combinations

4 participants