简体   繁体   中英

terraform import fargate cluster

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM