Skip to content

Import block creation option alongside generated Terraform config #395

Description

@anup2230

I would like Former2 to automatically generate the required import blocks alongside the standard Terraform resource blocks in the output. The generated code would look similar to the example provided:

import {
  to = aws_s3_bucket.example
  id = "my-existing-bucket-id"
}

resource "aws_s3_bucket" "example" {
  # ... generated configuration ...
}

The id field would be automatically populated with the actual resource ID discovered during the Former2 scan, and the to field would link to the generated resource address.

This would allow for teams to use former2 to easily import multiple resources from an AWS account into a project's state file to be managed by terraform/opentofu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions