title: How to enable 'delete on termination' for EBS volumes using Java AWS SDK?
body: <p>I am trying to find setting/method through which we can tell AWS SDK to delete an EBS volume on termination. This setting is available through AWS console but not through AWS Java SDK.</p>
  
  <p>My code to create an EBS volume looks like below</p>
  
  <pre><code>CreateVolumeRequest volumeRequest = new CreateVolumeRequest(volumeSize, availabilityZone);
  Volume vol = EC2_CLIENT.createVolume(volumeRequest).getVolume();
  </code></pre>
  
  <p>Can anyone please tell me how to enable delete on termination for EBS volume using Java SDK?</p>