title: Initializing EBS Volume in EC2 Windows Instance using Terraform
body: <p>I have a custom windows AMI and whenever i create a new Instance using it I want to Initialize an additional drive automatically depending on the requirements. I am trying to do this using Terraform.</p>
  
  <p>I am getting the drive but had to manually initialize it.</p>
  
  <p>create and ec2 instance and attach volume.</p>
  
  <pre><code>resource "aws_instance" "example" {
    ami           = "ami-098792953bbd38e18"
    instance_type = "t2.micro"
  
  }
  
  resource "aws_ebs_volume" "ebs-volume-1" {
      availability_zone = "eu-west-1a"
      size = 160
      type = "st1"
      tags {
          Name = "more volume"
      }
  }
  
  resource "aws_volume_attachment" "ebs-volume-1-attachment" {
    device_name = "/dev/sdf"
    volume_id = "${aws_ebs_volume.ebs-volume-1.id}"
     instance_id = "${aws_instance.example.id}"
  }
  </code></pre>