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

已提問 2 年前檢視次數 409 次
1 個回答
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
已回答 2 年前
  • 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?

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南