CloudFormation DependsOn and ECS minimumHealthyPercent

0

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)?

1 Answer
0

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

profile pictureAWS
Chris_S
answered 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&#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.

  • 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?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions