CloudFormation DependsOn and ECS minimumHealthyPercent
The goal is to have a chain of ECS services, ServiceA
and ServiceB
, where ServiceB
depends on ServiceA
.
I configure the dependency using CloudFormation's DependsOn
.
Assume that ServiceA
is configured to have desiredCount=1
and minimumHealthyPercent=0
.
When I deploy the stack, when does CloudFormation consider the dependency of ServiceA
to be fulfilled and starts deploying ServiceB
?
One reading is that since minimumHealthyPercent
is 0
, ServiceA
is finished as soon as it is created. Another possibility is that since desiredCount
is 1
the service is fully deployed only when one task has reached the RUNNING
state. Which reading is correct (if any)?
Hi AWS-User-5431698,
Based upon my experience working with AWS CloudFormation, I would expect AWS CloudFormation to follow the order specified by DependsOn
between the AWS CloudFormation resources defined in your template. Properties within a given resource type shouldn't have an impact on the creation order.
I hope this helps,
Chris
Hi Chris. Did you have a time to look at this? When does CloudFormation consider an ECS service to be completed, i.e. when will CloudFormation start creating an object which has a DependsOn attribute on the ECS service?
Relevant questions
ECS Blue-Green with CodePipeline
Accepted Answerasked 2 years agoShould ECS/EC2 ASGProvider Capacity Provider be able to scale-up from zero, 0->1
Accepted Answerasked 5 months agoManaging a stack with CloudFormation - how will new ECS ARN affect me?
asked 3 years agohow to automatically deploy a code to ecs in AWS pipeline
asked 5 months agoUpgrade ecs-agent on Windows 2016 ECS Optimized AM
asked 2 years agoCloudFormation DependsOn and ECS minimumHealthyPercent
asked 4 months agoAre there any best practices for sending logs from ECS on EC2, ECS on Fargate and other AWS services such as API GW, load balancers (and more AWS services) to Splunk?
asked 2 months agoEKS Fargate: restrict access to service to only certain pods
asked 2 months agoCodePipeline ECS Rolling Updates for multiple services
asked 3 months agoChef & Puppet vs. ECS / EKS
Accepted Answerasked 2 years ago
Hi Chris, thanks for your reply. However, I still don't understand when CloudFormation would consider the requirement of the
DependsOn
parameter to be fulfilled. For instance, there was a discussion in the AWS Developers Forum (https://forums.aws.amazon.com/thread.jspa?messageID=537003) where it was stated that an instance "should" be considered successfully created when it reached the running state. So even if CloudFormation ignores the specific parameters, it would still be interesting to know when the second service will be started.