GoogleCloudPlatform / terraformer

CLI tool to generate terraform files from existing infrastructure (reverse Terraform). Infrastructure to Code
Apache License 2.0
12.67k stars 1.65k forks source link

Import resource only if they exist #1919

Open arushdesp opened 2 months ago

arushdesp commented 2 months ago

Hi, Feature to add if possible. When I do

 terraformer import google --resources=* --project=**** --regions=******

A generated file is created checking all the services/resources one by one and then create the folder for every resource eventhough they aren't used. Would it be possible to only have the created folder only for the resources that are currently being used? e.g. I didnt use the service of cloudsql and I have an empty provider.tf with just the proveders info. see below:

provider "google" {
  project = "*******"
}

terraform {
    required_providers {
        google = {
        version = "~> 4.85.0"
        }
  }
}

Thanks (:

github-actions[bot] commented 3 days ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.