Need to remove a resource from the state file but not from the console

41 views Asked by At

I have a requirement where in case I remove a particular module I don't want it to delete the actual resource on the platform, but just remove it from the state file so it won't be tracked anymore

Is there some lifecycle rule or something that can do this for me?

  • Note: I know I can just run the cli and remove it from the state file but that is more of a manual approach

Example: Say that I have a Cloud Storage bucket which I created thru Terraform Now something happened and I want it to be removed from my Terraform code So I would normally just go and remove the module/configs of it But that would still go and delete the Cloud Storage bucket, which I do not want to do

0

There are 0 answers