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_ami for ubuntu is not working #15

Open
kumarrkslinux opened this issue Dec 28, 2021 · 0 comments
Open

aws_ami for ubuntu is not working #15

kumarrkslinux opened this issue Dec 28, 2021 · 0 comments

Comments

@kumarrkslinux
Copy link

kumarrkslinux commented Dec 28, 2021

While running this code I am always getting this error, can you help for this.

provider "aws"{
region = "ap-south-1"
access_key = "key"
secret_key = "kay"
}

data "aws_ami" "ubuntu"{
most_recent = true
owners = ["099720109477"]

filter {
    name = "name"
    #values = ["amzn2-ami-hvm-*-x86_64-gp2"]
    values = ["ubuntu/images/ubuntu-*-*-amd64-server-*"]
        }

}

resource "aws_instance" "new_vm" {
ami = "data.aws_ami.ubuntu.id"
instance_type = "t2.micro"
}

Error:

aws_instance.new_vm: Creating...

  1. Sometime:
    │ Error: Error launching source instance: InvalidAMIID.Malformed: Invalid id: "aws_ami.ubuntu.id" (expecting "ami-...")
    │ status code: 400, request id: be8982b3-11c5-4159-9375-654814ba2b57

    │ with aws_instance.new_vm,
    │ on data_source.tf line 28, in resource "aws_instance" "new_vm":
    │ 28: resource "aws_instance" "new_vm" {

ws_instance.new_vm: Creating...

  1. sometime
    │ Error: Error launching source instance: UnsupportedOperation: AMI 'ami-0011ac562eeee4a55' with an instance-store root device is not supported for the instance type 't2.medium'.
    │ status code: 400, request id: 328c37c1-848f-45ab-ae3f-3202a8fc899b

    │ with aws_instance.new_vm,
    │ on data_source.tf line 18, in resource "aws_instance" "new_vm":
    │ 18: resource "aws_instance" "new_vm" {

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant