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

does not work with root_block_device type list #18

Closed
pkchuyen opened this issue Feb 23, 2018 · 5 comments
Closed

does not work with root_block_device type list #18

pkchuyen opened this issue Feb 23, 2018 · 5 comments

Comments

@pkchuyen
Copy link

I have an issue with create custom size for root block device for EC2 instance

root_block_device = "${var.root_block_device}"

while root_block_device should be type map

root_block_device {
volume_type = "gp2"
volume_size = 100
delete_on_termination = true
}

maybe i am wrong because we might have another way to do it with current module code which i could not figure out.

I am happy with pushing a PR for fixing it.

main.tf

root_block_device {
volume_type = "${var.root_block_device.type}"
volume_size = "${var.root_block_device.size}"
delete_on_termination = "${var.root_block_device.delete_on_termination}"
}

@pkchuyen
Copy link
Author

my terraform version
tf --version
Terraform v0.10.6

@antonbabenko
Copy link
Member

root_block_device is a list, so you should be able to pass values like this:

module "ec2" {

  root_block_device = [{
volume_type = "gp2"
volume_size = 100
delete_on_termination = true
}]

# the rest is omitted...
}

If this does not work, please submit a PR which fixes it.

@pkchuyen
Copy link
Author

it works like charm with your guidance.
Could be great if we can put it in the example

Thanks for the quick support

@eddideku
Copy link

@antonbabenko THANKS FOR THIS!

@github-actions
Copy link

github-actions bot commented Nov 9, 2022

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 Nov 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants