AWS: How does CloudFormation know a template has been deployed?

偶尔善良 提交于 2020-01-14 05:40:14

问题


In this article, there is a nice explanation about CloudFormation.

If you don’t know CloudFormation, then it’s important to know that CloudFormation is the Infrastructure as Code (IaC) solution of AWS. It is in the same category of tools as Terraform (a very good comparison between CloudFormation and Terraform can be found here).

With CloudFormation you can declaratively specify the AWS infrastructure that you need for your cloud application in a YAML or JSON file, called a template, and then deploy this template. During the deployment, AWS automatically provisions all the resources that you specified in your template.

If you already deployed before and just made changes to your template, then AWS calculates a changeset and applies it, so that the state of your infrastructure matches your the specification (just like Kubernetes).

Imagine the following scenario:

  1. Create a new project and set up a CloudFormation template for this project.
  2. Successfully deployed this template.
  3. Then, change the code.
  4. Deploy it again.

In term of step4, how does CloudFormation know this stack has been created before, and just update it?

Is there a unique UUID in the template to identify all the resources relating to this template?


回答1:


The identifier is the stack name that you specify when you deploy your template with the create-stack command, as it should be unique in the region in which you are creating the stack.




回答2:


Well, you actually go and actively update a certain stack using new template/new parameter values.



来源:https://stackoverflow.com/questions/59645741/aws-how-does-cloudformation-know-a-template-has-been-deployed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!