deleteImage

abstract suspend fun deleteImage(input: DeleteImageRequest): DeleteImageResponse

Deletes an Image Builder image resource. This does not delete any EC2 AMIs or ECR container images that are created during the image build process. You must clean those up separately, using the appropriate Amazon EC2 or Amazon ECR console actions, or API or CLI commands.

The request fails with ResourceDependencyException if the image is shared with other accounts, or if other resources depend on it. It also fails while the image build is still running. Cancel an in-progress build with CancelImageCreation before you delete the image.

Samples

// The following example deletes the Image Builder image record for the specified build version EC2
// AMIs or ECR container images that the build created aren t removed.
val resp = imagebuilderClient.deleteImage {
    imageBuildVersionArn = "arn:aws:imagebuilder:us-west-2:111122223333:image/my-example-recipe/1.0.0/1"
}