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

aws_launch_config fails with instance-store AMIs - new in 2.23.0 #9775

Closed
jc-asdf opened this issue Aug 14, 2019 · 10 comments · Fixed by #9810
Closed

aws_launch_config fails with instance-store AMIs - new in 2.23.0 #9775

jc-asdf opened this issue Aug 14, 2019 · 10 comments · Fixed by #9810
Assignees
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/autoscaling Issues and PRs that pertain to the autoscaling service.
Milestone

Comments

@jc-asdf
Copy link
Contributor

jc-asdf commented Aug 14, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

$ terraform --version
Terraform v0.11.14

  • provider.aws v2.23.0

Affected Resource(s)

  • aws_launch_configuration

Terraform Configuration Files

provider "aws" {
  region = "us-east-1"
  assume_role {
    role_arn     = "ROLE OMITTED"
  }
}

variable "instance_store_ami" {
  description = "An instance-store AMI"
}

resource "aws_launch_configuration" "instance_store" {
  name_prefix   = "test-instance-store-ami"
  image_id      = "${var.instance_store_ami}"
  instance_type = "c3.large"

  lifecycle {
    create_before_destroy = true
  }
}

Debug Output

https://gist.github.com/jc-asdf/57da70548170c1a57bf20220de50bc37

Panic Output

N/A

Expected Behavior

A launch config should be created, with an instance store AMI.

Actual Behavior

Terraform aborts with an error - Instance store backed AMIs do not provide a root device name - Use an EBS AMI

Steps to Reproduce

  1. Create an aws_launch_configuration that references an Instance-Store AMI (they're rare, but they do exist!)
  2. Note that there's limited instance types that support instance-store; c3 and m3 families do and are generally available.
  3. Plan and apply the resource, and you will see the error

Important Factoids

This error is new as of version 2.23.0. Provider version 2.22.0 works fine. For now, the workaround would be to pin the provider to version v2.22.0

The error hints that perhaps the provider is trying to reference the root device name, which is not available on Instance Store AMIs.

References

@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Aug 15, 2019
@nywilken
Copy link
Member

@jc-asdf sorry you are running into an issue here. Can you please take a minute to provide the requested information within the issue, especially a Terraform configuration for reproducing the issue, so that we can determine how to best proceed here.

In the meantime, if you haven’t already, you can pin your provider version to “2.22.0”. If this issue is only occurring with version "2.23.0” of the Terraform AWS provider.

provider “aws” {
  version = “2.22.0”
}

@nywilken nywilken added the waiting-response Maintainers are waiting on response from community or contributor. label Aug 15, 2019
@jc-asdf
Copy link
Contributor Author

jc-asdf commented Aug 15, 2019

Oh what happened here; looks like my actual ticket content got gobbled up. I have edited the ticket and filled it in appropriately. Many apologies for the screw up there! And yes, the 2.22.0 provider works fine and is a suitable workaround for now.

@ghost ghost added service/autoscaling Issues and PRs that pertain to the autoscaling service. and removed waiting-response Maintainers are waiting on response from community or contributor. labels Aug 15, 2019
@sglodek
Copy link

sglodek commented Aug 15, 2019

Seeing this issue as well with Terraform 0.12.6 and provider.aws v2.23.0. Will pin to the previous release in the meantime.

@thaiphv
Copy link

thaiphv commented Aug 15, 2019

I think this has been caused by 3d330bd#diff-28aade55afa0cda57279a9d35d523488R1381
I'm not sure why though. Let's wait for someone to confirm it.

@jc-asdf
Copy link
Contributor Author

jc-asdf commented Aug 18, 2019

First go at a fix in PR #9810 above. Passes all the aws_launch_configuration and aws_instance acceptance tests.

@bflad bflad added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Aug 19, 2019
@JamesUoM
Copy link

JamesUoM commented Aug 19, 2019

May not be directly related but as of 2.23 aws_launch_configuration returns an error is the image_id in the saved state cannot be found. I our case we have updated the AMI several times and the old one has been deleted. In <=2.22

# module.compute.aws_launch_configuration.work must be replaced
+/- resource "aws_launch_configuration" "work" {
        associate_public_ip_address      = false
      ~ ebs_optimized                    = false -> (known after apply)
        enable_monitoring                = true
        iam_instance_profile             = "my-profile"
      ~ id                               = "my-foo" -> (known after apply)
      ~ image_id                         = "ami-0844543154aa2671b" -> "ami-0b45f7bbb1bfd5b79" # forces replacement

from 2.23

Error: No images found for AMI ami-0844543154aa2671b

@jc-asdf
Copy link
Contributor Author

jc-asdf commented Aug 26, 2019

Would appreciate some feedback on PR #9810 which reverts the problematic behaviour, and adds in some tests.

It works well for me but I'm seeing a variety of other issues being reported here. If it works for you please thumbs that PR so we can get approved :) Thanks!

@nywilken nywilken added the regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. label Sep 21, 2019
@bflad bflad self-assigned this Feb 12, 2020
@bflad bflad added this to the v2.49.0 milestone Feb 12, 2020
@bflad
Copy link
Contributor

bflad commented Feb 12, 2020

The fix for this has been merged and will release with version 2.49.0 of the Terraform AWS Provider, tomorrow. Thanks to @jc-asdf for the implementation. 👍

@ghost
Copy link

ghost commented Feb 14, 2020

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

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Mar 27, 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 Mar 27, 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. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/autoscaling Issues and PRs that pertain to the autoscaling service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants