株式会社ヴァンデミックシステム

Blog

<スポンサーリンク>

ステートを消す

terraform state rm aws_vpc_peering_connection.connection-a

grepしてリソースが管理されているかまずチェック

terraform state list | grep xxx

ステートをインポート

terraform import aws_vpc_peering_connection.connection-a 
pcx-xxxxxxxxxxxxx

インポートする際には、リソースを定義しておく

resource "aws_vpc_peering_connection" "connection-a" {
  peer_vpc_id = data.aws_vpc.vpc.*.id[0]
  vpc_id      = aws_vpc.vamdemic-vpc.id

  tags = {
    Name = "vamdemic-and-xxx"
  }
}

インポートするだけなら、リソースの中身はいらない

resource "aws_vpc_peering_connection" "connection-a" {
}

<スポンサーリンク>

コメントを残す

Allowed tags:  you may use these HTML tags and attributes: <a href="">, <strong>, <em>, <h1>, <h2>, <h3>
Please note:  all comments go through moderation.

*

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)