Skip to content

default_capacity_provider_strategy can NOT be null (which is the default value) #324

@rocco-muscaritolo

Description

@rocco-muscaritolo

Description

The cluster submodule's variable default_capacity_provider_strategy is producing an error with the default value of Null.

No capacity_provider_strategy is a valid configuration. So the module should support it. By the looks of modules/ecs_cluster/modules/cluster/main.tf line: 106, it looks like that is the intention.

If your request is for a new feature, please use the Feature request template.

  • ✋ I have searched the open/closed issues and my issue is not listed.

⚠️ 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

  • Module version [Required]: 6.1.0

  • Terraform version: v1.12.2

Terraform v1.12.2
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v6.4.0
  • Provider version(s): 6.4.0
Terraform v1.12.2
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v6.4.0

Reproduction Code [Required]

terraform {
  required_version = "~> 1.12.2"

  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = ">= 6.4"
    }
  }
}

provider "aws" {
  region = "us-east-1"
}

module "ecs_cluster" {
  source                      = "terraform-aws-modules/ecs/aws//modules/cluster"
  version                     = "6.1.0"
  name                        = "testing"
  create_cloudwatch_log_group = false

  configuration = {
    execute_command_configuration = {
      logging = "DEFAULT"
    }
  }
}

Steps to reproduce the behavior:

Simply use the sample code, init, and plan\apply and you will see the error.

Expected behavior

The plan should succeed without errors, having no default_capacity_providers.

Actual behavior

Got a Terraform error:
Error: Iteration over null value

Terminal Output Screenshot(s)

Image

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions