ephemeral_block_device for an i2.8xlarge

578 views
Skip to first unread message

Ryan B

unread,
Aug 27, 2015, 6:47:48 PM8/27/15
to Terraform
So i'm looking to make use of all the SSD ephemeral disks that come with the i2.8xlarge.  In order to get all the devices it seems i have to issue the argument 8 times:

   ephemeral_block_device {
   device_name = "/dev/xvdb"
   virtual_name = "ephemeral0"
   }
   
.
   .
   
.
   ephemeral_block_device
{
   device_name = "/dev/xvdi"
   virtual_name = "ephemeral7"
   }

Long shot... Can terraform take something like this?:
   ephemeral_block_device {
   device_name = "/dev/xvd{b..i}"
   virtual_name = "ephemeral{0..7}"
   }

If not what's the best way I can accomplish this?  I think it's ok if my template is only working on 1 aws_instance resource but If i have several the template will look pretty repetitive.

TIA

Ryan B

unread,
Sep 1, 2015, 3:17:17 PM9/1/15
to Terraform
I proceeded with just specifying 8 ephemeral_block_device arguments.  This is ok for now since I'm only orchestrating a few systems at a time.

In addition, according  to AWS support, i can specify the max # of ephemeral drives (currently it's 8 across all instance types) in a template and I'll still be  able to use the same template for instance types that have less.  It won't error out.   It will make all the ephemeral disks that instance type has available.  This is apparently how the aws console works.  You get the ephemeral disks even if you don't ask for them.  this is not true when done through the API/cli.  You get whatever your AMI was initially built with or what you ask for during terraform plan (API).

Paul Hinze

unread,
Sep 2, 2015, 11:09:40 AM9/2/15
to terrafo...@googlegroups.com
Hi Ryan,

Unfortunately today we don't have a great way of concisely representing repeated config blocks like that.

That detail from AWS support is helpful. If that's true about the API behavior, theoretically you could make a Terraform module called something like "instance_with_all_ephemeral_disks" that has the fanned out config once, and the rest of the attributes parameterized. Then you could invoke that module whenever you wanted to create an instance that needed its ephemeral disks active.

Paul

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/33a4bf96-a2b1-498f-a25c-e471e08cd01a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Ryan B

unread,
Sep 2, 2015, 12:32:24 PM9/2/15
to Terraform
OK.  My first foray in to terraform modules.  Thanks! I will give it a shot.

-r

Miguel Cruz

unread,
Apr 13, 2016, 3:14:27 PM4/13/16
to Terraform
Hi Ryan, did you ever get time to do this module? I need to declare 24 ephemeral drives on my instances :-/

Cheers,
-Miguel
Reply all
Reply to author
Forward
0 new messages