Open christyWtt opened 2 years ago
This issue occurs after I upgraded terraform from 0.14.11 to 1.0.11. I tried all versions between 4.10.0 to 4.17.1. All of them are not working.
I am facing the same issue. Was this resolved? Where can I find the resolution? Can someone help me with this?
I thought the problem was that the variable was passed as null to the resource, so I tried passing it hard and it seems that aws still doesn't have the resource available to be referenced.
Error message:
Error: creating ECS Service (web): InvalidParameterException: The specified capacity provider my-ec2-capacity-provider was not found. Specify a valid capacity provider and try again.
So I tried adding a delay and it worked fine (for now):
resource "aws_ecs_capacity_provider" "ec2" {
name = "${var.name}-ec2-capacity-provider"
}
resource "null_resource" "ecs_capacity_provider_ec2_delay" {
depends_on = [aws_ecs_capacity_provider.ec2]
provisioner "local-exec" {
command = "sleep 3"
}
}
output "ecs_capacity_provider_ec2_name" {
value = aws_ecs_capacity_provider.ec2.name
depends_on = [
aws_ecs_capacity_provider.ec2,
null_resource.ecs_capacity_provider_ec2_delay
]
}
Hey! Is this issue resolved in any other later versions of terraform??
Community Note
Terraform CLI and Terraform AWS Provider Version
Terraform v1.0.11 aws-provider hashicorp/aws v4.10.0
Affected Resource(s)
aws_ecs_service
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Debug Output
Panic Output
ā Error: Provider produced inconsistent final plan ā ā When expanding the plan for ā module.ecs.module.ecs_service.aws_ecs_service.service 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 service should be created.
Actual Behavior
I receive the above error.
Steps to Reproduce
terraform apply
Important Factoids
References
0000