卓:的CloudFormation如何知道已部署模板? [英] AWS: How does CloudFormation know a template has been deployed?

查看:47
本文介绍了卓:的CloudFormation如何知道已部署模板?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在此文章中,有一个很好的解释有关CloudFormation的信息。

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


如果您不了解CloudFormation,那么了解CloudFormation是以下基础架构即代码(IaC)解决方案非常重要AWS。它与Terraform属于同一类工具(可以在此处找到CloudFormation和Terraform的很好比较)。

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

借助CloudFormation,您可以声明性地指定用于您需要在YAML或JSON文件(称为模板)中使用云应用程序,然后部署此模板。在部署过程中,AWS会自动配置您在模板中指定的所有资源。

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.

如果您之前已经部署过并且刚刚对模板进行了更改,则AWS将计算一个变更集并应用它,以便您的基础结构状态与您的规范相匹配(就像Kubernetes一样。)

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

想象一下以下情况:


  1. 创建一个新项目并为此项目设置一个CloudFormation模板。

  2. 成功部署了该模板。

  3. 然后,更改代码。

  4. 再次部署它。

  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.

在第4步中,CloudFormation如何知道该堆栈已被创建,并且只是对其进行更新?

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

模板中是否有唯一的UUID标识与该模板相关的所有资源?

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

推荐答案

标识符是您在部署t时指定的堆栈名称使用 create-stack 命令进行拼版,因为它在创建堆栈的区域中应该是唯一的。

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.

这篇关于卓:的CloudFormation如何知道已部署模板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆