Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

terraform import fargate cluster

Writer 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-cluster

I 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.

4

1 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.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.