container_recipes
Creates, updates, deletes or gets a container_recipe resource or lists container_recipes in a region
Overview
| Name | container_recipes |
| Type | Resource |
| Description | Resource schema for AWS::ImageBuilder::ContainerRecipe |
| Id | awscc.imagebuilder.container_recipes |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of the container recipe. |
name | string | The name of the container recipe. |
description | string | The description of the container recipe. |
version | string | The semantic version of the container recipe (<major>.<minor>.<patch>). |
components | array | Components for build and test that are included in the container recipe. |
instance_configuration | object | A group of options that can be used to configure an instance for building and testing container images. |
dockerfile_template_data | string | Dockerfiles are text documents that are used to build Docker containers, and ensure that they contain all of the elements required by the application running inside. The template data consists of contextual variables where Image Builder places build information or scripts, based on your container image recipe. |
dockerfile_template_uri | string | The S3 URI for the Dockerfile that will be used to build your container image. |
platform_override | string | Specifies the operating system platform when you use a custom source image. |
container_type | string | Specifies the type of container, such as Docker. |
image_os_version_override | string | Specifies the operating system version for the source image. |
target_repository | object | The destination repository for the container image. |
kms_key_id | string | Identifies which KMS key is used to encrypt the container image. |
parent_image | string | The source image for the container recipe. |
working_directory | string | The working directory to be used during build and test workflows. |
tags | object | Tags that are attached to the container recipe. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of the container recipe. |
region | string | AWS region. |
For more information, see AWS::ImageBuilder::ContainerRecipe.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | container_recipes | INSERT | region |
delete_resource | container_recipes | DELETE | Identifier, region |
update_resource | container_recipes | UPDATE | Identifier, PatchDocument, region |
list_resources | container_recipes_list_only | SELECT | region |
get_resource | container_recipes | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual container_recipe.
SELECT
region,
arn,
name,
description,
version,
components,
instance_configuration,
dockerfile_template_data,
dockerfile_template_uri,
platform_override,
container_type,
image_os_version_override,
target_repository,
kms_key_id,
parent_image,
working_directory,
tags
FROM awscc.imagebuilder.container_recipes
WHERE
region = 'us-east-1' AND
Identifier = '{{ arn }}';
Lists all container_recipes in a region.
SELECT
region,
arn
FROM awscc.imagebuilder.container_recipes_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new container_recipe resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.imagebuilder.container_recipes (
Name,
Description,
Version,
Components,
InstanceConfiguration,
DockerfileTemplateData,
DockerfileTemplateUri,
PlatformOverride,
ContainerType,
ImageOsVersionOverride,
TargetRepository,
KmsKeyId,
ParentImage,
WorkingDirectory,
Tags,
region
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ version }}',
'{{ components }}',
'{{ instance_configuration }}',
'{{ dockerfile_template_data }}',
'{{ dockerfile_template_uri }}',
'{{ platform_override }}',
'{{ container_type }}',
'{{ image_os_version_override }}',
'{{ target_repository }}',
'{{ kms_key_id }}',
'{{ parent_image }}',
'{{ working_directory }}',
'{{ tags }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.imagebuilder.container_recipes (
Name,
Description,
Version,
Components,
InstanceConfiguration,
DockerfileTemplateData,
DockerfileTemplateUri,
PlatformOverride,
ContainerType,
ImageOsVersionOverride,
TargetRepository,
KmsKeyId,
ParentImage,
WorkingDirectory,
Tags,
region
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ version }}',
'{{ components }}',
'{{ instance_configuration }}',
'{{ dockerfile_template_data }}',
'{{ dockerfile_template_uri }}',
'{{ platform_override }}',
'{{ container_type }}',
'{{ image_os_version_override }}',
'{{ target_repository }}',
'{{ kms_key_id }}',
'{{ parent_image }}',
'{{ working_directory }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: container_recipe
props:
- name: name
value: '{{ name }}'
- name: description
value: '{{ description }}'
- name: version
value: '{{ version }}'
- name: components
value:
- component_arn: '{{ component_arn }}'
parameters:
- name: '{{ name }}'
value:
- '{{ value[0] }}'
- name: instance_configuration
value:
image: '{{ image }}'
block_device_mappings:
- device_name: '{{ device_name }}'
virtual_name: '{{ virtual_name }}'
no_device: '{{ no_device }}'
ebs:
encrypted: '{{ encrypted }}'
delete_on_termination: '{{ delete_on_termination }}'
iops: '{{ iops }}'
kms_key_id: '{{ kms_key_id }}'
snapshot_id: '{{ snapshot_id }}'
throughput: '{{ throughput }}'
volume_size: '{{ volume_size }}'
volume_type: '{{ volume_type }}'
- name: dockerfile_template_data
value: '{{ dockerfile_template_data }}'
- name: dockerfile_template_uri
value: '{{ dockerfile_template_uri }}'
- name: platform_override
value: '{{ platform_override }}'
- name: container_type
value: '{{ container_type }}'
- name: image_os_version_override
value: '{{ image_os_version_override }}'
- name: target_repository
value:
service: '{{ service }}'
repository_name: '{{ repository_name }}'
- name: kms_key_id
value: '{{ kms_key_id }}'
- name: parent_image
value: '{{ parent_image }}'
- name: working_directory
value: '{{ working_directory }}'
- name: tags
value: {}
UPDATE example
Use the following StackQL query and manifest file to update a container_recipe resource, using stack-deploy.
/*+ update */
UPDATE awscc.imagebuilder.container_recipes
SET PatchDocument = string('{{ {
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';
DELETE example
/*+ delete */
DELETE FROM awscc.imagebuilder.container_recipes
WHERE
Identifier = '{{ arn }}' AND
region = 'us-east-1';
Permissions
To operate on the container_recipes resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
iam:GetRole,
iam:CreateServiceLinkedRole,
imagebuilder:GetComponent,
imagebuilder:TagResource,
imagebuilder:GetContainerRecipe,
imagebuilder:CreateContainerRecipe,
imagebuilder:GetImage,
kms:Encrypt,
kms:Decrypt,
kms:ReEncryptFrom,
kms:ReEncryptTo,
kms:GenerateDataKey,
kms:GenerateDataKeyPair,
kms:GenerateDataKeyPairWithoutPlaintext,
kms:GenerateDataKeyWithoutPlaintext,
s3:GetObject,
s3:ListBucket,
ecr:DescribeRepositories,
ec2:DescribeImages
imagebuilder:GetContainerRecipe,
kms:Decrypt
imagebuilder:TagResource,
imagebuilder:UntagResource
imagebuilder:UntagResource,
imagebuilder:GetContainerRecipe,
imagebuilder:DeleteContainerRecipe
imagebuilder:ListContainerRecipes