terraform
文書の過去の版を表示しています。
terraform
import
手動で作ったリソースをterraform管理にする
例)既存のsnsトピック hoge を管理下に持ってくる
既存トピックに対する resource を作成
resource "aws_sns_topic" "hoge" { }
既存トピックの id(arn) をimport
$ terraform import aws_sns_topic.hoge arn:aws:sns:ap-northeast-1:000000000000:hoge
管理下に入ったことを確認
$ terraform state show aws_sns_topic.hoge
resourceを修正
resource "aws_sns_topic" "hoge" { name = "hoge" }
設定の確認、変更点がなければOK
terraform plan --target aws_sns_topic.hoge
terraform.1540876558.txt.gz · 最終更新: 2018/10/30 05:15 by nullpon