imagebuilder / Client / delete_image
delete_image¶
- imagebuilder.Client.delete_image(**kwargs)¶
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
ResourceDependencyExceptionif 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.To deregister an EC2 Linux AMI, see Deregister your Linux AMI in the Amazon EC2 User Guide .
To deregister an EC2 Windows AMI, see Deregister your Windows AMI in the Amazon EC2 Windows Guide .
To delete a container image from Amazon ECR, see Deleting an image in the Amazon ECR User Guide.
See also: AWS API Documentation
Request Syntax
response = client.delete_image( imageBuildVersionArn='string' )
- Parameters:
imageBuildVersionArn (string) –
[REQUIRED]
The Amazon Resource Name (ARN) of the Image Builder image resource to delete.
- Return type:
dict
- Returns:
Response Syntax
{ 'requestId': 'string', 'imageBuildVersionArn': 'string' }
Response Structure
(dict) –
requestId (string) –
The request ID that uniquely identifies this request.
imageBuildVersionArn (string) –
The Amazon Resource Name (ARN) of the Image Builder image resource that this request deleted.
Exceptions
imagebuilder.Client.exceptions.ServiceExceptionimagebuilder.Client.exceptions.ClientExceptionimagebuilder.Client.exceptions.InvalidRequestExceptionimagebuilder.Client.exceptions.ServiceUnavailableExceptionimagebuilder.Client.exceptions.ForbiddenExceptionimagebuilder.Client.exceptions.CallRateLimitExceededExceptionimagebuilder.Client.exceptions.ResourceDependencyException