
Description
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.
Activity
bflad commentedon 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 commentedon Sep 24, 2018
Wow that's really fast, amazing @bflad! 🎉
bflad commentedon 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 commentedon 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.