terraform import fargate cluster
Mia Lopez
I have an existing manually created fargate cluster named "test-cluster" in us-west-1
In terraform configuration file i created
resource "aws_ecs_cluster" "mycluster" {
}I run terraform command to import the files
terraform import aws_ecs_cluster.mycluster test-clusterI receive this error message
Error: Cannot import non-existent remote object
While attempting to import an existing object to aws_ecs_cluster.cluster, the provider detected that no object exists with the given id. Only pre-existing objects can be imported; check that the id is correct and that it is associated with the provider's configured region or endpoint, or use "terraform apply" to create a new remote object for this resource.
I've also ran aws configure adding the correct region.
41 Answer
Based on the comments.
The issue was caused by using wrong account in terraform and/or AWS console.
The solution was to use correct account.