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

Terraform crash when setting root_block_device attribute while launching new instance #2166

Closed
ranjitshinde91 opened this issue Jun 1, 2015 · 8 comments · Fixed by #2450
Closed
Assignees

Comments

@ranjitshinde91
Copy link

Hi,
I am wriintig script to launh instance in aws.
Below is the template:

resource "aws_instance" "demoInstance" {
    ami = "${lookup(var.amis, "demoInstance")}"
    instance_type = "t2.micro"
    key_name ="my-key"
    subnet_id="${aws_subnet.PublicSubnet1.id}"
    source_dest_check = "false"
    root_block_device = ["default"]
    security_groups = ["${aws_security_group.jumpboxSG.id}"]
    tags {
        Name = "jumpbox"
    }
}

When i run terrrafom plan, it gets crashed.
Can you please tell me how to change root block device attributes?

Below are the crash.log file contents:

EDIT by @catsby, formatting and moved crash log to gist: https://gist.github.com/catsby/ac27d20ef561c713f73d

@catsby catsby added the crash label Jun 1, 2015
@catsby
Copy link
Contributor

catsby commented Jun 1, 2015

Hello @ranjitshinde91 – root_block_device expects a block of configuration. The details of which are outlined here:

And explained in AWS Documentation ion Block Device Mapping:

An example would be like this:

  root_block_device = {
    device_name = "/dev/xvdj"
    volume_size = "200"
    delete_on_termination = false
    volume_type = "gp2"
  }

All that said, if you're looking for simply the "default", I think it's safe to omit the root_block_device entirely in your example.

Hope that helps!

@catsby catsby added the core label Jun 1, 2015
@catsby
Copy link
Contributor

catsby commented Jun 1, 2015

@phinze Anything we can do here so this kind of thing (string used instead of a map) should error, not crash?

@phinze
Copy link
Contributor

phinze commented Jun 1, 2015

Yeah the fact that it crashes is definitely a bug. We can leave this open until we address.

@ranjitshinde91
Copy link
Author

@catsby : Thanks this works !

@catsby
Copy link
Contributor

catsby commented Jun 1, 2015

@radeksimko great to hear! Let us know if there's anything else. Until then, we'll leave this open until we can address the underlying bug that causes a crash instead of an error.

Thanks for writing in!

@radeksimko
Copy link
Member

@catsby you meant @ranjitshinde91 I guess? 😃

@catsby
Copy link
Contributor

catsby commented Jun 1, 2015

@radeksimko haha, yes, sorry! 😄

@ghost
Copy link

ghost commented May 2, 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 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.

@ghost ghost locked and limited conversation to collaborators May 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants