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

Rule E3042 - Check at least one essential container is specified #1548

Merged
merged 4 commits into from
May 24, 2020

Conversation

Tro95
Copy link
Contributor

@Tro95 Tro95 commented May 24, 2020

Issue #, if available: #1547

Description of changes: Adds a new rule, E3042, that checks AWS::ECS::TaskDefinition.ContainerDefinition specifies at least one essential container. Not specifying an essential container (or having a container defaulting to essential) will cause a deployment failure. Reference: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-essential.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov
Copy link

codecov bot commented May 24, 2020

Codecov Report

Merging #1548 into master will increase coverage by 0.01%.
The diff coverage is 92.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1548      +/-   ##
==========================================
+ Coverage   87.60%   87.61%   +0.01%     
==========================================
  Files         160      161       +1     
  Lines        8873     8898      +25     
  Branches     2124     2129       +5     
==========================================
+ Hits         7773     7796      +23     
- Misses        660      661       +1     
- Partials      440      441       +1     
Impacted Files Coverage Δ
.../resources/ecs/TaskDefinitionEssentialContainer.py 92.00% <92.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 661bd87...14e9f21. Read the comment docs.

@Tro95
Copy link
Contributor Author

Tro95 commented May 24, 2020

@kddejong is there a better way to test rules that won't run afoul of Codecov? It seems the majority of rules employ the same method for testing, but it doesn't give good coverage.

@PatMyron
Copy link
Contributor

PatMyron commented May 24, 2020

template syntax edge cases are handled well because they evaluate to true 👍

Parameters:
  Parameter:
    Type: String
Resources:
  TaskDefinition:
    Type: AWS::ECS::TaskDefinition
    Properties:
      ContainerDefinitions:
        - Image: Image
          Name: Name
          Memory: 100
          Essential: !Ref Parameter

@PatMyron PatMyron merged commit 6cc0b43 into aws-cloudformation:master May 24, 2020
@Tro95 Tro95 deleted the ecs-essential-container branch May 24, 2020 18:05
@Tro95 Tro95 mentioned this pull request May 24, 2020
4 tasks
@PatMyron
Copy link
Contributor

@Tro95 thanks for the new rule, documentation will be automatically generated right before the next release!

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

Successfully merging this pull request may close these issues.

2 participants