Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Code Action: Remove a block from state (generate removed block) #1568

Open
4 tasks
radeksimko opened this issue Jan 5, 2024 · 0 comments
Open
4 tasks
Labels

Comments

@radeksimko
Copy link
Member

Background

While working with existing Terraform configuration that has already been deployed, users may sometime wish to "dis-own" a particular resource, or a module, i.e. prevent Terraform from managing it but not destroy it in the process of doing so.

Previously this was done via terraform state rm and Terraform v1.7 comes with a removed {} block which provides equivalent functionality via configuration.

Users may begin with

resource "aws_instance" "to-disown" {
  // ...
}

and end up with

removed {
  from = aws_instance.to-disown

  lifecycle {
    destroy = false
  }
}

Proposal

  • Provide code actions to remove stateful blocks, i.e. replace them with removed {} block
    • Remove resource
    • Remove data
    • Remove module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant