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

Validate Cpu/Memory combinations for Fargate AWS::ECS::TaskDefinition #3453

Closed
2 tasks
trav-c opened this issue Jul 1, 2024 · 1 comment
Closed
2 tasks
Labels
new rule New rule

Comments

@trav-c
Copy link
Contributor

trav-c commented Jul 1, 2024

Is this feature request related to a new rule or cfn-lint capabilities?

rules

Describe the feature you'd like to request

When creating an AWS::ECS::TaskDefinition with FARGATE in RequiresCompatibilities it would be helpful if cfn-lint could validate that the Cpu and Memory values are a combination that is compatible with Fargate.

Fargate ECS tasks impose restrictions on the specific values, and more to the point combinations of values that can be used for the Cpu and Memory as per https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-cpu-memory-error.html and the CloudFormation documentation for AWS::ECS::TaskDefinition.Memory

For example it is not possible to create a task with 1 vCPU (1024 CPU Shares) and 1GB (1024 MB) of Memory, the closest supported options are either

  • 0.5 vCPU with 1GB of Memory
  • OR 1 vCPU with 2GB of Memory

Describe the solution you'd like

Conditionally validate that the CPU and Memory properties are a supported combination when FARGATE is present in AWS::ECS::TaskDefinition.RequiresCompatibilities

Additional context

No response

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request

Would this feature include a breaking change?

  • ⚠️ This feature might incur a breaking change
@kddejong
Copy link
Contributor

kddejong commented Jul 4, 2024

@trav-c if you get a chance please look at the PR. I've included two new rules. 1/ that will validate the CPU/Memory values for Fargate tasks 2/ that will validate that CPU/Memory are required properties when using Fargate and additionally that CPU will have a valid value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new rule New rule
Projects
None yet
Development

No branches or pull requests

2 participants