Open Tro95 opened 4 years ago
Adding another suggestion to fargate rules:
AWS::ECS::Service
has LauchType
set to FARGATE
, but the TaskDefinition
it references does not specify "RequiresCapabilities": ["FARGATE"]
(causes "Task definition does not support launch_type FARGATE.")
cfn-lint version: (
cfn-lint --version
): 0.32.1Description of issue. New Rule Suggestions for ECS Fargate
Having just tried to deploy a new task alongside some existing tasks in Fargate, I ran across quite a few deployment failures that cfn-lint didn't warn me against, so this issue is simply a proposal for new rules to cover these cases.
[Error] When anhttps://github.com/aws-cloudformation/cfn-lint/pull/2559AWS::ECS::Service
has itsLaunchType
set toFARGATE
, it cannot haveSchedulingStrategy
set toDAEMON
. Currently the only supportedSchedulingStrategy
isREPLICA
. Reference: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html#service_scheduler.AWS::ECS::TaskDefinition
has itsNetworkMode
set toawsvpc
, then anyAWS::ECS::TaskDefinition ContainerDefinition
subresources should either not specify anyHostPort
within eachPortMappings
entry, or should set it to equal the correspondingContainerPort
. Reference: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-portmappings.AWS::ECS::TaskDefinition
has itsNetworkMode
set toawsvpc
, its parentAWS::ECS::Service
resource must specify aNetworkConfiguration
(which should be of typeAWS::ECS::Service AwsVpcConfiguration
. Reference: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-networkconfiguration.[Error] Everyhttps://github.com/aws-cloudformation/cfn-python-lint/pull/1548AWS::ECS::TaskDefinition
must contain at least oneAWS::ECS::TaskDefinition ContainerDefinition
that hasEssential
set totrue
. Reference: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-essential.