Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions,
see Getting Started with Amazon Web Services in China
(PDF).
List and view container recipe details
This section describes the ways that you can find information and view details for your
EC2 Image Builder container recipes.
List container recipes
You can list all of your container recipes, or filter the results by owner. Use
Self to list the recipes that you own, or Shared to list
recipes that other accounts have shared with you.
- Console
-
To see a list of the container recipes created under your account,
follow these steps:
-
Open the EC2 Image Builder console at
https://console.amazonaws.cn/imagebuilder/.
-
Choose Container recipes
from the navigation pane. This shows a list of the
container recipes that are created under your account.
-
To view details or create a new recipe version, choose
the Recipe name link. This opens the
detail view for the recipe.
You can also select the check box next to the Recipe
name, and then choose View
details.
- Amazon CLI
-
The following example shows how to list all of your container
recipes, using the Amazon CLI.
aws imagebuilder list-container-recipes
The command returns a summary for each container recipe, shown in the following
example output.
{
"requestId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
"containerRecipeSummaryList": [
{
"arn": "arn:aws:imagebuilder:us-west-2:123456789012:container-recipe/my-container-recipe/1.0.0",
"name": "my-container-recipe",
"containerType": "DOCKER",
"platform": "Linux",
"owner": "123456789012",
"dateCreated": "2024-01-15T10:30:00.000Z",
"tags": {}
}
]
}
The following example lists only the recipes that you own:
aws imagebuilder list-container-recipes --owner Self
- PowerShell
-
The following example shows how to use the Get-EC2IBContainerRecipeList
cmdlet to list all of your container recipes:
Get-EC2IBContainerRecipeList
The following example lists only the recipes that you own:
Get-EC2IBContainerRecipeList -Owner Self
View container recipe details
- Console
-
To view details for a specific container recipe, select the
container recipe to review, and use the steps described in List container recipes.
On the recipe detail page, you can do the following:
- Amazon CLI
-
The following example shows how to use an imagebuilder
CLI command to get the details of a container recipe by specifying its ARN.
aws imagebuilder get-container-recipe --container-recipe-arn arn:aws:imagebuilder:us-west-2:123456789012:container-recipe/my-container-recipe/1.0.2
The command returns the full container recipe, shown in the following example
output.
{
"requestId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
"containerRecipe": {
"arn": "arn:aws:imagebuilder:us-west-2:123456789012:container-recipe/my-container-recipe/1.0.2",
"containerType": "DOCKER",
"name": "my-container-recipe",
"description": "My Linux Docker container image",
"platform": "Linux",
"components": [
{
"componentArn": "arn:aws:imagebuilder:us-west-2:123456789012:component/my-component/1.0.0/1"
}
],
"parentImage": "amazonlinux:latest",
"dockerfileTemplateData": "FROM {{{ imagebuilder:parentImage }}}\n{{{ imagebuilder:environments }}}\n{{{ imagebuilder:components }}}",
"targetRepository": {
"service": "ECR",
"repositoryName": "my-repo"
},
"dateCreated": "2024-01-15T10:30:00.000Z",
"owner": "123456789012"
}
}
- PowerShell
-
The following example shows how to use the Get-EC2IBContainerRecipe
cmdlet to get the details of a container recipe by specifying its Amazon Resource
Name (ARN):
Get-EC2IBContainerRecipe -ContainerRecipeArn arn:aws:imagebuilder:us-west-2:123456789012:container-recipe/my-container-recipe/1.0.2
Get container recipe policy details
A recipe policy is a resource-based policy. It controls cross-account access to your
recipe. When you share a recipe through Amazon Resource Access Manager (Amazon RAM), Image Builder creates the policy
automatically. You can also set a custom policy with the put-container-recipe-policy
command.
- Amazon CLI
-
The following example shows how to use an imagebuilder CLI command
to get the details of a container recipe policy by specifying its ARN. If no
policy is attached to the recipe, the response is empty.
aws imagebuilder get-container-recipe-policy --container-recipe-arn arn:aws:imagebuilder:us-west-2:123456789012:container-recipe/my-container-recipe/1.0.2
- PowerShell
-
The following example shows how to use the Get-EC2IBContainerRecipePolicy
cmdlet to get the details of a container recipe policy by specifying its ARN:
Get-EC2IBContainerRecipePolicy -ContainerRecipeArn arn:aws:imagebuilder:us-west-2:123456789012:container-recipe/my-container-recipe/1.0.2
The cmdlet returns the policy as a JSON string. If no policy is attached
to the recipe, the cmdlet returns {}.