title: How can attach new EBS volume to existing EC2 instance using java sdk?
body: <p>I have tried using AttachVolumeRequest but in response i get following error</p>
  
  <pre><code> Caught Exception: The request must contain the parameter volume
   Reponse Status Code: 400
   Error Code: MissingParameter
  </code></pre>
  
  <p>here is my code , in this code ec2 is my amazonclient object and its work fine so far </p>
  
  <pre><code>AttachVolumeRequest attachRequest=new AttachVolumeRequest()
      .withInstanceId("my instance id");
  attachRequest.setRequestCredentials(credentials);
  
  EbsBlockDevice ebs=new EbsBlockDevice();
  ebs.setVolumeSize(2);
  
  //attachRequest.withVolumeId(ebs.getSnapshotId());
  
  AttachVolumeResult result=ec2.attachVolume(attachRequest);
  </code></pre>
  
  <p>any help is highly appreciated. thanks in advance </p>