プロビジョニングされるリソースを確認する(1/2) Plan $ terraform plan var.compartment_ocid OCID of compartment. Enter a value: ocid1.compartment.oc1... var.objectstorage_bucket_name Name of Object Storage Bucket. Enter a value: example-bucket var.objectstorage_namespace Namespace of Object Storage. Enter a value: orasejapan var.region OCI Region Identifier. (e.g. ap-tokyo-1, ...) Enter a value: ap-tokyo-1 入力変数(以下、順に評価され後勝ち) • variables.tfのdefault属性にデフォルト値を記載する • 環境変数から渡す(TF_VAR_xxx) • terraform.tfvars(.json)ファイルから渡す • *.auto.tfvars(.json)ファイルから渡す • CLIから渡す • -var=“xxx=…” or -var-file=“xxx.tfvars” • (←参照)実行時に対話形式で指定する
used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: + create Terraform will perform the following actions: # oci_objectstorage_bucket.objectstorage_bucket will be created + resource "oci_objectstorage_bucket" "objectstorage_bucket" { + access_type = "NoPublicAccess" + approximate_count = (known after apply) + approximate_size = (known after apply) + auto_tiering = (known after apply) + bucket_id = (known after apply) + compartment_id = "ocid1.compartment.oc1..aaaaaaaanjtbllhqxcg67dq7em3vto2mvsbc6pbgk4pw6cx37afzk3tngmoa" + created_by = (known after apply) + defined_tags = (known after apply) + etag = (known after apply) + freeform_tags = (known after apply) + id = (known after apply) + is_read_only = (known after apply) + kms_key_id = (known after apply) + name = “example-bucket" + namespace = "orasejapan" + object_events_enabled = (known after apply) + object_lifecycle_policy_etag = (known after apply) + replication_enabled = (known after apply) + storage_tier = (known after apply) + time_created = (known after apply) + versioning = (known after apply) } Plan: 1 to add, 0 to change, 0 to destroy. Plan 出力 概要 + リソースが作成される - リソースが破棄される +/-, -/+ リソースが破棄および再作成される ~ リソースがインプレースで更新される
クラウドリソースをプロビジョニングする Apply $ terraform apply # ... 省略 ... Do you want to perform these actions? Terraform will perform the actions described above. Only 'yes' will be accepted to approve. Enter a value: yes oci_objectstorage_bucket.objectstorage_bucket: Creating... oci_objectstorage_bucket.objectstorage_bucket: Creation complete after 1s [id=n/orasejapan/b/example-bucket] Apply complete! Resources: 1 added, 0 changed, 0 destroyed. Outputs: # ... 省略 ...
参考: 冪等性の確認のために同一リソースの再作成を試みる Apply $ terraform apply -var-file variables.tfvars oci_objectstorage_bucket.objectstorage_bucket: Refreshing state... [id=n/orasejapan/b/example-bucket] No changes. Your infrastructure matches the configuration. Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed. Apply complete! Resources: 0 added, 0 changed, 0 destroyed. Outputs: objectstorage_bucket_name = "example-bucket"
-destroy) ※terraform destroyは、改善の計画があるため可能な限り、terraform apply -destroyを使う クラウドリソースを削除する $ terraform apply -destroy # ... 省略 ... Plan: 0 to add, 0 to change, 1 to destroy. Changes to Outputs: - objectstorage_bucket_name = "example-bucket" -> null Do you really want to destroy all resources? Terraform will destroy all your managed infrastructure, as shown above. There is no undo. Only 'yes' will be accepted to confirm. Enter a value: yes oci_objectstorage_bucket.objectstorage_bucket: Destroying... [id=n/orasejapan/b/example-bucket] oci_objectstorage_bucket.objectstorage_bucket: Destruction complete after 2s Apply complete! Resources: 0 added, 0 changed, 1 destroyed. # ... 省略 ... Apply
is an experimental feature that lets you use natural-language prompts to generate Pulumi infrastructure-as-code programs in any language. This page is a web-based version of the open-source Pulumi AI project. 引用)https://www.pulumi.com/ai/ 日本語訳: Pulumi AIは、自然言語のプロンプトを使って、任意の言語でPulumi infrastructure-as-codeプログラムを生成できる 実験的機能です。このページは、オープンソースのPulumi AIプロジェクトのウェブベース版です。 昨今、流行りのGPTモデルを搭載した自然言語 → インフラ構成コードを自動生成するヤツ Pulumi AI - IaCのコードを書く上での救世主になりえるか…?