[英]Cloudformation/Serverless vs Terraform in AWS
I would like to understand the need of tools like Terraform.我想了解 Terraform 等工具的需求。 When we do have Cloudformation template available and one can create/update all AWS services with that , What is the point in using a service like Terraform.
当我们有可用的 Cloudformation 模板并且可以使用它创建/更新所有 AWS 服务时,使用像 Terraform 这样的服务有什么意义。 Please Suggest.
请建议。
There are a couple of reasons why you might choose Terraform over CloudFormation:您可能会选择 Terraform 而不是 CloudFormation 的原因有两个:
CloudFormation (CFN) and Terraform (CF) are both Infrastructure as Code (IaC) development tools. CloudFormation (CFN) 和 Terraform (CF) 都是基础设施即代码 (IaC) 开发工具。
However, CFN is only for AWS .但是, CFN 仅适用于 AWS 。 You can't use it with Azure, GCP or anything else outside of AWS ecosystem.
您不能将它与 Azure、GCP 或 AWS 生态系统之外的任何其他东西一起使用。 In contrast, TF is cloud agnostic .
相比之下, TF 与云无关。 You can use it across not only multiple cloud providers, but also to work with non-cloud products, such as docker, various databases and even domino pizza if you want.
您不仅可以跨多个云提供商使用它,还可以使用非云产品,例如 docker、各种数据库,如果需要,甚至可以使用多米诺比萨。
So the main advantage of TF is that once you learn it only once , you can apply it to a number of cloud providers.所以 TF 的主要优点是,一旦你只学习一次,你就可以将其应用到多个云提供商。 CFN is only useful in AWS, and once you stop using CFN, you have to learn something new to work with other cloud.
CFN 只在 AWS 中有用,一旦你停止使用 CFN,你必须学习一些新的东西才能与其他云一起工作。
There are also difference in how TF and CFN work. TF 和 CFN 的工作方式也有所不同。 Both have their strengths and weekends .
两者各有长处和周末。 For example:
例如:
when you deploy using CFN all resources are available to view in one central location in AWS along with template's source code.当您使用 CFN 进行部署时,所有资源都可以在 AWS 的一个中心位置与模板的源代码一起查看。 Whereas with TF there is no such place.
而TF则没有这样的地方。 If you login to the AWS console, you have no idea what was created by TF, what was the source code used, etc.
如果您登录 AWS 控制台,您不知道 TF 创建了什么,使用的源代码是什么等等。
TF has loops and complex data structures and condtions, while CFN does not. TF 有循环和复杂的数据结构和条件,而 CFN 没有。
CFN has creation policies and update policies, TF has not. CFN 有创建策略和更新策略,TF 没有。
You can control access to CFN using CFN policies and IAM policies.您可以使用 CFN 策略和 IAM 策略控制对 CFN 的访问。 You can't do same with TF as it "lives" outside of AWS.
您不能对 TF 做同样的事情,因为它“存在”于 AWS 之外。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.