Terraform主要特点有哪些

发布时间:2022-01-07 17:01:38 作者:iii
来源:亿速云 阅读:195

本文小编为大家详细介绍“Terraform主要特点有哪些”,内容详细,步骤清晰,细节处理妥当,希望这篇“Terraform主要特点有哪些”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。

Terraform 是什么

如果两年前问 Terraform 是什么,国内熟悉它的人可能并不是很多,毕竟它是2014年的新生儿,提到资源编排,大家能优先想到的也是 AWS 的 CloudFormation,Azure 的 ARM 以及阿里云的 ROS。但是如果今天再问“Terraform 是什么”,相信很大一部分人对它不再陌生,并且一些公司或者感兴趣的开发者已经开始使用 Terraform 来管理他们的基础设施。不论是 Hashicorp 的官方宣传,还是阿里云云栖社区的布道;不论是 Devops的持续发展,还是云原生的火热传播;不论是国内最初只有阿里云支持,还是后来国内其他云厂商的陆续支持,Terraform 近两年在国内被越来越多的提及。

在此之前,不止一篇云栖文章介绍过Terraform是什么,本文将结合Terraform的官方文档,对这些文章中的介绍做一个整理和总结。

2014年,Hashicorp 公司推出了一款产品 Terraform
Terraform主要特点有哪些

Terraform 官方的定义如下:

Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions.

Configuration files describe to Terraform the components needed to run a single application or your entire datacenter. Terraform generates an execution plan describing what it will do to reach the desired state, and then executes it to build the described infrastructure. As the configuration changes, Terraform is able to determine what changed and create incremental execution plans which can be applied.

The infrastructure Terraform can manage includes low-level components such as compute instances, storage, and networking, as well as high-level components such as DNS entries, SaaS features, etc.

总结起来,三句话:

更通俗的讲,Terraform 就是运行在客户端的一个开源的,用于资源编排的自动化运维工具。以代码的形式将所要管理的资源定义在模板中,通过解析并执行模板来自动化完成所定义资源的创建,变更和管理,进而达到自动化运维的目标。

Terraform 主要特点

Terraform 具备以下几个主要特点:

resource "alicloud_instance">
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # alicloud_instance.instance[0] will be created
  + resource "alicloud_instance" "instance" {
      + availability_zone          = (known after apply)
      + id                         = (known after apply)
      + image_id                   = "ubuntu_140405_64_40G_cloudinit_20161115.vhd"
      + instance_name              = "my-first-tf-vm"
      + instance_type              = "ecs.sn1ne.small"
      + security_groups            = [
          + "sg-abc12345",
        ]
      + tags                       = {
          + "from" = "terraform"
        }
      + vswitch_id                 = "vsw-abc12345"
            ...
    }

  # alicloud_instance.instance[1] will be created
  + resource "alicloud_instance" "instance" {
      ...
  }
  # alicloud_instance.instance[2] will be created
  + resource "alicloud_instance" "instance" {
      ...
  }
    ...

Plan: 5 to add, 0 to change, 0 to destroy.

读到这里,这篇“Terraform主要特点有哪些”文章已经介绍完毕,想要掌握这篇文章的知识点还需要大家自己动手实践使用过才能领会,如果想了解更多相关内容的文章,欢迎关注亿速云行业资讯频道。

推荐阅读:
  1. Kickstart Terraform on GCP with Google Cloud Shell
  2. Terraform Collaboration for Everyone

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

terraform

上一篇:Windows的美化技巧有哪些

下一篇:c++显式栈如何实现递归

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》