-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Cannot associate the Capacity Provider with ECS cluster which created by aws_batch_compute_environment #12749
Comments
This issue happens on:
|
This happens on v2.70.0 too . can someone help ..? |
Did you try to use this API? https://docs.aws.amazon.com/cli/latest/reference/ecs/put-cluster-capacity-providers.html |
Closed via #22672 |
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. |
This issue was originally opened by @ctrongminh as hashicorp/terraform#24615. It was migrated here as a result of the provider split. The original body of the issue is below.
Current Terraform Version
Use-cases
Our use case is first create AWS batch compute environment with UNMANAGED type, which will automatically create the ECS cluster. Then, we will create the Launch Template, AutoScaling Group. After that, go to the ECS Cluster, and create the Capacity Provider.
However, I cannot find a way to associate the ECS Cluster created by aws_batch_compute_environment with the resource aws_ecs_capacity_provider.
Attempted Solutions
I try to use the resource aws_ecs_cluster with the ECS cluster name created by aws_batch_compute_environment, and aws_ecs_capacity_provider.resource.name but got error.
There are three cases
resource "aws_ecs_cluster" "resource" {
name = "${trimprefix(data.aws_arn.ecs-cluster-resource.resource, "cluster/")}"
capacity_providers = ["${aws_ecs_capacity_provider.resource.name}"]
default_capacity_provider_strategy {
capacity_provider = "${aws_ecs_capacity_provider.resource.name}"
}
}
Got error
resource "aws_ecs_cluster" "resource" {
name = "${trimprefix(data.aws_arn.ecs-cluster-resource.resource, "cluster/")}"
capacity_providers = ["${aws_ecs_capacity_provider.resource.name}"]
}
Got the same error
resource "aws_ecs_cluster" "resource" {
name = "${trimprefix(data.aws_arn.ecs-cluster-resource.resource, "cluster/")}"
default_capacity_provider_strategy {
capacity_provider = "${aws_ecs_capacity_provider.resource.name}"
}
}
Got different error
Proposal
References
#11531
The text was updated successfully, but these errors were encountered: