How to run terraform plan in main directory against all modules created by terraformer?

23 Views Asked by At

I exported my existing AWS infra via Terraformer

Then I created modules in my main.tf file to reference the export

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.31.0"
    }
  }

  required_version = ">= 1.2.0"
}

provider "aws" {
  profile = "default"
}

module "ec2-instance" {
  source = "./generated/aws/ec2_instance"
}
module "vpc" {
  source = "./generated/aws/vpc"
}

But when I execute terraform plan it wants to create a new resource instead of acknowledging existing ones. enter image description here

0

There are 0 best solutions below