Terraform入門

公式サイト

Terraform by HashiCorp

Terraform is an open-source infrastructure as code software tool that provides a consistent CLI workflow to manage hundreds of cloud services. Terraform codifies cloud APIs into declarative configuration files. Write infrastructure as code using declarative configuration files. HashiCorp Configuration Language (HCL) allows for concise descriptions of resources using blocks, arguments, and expressions.

Write, Plan, Apply

Terraform is an open-source infrastructure as code software tool that provides a consistent CLI workflow to manage hundreds of cloud services. Terraform codifies cloud APIs into declarative configuration files.

TerraformはオープンソースのInfrastracture as codeのソフトウェアツールで、一貫したCLIのワークフローを提供し、何百のクラウドサービスを管理できる。TerraformはクラウドAPIをコード化して、宣言的設定ファイルにすることができる。

要するに・・・

  • Infrastracture as codeツール
  • (宣言的)設定ファイル
  • CLIからクラウドAPIを呼び出す

Deliver Infrastructure as Code

Write

Write infrastructure as code using declarative configuration files. HashiCorp Configuration Language (HCL) allows for concise descriptions of resources using blocks, arguments, and expressions.

宣言的設定ファイルを使って、インフラをコードとして書きましょう。HCL(HashiCorp設定言語)は、ブロック、引数、式を利用して、リソースを簡単に記述することができるでしょう。

Plan

Run terraform plan to check whether the execution plan for a configuration matches your expectations before provisioning or changing infrastructure.

「terraform plan」を実行することで、インフラをプロビジョニングもしくは変更する前に、設定ファイルに記載した実行計画が期待通りかどうかを確認できるでしょう。

Apply

Apply changes to hundreds of cloud providers with terraform apply to reach the desired state of the configuration.

「terraform apply」を実行し、何百ものクラウドプロバイダーに変更を適用することで、設定ファイルに記載し望んでいた状態にすることができるでしょう。

Features

Write declarative config files

Define infrastructure as code to manage the full lifecycle — create new resources, manage existing ones, and destroy those no longer needed.

インフラをコードとして定義し、全てのライフサイクル(新規リソース作成、既存リソース管理、不要になったリソースの削除)を管理しましょう。

Installable modules

Automatically download and install community or partner modules from the registry with terraform init

「terraform init」を実行して、レジストリからコミュニティやパートナーモジュールを自動的にダウンロード、インストールをしましょう。

Plan and predict changes

Terraform allows operators to safely and predictably make changes to infrastructure, with clearly mapped resource dependencies and separation of plan and apply.

Terraformを使うことで、運用者が安全に、かつ予測しやすくインフラに変更を加えることができる。planとapplyを使って、明確にリソースの依存や分離をマッピングできる。

Dependency graphing

Easily generate terraform plan, refresh state, and more, with Terraform config dependency graphing.

Terraformの設定依存グラフによって、簡単に「terraform plan」を生成し、状態を更新し、さまざまなことができる。

State management

Map real world resources to your configuration, keep track of metadata, and improve performance for large infrastructures.

既存のリソースを設定ファイルとマッピングし、メタデータを追跡し、大規模なインフラのパフォーマンスも改善しましょう。

Terraform Registry with 500+ providers

Choose from an array of providers for your cloud platforms and services, add them to your configuration, then use their resources to provision infrastructure.

自分のクラウドプラットフォームに適したプロバイダーを選んで、設定ファイルに追加しましょう。記載されたリソースをインフラとしてプロビジョニングできるでしょう。

Why Terraform

Codify your application infrastructure

Reduce human error and increase automation by provisioning infrastructure as code.

コードとしてインフラをプロビジョニングすることでヒューマンエラーを減らし、自動化を増やしましょう。

Manage infrastructure across clouds

Provision infrastructure across 300+ public clouds and services using a single workflow.

単一のワークフローを使って、300以上パブリッククラウドとサービスに渡ってインフラをプロビジョニングしましょう。

Create reproducible infrastructure

Provision consistent testing, staging, and production environments with the same configuration.

一貫したテスト環境、ステージング環境、本番環境を、同じ設定ファイルでプロビジョニングしましょう。

How Terraform Works

Terraform allows infrastructure to be expressed as code in a simple, human readable language called HCL (HashiCorp Configuration Language). It reads configuration files and provides an execution plan of changes, which can be reviewed for safety and then applied and provisioned.

Extensible providers allow Terraform to manage a broad range of resources, including IaaS, PaaS, SaaS, and hardware services.

Terraformによって、インフラをコードでシンプルに人間が読める、HCL(HashiCorp設定言語)と呼ばれる言語で表現できる。設定ファイルを読んで、変更の実行プランを提供し、安全にレビューし、適用し、プロビジョニングできる。

拡張可能なプロバイダーによって、Terraformは幅広い範囲のリソース、IaaS、PaaS、SaaS、ハードウェアサービスなどを管理できる。