Home > Software design >  Port error while executing update on cloudformation
Port error while executing update on cloudformation

Time:11-15

I changed some environment variables in the task definition part and executed the changeset. The task definition got updated successfully but the update of service got stuck.

enter image description here

On checking the events in the cluster I found the following:

enter image description here

It is adding new task but the old one is already running consuming port so it is stuck. what can be done to resolve this. I can always delete and run the CF script again but I need to create a pipeline so I want the update stack yo work.

CodePudding user response:

This UPDATE_IN_PROGRESS will take around 3 hours until DescribeService API timeout.

If you can wait then you need to manually force the state of the Amazon ECS service resource in AWS CloudFormation into a CREATE_COMPLETE state by setting the desired count of the service to zero in the Amazon ECS console to stop running tasks. AWS CloudFormation then considers the update as successful, because the number of tasks equals the desired count of zero.

This blog explains the cause of the message and its fix in detail. https://aws.amazon.com/premiumsupport/knowledge-center/cloudformation-ecs-service-stabilize/

https://aws.amazon.com/premiumsupport/knowledge-center/ecs-service-stuck-update-status/?nc1=h_ls

  • Related