2023.01.25  

【Terraform-CodeDeploy】 Error creating CodeDeploy deployment group: InvalidTagsToAddException:

AWS,  Terraform    

terraformでCodeDeployのdeployment groupをterraform applyで作成しようとしたところ次のエラーが発生しました。

Error creating CodeDeploy deployment group: 
InvalidTagsToAddException: Resource creation is already in progress, 
please wait a second
CodeDeploy デプロイ グループの作成中にエラーが発生しました: 
InvalidTagsToAddException: リソースの作成が既に進行中です。
しばらくお待ちください

原因

下記test_traffic_routelistener_arnsはterraformではリスト形式でarnを渡せるような記載がされていたので、複数のarnを渡してapplyを実行していたのが原因のようです。

resource "aws_codedeploy_deployment_group" "this" {
  # -- 中略 --

  load_balancer_info {
    target_group_pair_info {
      prod_traffic_route {
        listener_arns = var.first_listener_arns
      }

      test_traffic_route {
        listener_arns = var.second_listener_arns   # ここにリスト型でarnを複数渡していた
      }
  }
}

マネージメントコンソールで直接設定を行うとtest_traffic_routeはひとつしかarnが設定できなかったため、terraform側もarnをひとつ渡すように設定し直したところ、apllyが通るようになりました。

コメント
@Aaron
2023年3月12日3:20
Hello! If you're in need of data scraping services, I'd be happy to assist you.
As an expert in this field, I have the experience and tools necessary to
provide fast and accurate data scraping that can help you make
informed decisions and grow your business. Don't hesitate to reach out to me for any of your
data scraping needs. Alma
@Rachele
2023年3月21日9:20
Hello! If you're in need of data scraping services,
I'd be happy to assist you. As an expert in this field, I have the
experience and tools necessary to provide fast and accurate data scraping that can help you make informed decisions and
grow your business. Don't hesitate to reach out to me for any
of your data scraping needs. Felipe
コメントする
コメント入力

名前 (※ 必須)

メールアドレス (※ 必須 画面には表示されません)

送信