Delete outdated or unused Image Builder resources
Your Image Builder environment, just like your home, needs
regular maintenance to help you find what you need, and complete your tasks without
wading through clutter. Make sure to regularly clean up temporary resources that you
created for testing. Otherwise, you might forget about those resources, and then later,
not remember what they were used for. By then, it might not be clear if you can safely get rid of them.
Deleting resources does not delete any Amazon EC2 AMIs or Amazon 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 AWS CLI commands.
To prevent dependency errors when you delete resources, make sure to delete your
resources in the following order:
-
Image pipeline
-
Image recipe
-
All remaining resources
Delete an image pipeline
- Console
-
Delete the pipeline
-
To see a list of the build pipelines created under your
account, choose Image pipelines
from the navigation pane.
-
Select the check box next to Pipeline name
to select the pipeline that you want to delete.
-
At the top of the Image pipelines
panel, on the Actions menu, choose
Delete.
-
To confirm the deletion, enter Delete in the box,
and choose Delete.
- AWS CLI
-
The following example shows how to delete an image pipeline
by specifying its ARN:
aws imagebuilder delete-image-pipeline --image-pipeline-arn arn:aws:imagebuilder:us-west-2:123456789012:image-pipeline/my-example-pipeline
- PowerShell
-
The following example shows how to use the Remove-EC2IBImagePipeline
cmdlet to delete an image pipeline by specifying its Amazon Resource Name
(ARN):
Remove-EC2IBImagePipeline -ImagePipelineArn arn:aws:imagebuilder:us-west-2:123456789012:image-pipeline/my-example-pipeline
Delete an image recipe
- Console
-
Delete the recipe
-
To see a list of the recipes created under your
account, choose Image recipes
from the navigation pane.
-
Select the check box next to Recipe name
to select the recipe that you want to delete.
-
At the top of the Image recipes
panel, on the Actions menu,
choose Delete recipe.
-
To confirm the deletion, enter Delete in the box,
and choose Delete.
- AWS CLI
-
The following example shows how to delete an image recipe
by specifying its ARN:
aws imagebuilder delete-image-recipe --image-recipe-arn arn:aws:imagebuilder:us-west-2:123456789012:image-recipe/my-example-recipe/2019.12.03
- PowerShell
-
The following example shows how to use the Remove-EC2IBImageRecipe
cmdlet to delete an image recipe by specifying its Amazon Resource Name
(ARN):
Remove-EC2IBImageRecipe -ImageRecipeArn arn:aws:imagebuilder:us-west-2:123456789012:image-recipe/my-example-recipe/2019.12.03
Delete a container recipe
- Console
-
Delete the container recipe
-
To see a list of the container recipes created under your
account, choose Container recipes
from the navigation pane.
-
Select the check box next to Recipe name
to select the recipe that you want to delete.
-
At the top of the Container recipes
panel, on the Actions menu,
choose Delete recipe.
-
To confirm the deletion, enter Delete in the box,
and choose Delete.
- AWS CLI
-
The following example shows how to delete a container recipe
by specifying its ARN:
aws imagebuilder delete-container-recipe --container-recipe-arn arn:aws:imagebuilder:us-west-2:123456789012:container-recipe/my-example-container-recipe/1.0.0
- PowerShell
-
The following example shows how to use the Remove-EC2IBContainerRecipe
cmdlet to delete a container recipe by specifying its Amazon Resource Name
(ARN):
Remove-EC2IBContainerRecipe -ContainerRecipeArn arn:aws:imagebuilder:us-west-2:123456789012:container-recipe/my-example-container-recipe/1.0.0
Delete an infrastructure configuration
- Console
-
Delete infrastructure configuration
-
To see a list of the infrastructure configurations created
under your account, choose Infrastructure
configuration from the navigation pane.
-
Select the check box next to Configuration name
to select the infrastructure configuration that you want to delete.
-
At the top of the Infrastructure configurations
panel, choose Delete.
-
To confirm the deletion, enter Delete in the box,
and choose Delete.
- AWS CLI
-
The following example shows how to delete an infrastructure
configuration resource by specifying its ARN:
aws imagebuilder delete-infrastructure-configuration --infrastructure-configuration-arn arn:aws:imagebuilder:us-west-2:123456789012:infrastructure-configuration/my-example-infrastructure-configuration
- PowerShell
-
The following example shows how to use the Remove-EC2IBInfrastructureConfiguration
cmdlet to delete an infrastructure configuration resource by specifying its
Amazon Resource Name (ARN):
Remove-EC2IBInfrastructureConfiguration -InfrastructureConfigurationArn arn:aws:imagebuilder:us-west-2:123456789012:infrastructure-configuration/my-example-infrastructure-configuration
Delete distribution settings
- Console
-
Delete distribution settings
-
To see a list of the distribution settings created
under your account, choose Distribution
settings from the navigation pane.
-
Select the check box next to Configuration name
to select the distribution settings that you created
for this tutorial.
-
At the top of the Distribution settings
panel, choose Delete.
-
To confirm the deletion, enter Delete in the box,
and choose Delete.
- AWS CLI
-
The following example shows how to delete a distribution
settings resource by specifying its ARN:
aws imagebuilder delete-distribution-configuration --distribution-configuration-arn arn:aws:imagebuilder:us-west-2:123456789012:distribution-configuration/my-example-distribution-configuration
- PowerShell
-
The following example shows how to use the Remove-EC2IBDistributionConfiguration
cmdlet to delete a distribution settings resource by specifying its Amazon
Resource Name (ARN):
Remove-EC2IBDistributionConfiguration -DistributionConfigurationArn arn:aws:imagebuilder:us-west-2:123456789012:distribution-configuration/my-example-distribution-configuration
Delete an image
- Console
-
-
To see a list of the images created under your account,
choose Images from the
navigation pane.
-
Choose the image Version for
the image that you want to remove. This opens the
Image build versions page.
-
Select the check box next to the Version
for any image that you want to delete. You can select more than one
image version at a time.
-
At the top of the Image build versions
panel, choose Delete version.
-
To confirm the deletion, enter Delete in the box,
and choose Delete.
- AWS CLI
-
The following example shows how to delete an image build
version by specifying its ARN:
aws imagebuilder delete-image --image-build-version-arn arn:aws:imagebuilder:us-west-2:123456789012:image/my-example-image/2019.12.02/1
- PowerShell
-
The following example shows how to use the Remove-EC2IBImage
cmdlet to delete an image build version by specifying its Amazon Resource
Name (ARN):
Remove-EC2IBImage -ImageBuildVersionArn arn:aws:imagebuilder:us-west-2:123456789012:image/my-example-image/2019.12.02/1
Delete a component
Make sure there are no recipes that reference the component
build version in any way before you delete it. Failing to do so
could cause pipeline failures.
- AWS CLI
-
The following example shows how to delete a component build
version by specifying its ARN:
aws imagebuilder delete-component --component-build-version-arn arn:aws:imagebuilder:us-west-2:123456789012:component/my-example-component/2019.12.02/1
- PowerShell
-
The following example shows how to use the Remove-EC2IBComponent
cmdlet to delete a component build version by specifying its Amazon Resource
Name (ARN):
Remove-EC2IBComponent -ComponentBuildVersionArn arn:aws:imagebuilder:us-west-2:123456789012:component/my-example-component/2019.12.02/1