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

leftover module in tfstate after failure then successful deletion of AWS LB #23826

Closed
aidanhmiles opened this issue Jan 9, 2020 · 2 comments
Closed

Comments

@aidanhmiles
Copy link

aidanhmiles commented Jan 9, 2020

Hi,

I got this output in a recent run of terraform apply.

Error: leftover module module.fh_appserver in state that should have been removed; this is a bug in Terraform and should be reported

It's not causing issues but just wanted to share. I also wanted to ask if I should manually remove the leftover items from my tfstate (pertinent bits are attached below).

Terraform Version

Terraform v0.12.19
+ provider.aws v2.37.0

Steps to Reproduce

  1. have an AWS LB with deletion protection enabled
  2. remove it (and any related resources like eips or instances) from main.tf
  3. all resources but the LB should be deleted
  4. manually disable deletion protection in the console or via AWS API
  5. re-run terraform apply
  6. LB is deleted, error message appears

Additional Context

The items left in my .tfstate file are:

    {
      "module": "module.fh_appserver",
      "mode": "managed",
      "type": "aws_eip_association",
      "name": "eip_assoc",
      "each": "list",
      "provider": "provider.aws",
      "instances": []
    },
    {
      "module": "module.fh_appserver",
      "mode": "managed",
      "type": "aws_instance",
      "name": "app",
      "each": "list",
      "provider": "provider.aws",
      "instances": []
    },
    {
      "module": "module.fh_appserver",
      "mode": "managed",
      "type": "aws_lb_target_group_attachment",
      "name": "app",
      "each": "list",
      "provider": "provider.aws",
      "instances": []
    }
@jbardin
Copy link
Member

jbardin commented Jan 10, 2020

Duplicate of #23821

@jbardin jbardin marked this as a duplicate of #23821 Jan 10, 2020
@jbardin jbardin closed this as completed Jan 10, 2020
@ghost
Copy link

ghost commented Mar 28, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants