Can someone clearly explain to me difference and precedence between AWS CLI Cloudformation create-stack
and deploy
commands? For me it seems like they do same thing and deploy resources.
Why when you run the deploy command from the cli, the create stack has no executable change set, while the documenation says :
Deploys the specified AWS CloudFormation template by creating and then executing a change set. The command terminates after AWS CloudFormation executes the change set. If you want to view the change set before AWS CloudFormation executes it, use the --no-execute-changeset flag.
create-stack
can only be used when you know you want to create a new stack. If you want to update a stack, you have to use a different command, etc. If you're writing (ug) batch files to help run your cloudformation, this can be a real pain.
The deploy
is functionality to better take advantage of change sets - rather than having to know if a stack exists, you can simply run deploy and the tool will figure out what it needs to do. With the --no-execute-changeset
, it will actually provide you the command needed if you decide you want to review the changes before applying them.
It looks like this was introduced in Nov. 2016, probably around the time change sets were released.