Existing infra and ecs

Hi,
Currenlty we have infra in aws created manually from aws console.

But want to use terrafrom now to create new ec2 machines and manage those using terrafrom with new VPC and all . So can i do it in same account using terrafrom now. What will happen with existing ec2 and vpc it will not delete them right ?

HI @tejasbhosale009,

Terraform only manages resources that it knows about. It will not delete the existing EC2 instances or VPC since they are not managed by Terraform.

You can use the terraform import command to bring these resources under Terraform’s management. For example:

$ terraform import aws_vpc.test_vpc vpc-a01106c2
$ terraform import aws_instance.web i-12345678

Refer to the docs at https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc#import and https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance#import for more information.