Skip to main content

images

Creates, updates, deletes or gets an image resource or lists images in a region

Overview

Nameimages
TypeResource
DescriptionResource schema for AWS::ImageBuilder::Image
Idaws.imagebuilder.images

Fields

NameDatatypeDescription
arnstringThe Amazon Resource Name (ARN) of the image.
namestringThe name of the image.
image_tests_configurationobjectThe image tests configuration used when creating this image.
image_recipe_arnstringThe Amazon Resource Name (ARN) of the image recipe that defines how images are configured, tested, and assessed.
container_recipe_arnstringThe Amazon Resource Name (ARN) of the container recipe that defines how images are configured and tested.
distribution_configuration_arnstringThe Amazon Resource Name (ARN) of the distribution configuration.
infrastructure_configuration_arnstringThe Amazon Resource Name (ARN) of the infrastructure configuration.
workflowsarrayWorkflows to define the image build process
image_idstringThe AMI ID of the EC2 AMI in current region.
image_uristringURI for containers created in current Region with default ECR image tag
enhanced_image_metadata_enabledbooleanCollects additional information about the image being created, including the operating system (OS) version and package list.
image_scanning_configurationobjectContains settings for vulnerability scans.
execution_rolestringThe execution role name/ARN for the image build, if provided
tagsobjectThe tags associated with the image.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTregion
delete_resourceDELETEdata__Identifier, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all images in a region.

SELECT
region,
arn,
name,
image_tests_configuration,
image_recipe_arn,
container_recipe_arn,
distribution_configuration_arn,
infrastructure_configuration_arn,
workflows,
image_id,
image_uri,
enhanced_image_metadata_enabled,
image_scanning_configuration,
execution_role,
tags
FROM aws.imagebuilder.images
WHERE region = 'us-east-1';

Gets all properties from an individual image.

SELECT
region,
arn,
name,
image_tests_configuration,
image_recipe_arn,
container_recipe_arn,
distribution_configuration_arn,
infrastructure_configuration_arn,
workflows,
image_id,
image_uri,
enhanced_image_metadata_enabled,
image_scanning_configuration,
execution_role,
tags
FROM aws.imagebuilder.images
WHERE region = 'us-east-1' AND data__Identifier = '<Arn>';

INSERT example

Use the following StackQL query and manifest file to create a new image resource, using stack-deploy.

/*+ create */
INSERT INTO aws.imagebuilder.images (
ImageTestsConfiguration,
ImageRecipeArn,
ContainerRecipeArn,
DistributionConfigurationArn,
InfrastructureConfigurationArn,
Workflows,
EnhancedImageMetadataEnabled,
ImageScanningConfiguration,
ExecutionRole,
Tags,
region
)
SELECT
'{{ ImageTestsConfiguration }}',
'{{ ImageRecipeArn }}',
'{{ ContainerRecipeArn }}',
'{{ DistributionConfigurationArn }}',
'{{ InfrastructureConfigurationArn }}',
'{{ Workflows }}',
'{{ EnhancedImageMetadataEnabled }}',
'{{ ImageScanningConfiguration }}',
'{{ ExecutionRole }}',
'{{ Tags }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.imagebuilder.images
WHERE data__Identifier = '<Arn>'
AND region = 'us-east-1';

Permissions

To operate on the images resource, the following permissions are required:

Create

ecr:BatchGetRepositoryScanningConfiguration,
iam:GetRole,
iam:PassRole,
iam:CreateServiceLinkedRole,
imagebuilder:GetImageRecipe,
imagebuilder:GetInfrastructureConfiguration,
imagebuilder:GetDistributionConfiguration,
imagebuilder:GetWorkflow,
imagebuilder:GetImage,
imagebuilder:CreateImage,
imagebuilder:TagResource,
inspector2:BatchGetAccountStatus

Read

imagebuilder:GetImage

Delete

imagebuilder:GetImage,
imagebuilder:DeleteImage,
imagebuilder:UnTagResource,
imagebuilder:CancelImageCreation

List

imagebuilder:ListImages