hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.

Home Page:https://www.terraform.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting invalid value for capacity_provider_strategy while trying to create an ECS

Prabhanjali opened this issue · comments

Terraform Version

Terraform Version: 0.15.4

AWS Provider version : 3.68.0

I've previously used provider version of 3.57.0. Recently I changed the version to 3.68.0, from then, I'm encountering this issue.

Terraform Configuration Files

resource "aws_autoscaling_group" "test" {
  # ... other configuration, including potentially other tags ...

  tag {
    key                 = "AmazonECSManaged"
    value               = true
    propagate_at_launch = true
  }
}

resource "aws_ecs_capacity_provider" "test" {
  name = "test"

  auto_scaling_group_provider {
    auto_scaling_group_arn         = aws_autoscaling_group.test.arn
    managed_termination_protection = "ENABLED"

    managed_scaling {
      maximum_scaling_step_size = 1000
      minimum_scaling_step_size = 1
      status                    = "ENABLED"
      target_capacity           = 10
    }
  }
}

Debug Output

Error:
'Error: Provider produced inconsistent final plan'
When expanding the plan for aws_ecs_service.task_service[0] to include new values learned so far during apply, provider '"registry.terraform.io/hashicorp/aws" produced an invalid new value for' '.capacity_provider_strategy: planned set element'
cty.ObjectVal(map[string]cty.Value{"base":cty.NullVal(cty.Number), '"capacity_provider":cty.StringVal(""), "weight":cty.NullVal(cty.Number)})' does not correlate with any element in actual.

This is a bug in the provider, which should be reported in the provider's own issue tracker.

Expected Behavior

ECS should work properly

Actual Behavior

Error:
'Error: Provider produced inconsistent final plan'
When expanding the plan for aws_ecs_service.task_service[0] to include new values learned so far during apply, provider '"registry.terraform.io/hashicorp/aws" produced an invalid new value for' '.capacity_provider_strategy: planned set element'
cty.ObjectVal(map[string]cty.Value{"base":cty.NullVal(cty.Number), '"capacity_provider":cty.StringVal(""), "weight":cty.NullVal(cty.Number)})' does not correlate with any element in actual.

This is a bug in the provider, which should be reported in the provider's own issue tracker.

Steps to Reproduce

  1. terraform init
  2. terraform plan
  3. terraform apply

Additional Context

No response

References

No response

Hello,

This appears to be an issue or question with the AWS provider, not with Terraform itself. You can see existing issues and file a new one in their repository here: https://github.com/hashicorp/terraform-provider-aws/issues. If you have questions about Terraform or the AWS provider, it's better to use the community forum where there are more people ready to help. The GitHub issues here are monitored only by a few core maintainers.

Thanks!

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.