How to import existing AWS resources into Terraform? | Terraform Import existing AWS Resources

Опубликовано: 08 Июнь 2021
на канале: DevOps Coach
20,643
187

https://www.coachdevops.com/2021/06/h...
The terraform import command is used to import existing infrastructure. The command currently can only import one resource at a time. This means you can't yet point Terraform import to an entire collection of resources such as an AWS VPC and import all of it.

Let's say that you have created EC2 instances manually outside Terraform. If you like to import your EC2 instance to Terraform you can use import command and bring it under Terraform state file.

To import a resource, create a tf file first write a resource block for it in your configuration, establishing the name by which it will be known to Terraform:

sudo vi myec2.tf
resource "aws_instance" "myinstance" {
...instance configuration...leave this as it is
}


Смотрите видео How to import existing AWS resources into Terraform? | Terraform Import existing AWS Resources онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь DevOps Coach 08 Июнь 2021, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 20,643 раз и оно понравилось 187 людям.