Search code examples
amazon-web-servicestimeoutcommand-line-interfaceaws-cloudformationsam

aws cloudformation deploy - how to increase wait time


I am having issue with one of my cloudformation sam template. In that template, i have a AWS::CloudFront::Distribution block, that takes more than 10 mins to complete.

It seems that the aws cloudformation deploy command just times out everytime its being run, it could be its default timeout. But how do i increase the timeout or somehow wait for the stack to be completed without exiting the cli command.

On the cloudformation web console, the stack gets completed though, its just that the cli exits before it actually gets completed.


Solution

  • This is a known issue with AWS CLI. stack-create-complete waits until stack status is CREATE_COMPLETE. It will poll every 5 seconds (Not 30!) until a successful state has been reached. This will exit with a return code of 255 after 120 failed checks.

    It was fixed in here. https://github.com/aws/aws-cli/pull/2816