首页 > 解决方案 > Terraform quickest way to import multiple resources

问题描述

My Terraform state file is messedup. Resources are already available on AWS. When I run terraform apply command I am getting multiple "Already Exists" error same as below.

aws_autoscaling_group.mysql-asg: Error creating AutoScaling Group: AlreadyExists: AutoScalingGroup by this name already exists - A group with the name int-mysql-asg already exists

When I do terraform import then it goes away. but I have hundreds of resources which is giving error. What is the best way to sync terraform state and make terraform apply successful?

标签: amazon-web-servicesterraform

解决方案


你可能想看看Terraforming

这是一个 Ruby 项目,声明“将现有 AWS 资源导出为 Terraform 样式 (tf, tfstate)”


推荐阅读