このページでは、Cloud Shell とローカルシェルにTrusted Cloud 用の Terraform をインストールする手順について説明します。Cloud Shell は、 Trusted Cloud用のインタラクティブなシェル環境です。 Trusted Cloud を使用して学習とテストを行い、ウェブブラウザでプロジェクトやリソースを管理できます。
Trusted Cloudで Terraform を使用する方法の入門ガイドについては、 Trusted Cloud 用 Terraform のクイックスタートをご覧ください。
Cloud Shell
gcloud CLI と Terraform で設定済みのオンライン ターミナルを使用するには、Cloud Shell を有効にします。
このページの下部で Cloud Shell セッションが開始され、コマンドライン プロンプトが表示されます。セッションが初期化されるまで数秒かかることがあります。
次のコマンドを実行して、Terraform が使用可能であることを確認します。
terraform
出力例を以下に示します。
Usage: terraform [global options] <subcommand> [args] The available commands for execution are listed below. The primary workflow commands are given first, followed by less common or more advanced commands. Main commands: init Prepare your working directory for other commands validate Check whether the configuration is valid plan Show changes required by the current configuration apply Create or update infrastructure destroy Destroy previously-created infrastructure
Trusted Cloudで Terraform を使用するには、 Trusted Cloud内で次のタスクが完了している必要があります。
- Trusted Cloud プロジェクトを作成する、あるいはすでにプロジェクトがある。
- Trusted Cloud プロジェクトの課金が有効にする。
- 使用するTrusted Cloud サービスの API を有効にする。
- Terraform の認証を設定する。
ローカルシェル
Terraform により提供されているインストール手順を参照します。
次のコマンドを実行して、Terraform が使用可能であることを確認します。
terraform
出力例を以下に示します。
Usage: terraform [global options] <subcommand> [args] The available commands for execution are listed below. The primary workflow commands are given first, followed by less common or more advanced commands. Main commands: init Prepare your working directory for other commands validate Check whether the configuration is valid plan Show changes required by the current configuration apply Create or update infrastructure destroy Destroy previously-created infrastructure
Trusted Cloudで Terraform を使用するには、 Trusted Cloud内で次のタスクが完了している必要があります。
- Trusted Cloud プロジェクトを作成する、あるいはすでにプロジェクトがある。
- Trusted Cloud プロジェクトの課金が有効にする。
- 使用するTrusted Cloud サービスの API を有効にする。
- Terraform の認証を設定する。
次のステップ
- Terraform for Trusted Cloud のクイックスタートを確認する。
- 基本的な Terraform コマンドについて学習する。