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

No images found for AMI when updating aws_instance #11549

Closed
jeroen-nijssen opened this issue Jan 10, 2020 · 5 comments
Closed

No images found for AMI when updating aws_instance #11549

jeroen-nijssen opened this issue Jan 10, 2020 · 5 comments
Labels
service/ec2 Issues and PRs that pertain to the ec2 service.

Comments

@jeroen-nijssen
Copy link

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 other comments that do not add relevant new information or questions, 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 v0.12.3

  • provider.aws v2.44.0
  • provider.null v2.1.2

Affected Resource(s)

  • aws_instance

Terraform Configuration Files

resource "aws_instance" "ec2_instance" {
  ami = "${var.ami}"
  instance_type = "${var.instance_type}"
  
  ebs_optimized        = false
  monitoring           = true
  key_name             = "${var.key_name}"
  iam_instance_profile = "${var.iam_instance_profile}"

#Networking
  vpc_security_group_ids = "${var.security_group_ids}"
  subnet_id = "${data.aws_subnet.Subnet-Used.id}"
  source_dest_check    = true

#Disks
  root_block_device {
    volume_size           = "${var.os_disk_size}"
    volume_type           = "gp2"
    delete_on_termination = false
    encrypted             = true
    kms_key_id            = "alias/xxx"

  }

  ebs_block_device {
    device_name           = "/dev/xvdz"
    volume_size           = "${var.data_disk_size}"
    volume_type           = "gp2"
    delete_on_termination = false
    encrypted             = true
    kms_key_id            = "alias/xxx"

  }

  lifecycle {
    ignore_changes = ["ami", "user_data", "subnet_id", "key_name", "ebs_optimized", "private_ip", "root_block_device", "ebs_block_device"]
  }
}

Expected Behavior

Run trough the plan and update the instance accourdingly

Actual Behavior

Plan fails with error

Error: No images found for AMI ami-05ded958b37e57xxx

Steps to Reproduce

  1. terraform init
  2. terraform plan

References

@ghost ghost added the service/ec2 Issues and PRs that pertain to the ec2 service. label Jan 10, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 10, 2020
@sfesfizh
Copy link

Suggestion commented here has solved my problem:

no error when version
provider "aws" {
version = "<=2.22"

@Criegg
Copy link

Criegg commented Jan 30, 2020

I was able to fix this issue with the same suggestion, however it introduced a new problem:

Error: Unsupported block type

  on ecs-ec2.tf line 126, in resource "aws_ecs_cluster" "ecs_service_cluster":
 126:   setting {

Blocks of type "setting" are not expected here.

This works in (likely) any version above 2.22 as it works on 2.23 and latest, but both of these reintroduce the AMI error.

@justinretzolk
Copy link
Member

Hey y'all 👋 Thank you for taking the time to file this issue and for the continued discussion! Given that there's been a number of AWS provider releases since the last update, can anyone confirm whether you're still experiencing this behavior?

@justinretzolk justinretzolk added waiting-response Maintainers are waiting on response from community or contributor. and removed needs-triage Waiting for first response or review from a maintainer. labels Nov 18, 2021
@jeroen-nijssen
Copy link
Author

Hey @justinretzolk 👋🏼

From my perspective, we have solved our challenge here.
I don't remember when the issue got solved, but it's somewhere ages ago...

Thanks for following up. 👍🏼

@github-actions github-actions bot removed the waiting-response Maintainers are waiting on response from community or contributor. label Nov 22, 2021
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
Development

No branches or pull requests

4 participants