# Attach Ebs volume while creating EC2 instance

**URL:** <https://discuss.hashicorp.com/t/attach-ebs-volume-while-creating-ec2-instance/34436>\
**Category:** CDK for Terraform\
**Created:** [January 19, 2022, 9:00am UTC](https://discuss.hashicorp.com/t/attach-ebs-volume-while-creating-ec2-instance/34436 "2022-01-19T09:00:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vishalailani](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/vishalailani/32/24275_2.png) [@vishalailani](https://discuss.hashicorp.com/u/vishalailani)\
**Post date:** [January 19, 2022, 9:00am UTC](https://discuss.hashicorp.com/t/attach-ebs-volume-while-creating-ec2-instance/34436/1 "2022-01-19T09:00:32Z")

</div>

Hello,

I am creating and EC2 instance and also passing ebsBlockDevice in config. it is creating ebs volume but not mounting it and also not getting updated with config. do we have any way to achieve this ?

---

<div class="post-metadata">

**Author:** ![jsteinich](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jsteinich/32/9502_2.png) [@jsteinich](https://discuss.hashicorp.com/u/jsteinich)\
**Post date:** [January 21, 2022, 2:37am UTC](https://discuss.hashicorp.com/t/attach-ebs-volume-while-creating-ec2-instance/34436/2 "2022-01-21T02:37:05Z")

</div>

Is this a new instance or an existing instance? It seems like `ebsBlockDevice` only applies on creation ([docs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance#ebs_block_device)).

Could also trying creating the volume and using [VolumeAttachment](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/volume_attachment)
