EBS block device recreates at every 'apply'

733 views
Skip to first unread message

Andrew Langhorn

unread,
Dec 14, 2015, 9:45:54 AM12/14/15
to terrafo...@googlegroups.com
Hi,

I'm specifying an EBS block device as part of an EC2 instance. It is set to delete on termination. When I run 'terraform plan', I'm told that Terraform wants to recreate the entire resource since a new EBS volume forces recreation of the instance. If the instance already exists and is working, does anyone know why Terraform wants to recreate the volume/instance?

Thanks,

--

Andrew Langhorn
Senior Infrastructure Engineer
Emailandrew....@thoughtworks.com
Telephone+44 7733 339809
ThoughtWorks

Joshua Garnett

unread,
Dec 14, 2015, 11:36:09 AM12/14/15
to terrafo...@googlegroups.com
Hi Andrew,

Is there any chance you are attempting to use the EBS block device as the root volume?  I was originally using ebs_block_device instead of root_block_device and noticed a similar problem to what you are experiencing.

For an existing instance that is already running, you should instead use the aws_ebs_volume and aws_volume_attachment resources, which will create a volume that isn't explicitly attached to the instance.

--Josh

--
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/CAEpa1DJmWsXsC%2BE-rscEHty-N-_%3D19rwhnVj7zwfboj6g9xoEQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Andrew Langhorn

unread,
Dec 14, 2015, 12:17:18 PM12/14/15
to terrafo...@googlegroups.com
Hi Josh,

For $reasons, I have a new EBS device mapped to /dev/sdg, which I'm attaching using ebs_block_device. The root block device is still managed by AWS, and I'm not touching that in Terraform.

I'll have a look at aws_ebs_volume and aws_volume_attachment, because they sound more along the lines of what I want to do.

Thanks,

Andrew


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

ja...@fpcomplete.com

unread,
Dec 15, 2015, 10:34:58 AM12/15/15
to Terraform, andrew....@thoughtworks.com


On Monday, December 14, 2015 at 12:17:18 PM UTC-5, Andrew Langhorn wrote:
Hi Josh,

For $reasons, I have a new EBS device mapped to /dev/sdg, which I'm attaching using ebs_block_device. The root block device is still managed by AWS, and I'm not touching that in Terraform.

I'll have a look at aws_ebs_volume and aws_volume_attachment, because they sound more along the lines of what I want to do.


I'd love to hear how this works out for you, I ran into issues using it and have not had the time to return to this and figure out the correct flow.







Reply all
Reply to author
Forward
0 new messages