Terraform not saving state of ECS Cluster containerInsights setting

Hoo*_*och 8 amazon-web-services terraform terraform-provider-aws

This is my template:

resource "aws_ecs_cluster" "doesntmatter" {
  name = var.doesntmatter_name

  capacity_providers = ["FARGATE", "FARGATE_SPOT"]
  setting {
    name  = "containerInsights"
    value = "enabled"
  }

  tags = var.tags
}
Run Code Online (Sandbox Code Playgroud)

When I run it. It properly creates cluster and sets containerInsights to enabled. 在此输入图像描述

But when I run terrafrom again. It wants to change this property as if it wasn't set before. It doesn't matter how many times I run it. It still thinks it needs to change it every deployment.

在此输入图像描述

Additionally, the terraform state show resName does show that this setting is saved in state file.

Top*_*her 15

这是一个错误,已在 Terraform AWS Provider(昨天发布)的 v3.57.0 中得到解决。

Amazon ECS 正在对 ECSDescribe-Clusters API 进行更改。以前,成功的 ECSDescribe-Clusters API 请求的响应默认包含集群设置。此行为是不正确的,因为如此处所述 ( https://docs.aws.amazon.com/cli/latest/reference/ecs/describe-clusters.html ),集群设置是一个可选字段,仅应在以下情况下包含该字段:客户明确要求。通过更改,ECS 默认情况下将不再显示集群设置字段以响应描述集群 API。客户可以继续将 --include SETTINGS 标志与Describe-Clusters API 一起使用来接收集群设置。

跟踪错误:https ://github.com/hashicorp/terraform-provider-aws/issues/20684