Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECS module always trigger an in-place update for containerInsights #47

Closed
siutsin opened this issue Aug 29, 2021 · 2 comments
Closed

ECS module always trigger an in-place update for containerInsights #47

siutsin opened this issue Aug 29, 2021 · 2 comments

Comments

@siutsin
Copy link

siutsin commented Aug 29, 2021

Description

Please provide a clear and concise description of the issue you are encountering, your current setup, and what steps led up to the issue. If you can provide a reproduction, that will help tremendously.

⚠️ Note

Before you submit an issue, please perform the following first:

  1. Remove the local .terraform directory (! ONLY if state is stored remotely, which hopefully you are following that best practice!): rm -rf .terraform/
  2. Re-initialize the project root to pull down modules: terraform init
  3. Re-attempt your terraform plan or apply and check if the issue still persists

Versions

  • Terraform: 1.0.5
  • Provider(s): aws (3.56.0)
  • Module: ecs (3.3.0)

Reproduction

Steps to reproduce the behavior:

  1. terraform apply the snippet below.
  2. Set container_insights to true/false or not declared at all.
  3. Run terraform apply a few more times.
  # module.ecs.aws_ecs_cluster.this[0] will be updated in-place
  ~ resource "aws_ecs_cluster" "this" {
        id                 = "arn:aws:ecs:eu-west-1:1234567890:cluster/test-ecs"
        name               = "test-ecs"
        tags               = {}
        # (3 unchanged attributes hidden)


      + setting {
          + name  = "containerInsights"
          + value = "disabled"
        }
        # (1 unchanged block hidden)
    }

Code Snippet to Reproduce

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 3.0"
    }
  }
}

provider "aws" {
  region = "eu-west-1"
}

module "ecs" {
  source  = "terraform-aws-modules/ecs/aws"
  version = "~> 3.3"

  name               = "test-ecs"
  capacity_providers = ["FARGATE_SPOT"]

  default_capacity_provider_strategy = [
    {
      capacity_provider = "FARGATE_SPOT"
      weight            = "1"
    }
  ]
}

Expected behavior

No infra changes.

Actual behavior

The module will try to set the containerInsights setting every time.
If I set container_insights = true, it will become

      + setting {
          + name  = "containerInsights"
          + value = "enabled"
        }

and it will still try to apply the enable every time.

@bryantbiggs
Copy link
Member

thank you for the info, however this is related to the upstream AWS provider and should be fixed later this week with the latest release of the provider hashicorp/terraform-provider-aws#20720

@github-actions
Copy link

github-actions bot commented Nov 8, 2022

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants