title: AWS Java delete snapshot created with CreateImage
body: <p>I have used the Java API for AWS for some time now but somehow I can't find how to delete a snapshot that was created with a CreateImage request.</p>
  
  <p>This request will provide you with an Image containing an Image ID.
  When you want to remove the image you can Deregister it given this ID.
  But I can't find how to delete the snapshot that is being used by that Image.</p>
  
  <p>Am I missing something here?</p>
  
  <p>Thanks in advance,</p>
  
  <p>Giriel</p>
  
  <p>PS: Some code to show what I mean:</p>
  
  <pre><code>final CreateImageResult createAMIResult =  AWS.ec2.createImage(new CreateImageRequest().withInstanceId(instanceID).withName(amiName).withNoReboot(noReboot));
  final String imageId = createAMIResult.getImageId();
  
  //After a while I want to remove it again
  
  AWS.ec2.deregisterImage(new DeregisterImageRequest(imageId));
  //TODO: How to remove the snapshot??
  </code></pre>