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

Unrecoverable state if you delete a Launch Template by hand #5965

Closed
ghost opened this issue Sep 24, 2018 · 5 comments · Fixed by #5967
Closed

Unrecoverable state if you delete a Launch Template by hand #5965

ghost opened this issue Sep 24, 2018 · 5 comments · Fixed by #5967
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@ghost
Copy link

ghost commented Sep 24, 2018

This issue was originally opened by @kvz as hashicorp/terraform#18931. It was migrated here as a result of the provider split. The original body of the issue is below.


Terraform Version

Terraform v0.11.8'

Terraform Configuration Files

An aws_launch_template used in an aws_autoscaling_group.

Expected Behavior

I noticed some local changes weren't propagating to the Launch Template (this was odd in itself), so
I deleted the Launch Template by hand, and ran Terraform plan, expecting that Terraform would spot a difference between actual & expected state and that it would be recreate a Launch Template with my new settings.

Actual Behavior

At the refresh stage, Terraform errors out:

Error: Error refreshing state: 1 error(s) occurred:

* module.region_euwest2.module.crossover.aws_launch_template.crossover: 1 error(s) occurred:

* module.region_euwest2.module.crossover.aws_launch_template.crossover: aws_launch_template.crossover: Error getting launch template: InvalidLaunchTemplateId.NotFound: Atleast one of the launch templates specified in the request does not exist.
	status code: 400, request id: e321a45b-f359-40b5-9d18-dea9ed9100c2

So I got in an unrecoverable state because refresh is a prerequisite for changes, destroys, launches (I think). I manually removed the Launch Template and any reference to it from the tfstate json, and then I was on my way again.

@bflad bflad added bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service. labels Sep 24, 2018
@bflad
Copy link
Contributor

bflad commented Sep 24, 2018

Hi @kvz 👋 Sorry you ran into trouble with this. I have submitted a bug fix pull request to properly handle this situation with a verifying acceptance test: #5967

@kvz
Copy link

kvz commented Sep 24, 2018

Wow that's really fast, amazing @bflad! 🎉

@bflad bflad added this to the v1.38.0 milestone Sep 26, 2018
@bflad
Copy link
Contributor

bflad commented Sep 26, 2018

The fix for this has been merged and will release with version 1.38.0 of the AWS provider, likely later today.

@bflad
Copy link
Contributor

bflad commented Sep 26, 2018

This has been released in version 1.38.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link
Author

ghost commented Apr 3, 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
2 participants