我已经使用 AWS 的 Java API 有一段时间了,但不知何故,我找不到如何删除使用 CreateImage 请求创建的快照。
此请求将为您提供包含图像 ID 的图像。当您想删除图像时,您可以在给定此 ID 的情况下取消注册它。但我找不到如何删除该图像正在使用的快照。
我在这里错过了什么吗?
提前致谢,
吉列尔
PS:一些代码来说明我的意思:
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??