image_recipes
Creates, updates, deletes or gets an image_recipe resource or lists image_recipes in a region
Overview
| Name | image_recipes |
| Type | Resource |
| Description | Resource schema for AWS::ImageBuilder::ImageRecipe |
| Id | awscc.imagebuilder.image_recipes |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of the image recipe. |
name | string | The name of the image recipe. |
description | string | The description of the image recipe. |
version | string | The version of the image recipe. |
components | array | The components of the image recipe. |
block_device_mappings | array | The block device mappings to apply when creating images from this recipe. |
parent_image | string | The parent image of the image recipe. |
working_directory | string | The working directory to be used during build and test workflows. |
additional_instance_configuration | object | Specify additional settings and launch scripts for your build instances. |
tags | object | The tags of the image recipe. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of the image recipe. |
region | string | AWS region. |
For more information, see AWS::ImageBuilder::ImageRecipe.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | image_recipes | INSERT | Name, Version, Components, ParentImage, region |
delete_resource | image_recipes | DELETE | Identifier, region |
update_resource | image_recipes | UPDATE | Identifier, PatchDocument, region |
list_resources | image_recipes_list_only | SELECT | region |
get_resource | image_recipes | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual image_recipe.
SELECT
region,
arn,
name,
description,
version,
components,
block_device_mappings,
parent_image,
working_directory,
additional_instance_configuration,
tags
FROM awscc.imagebuilder.image_recipes
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';
Lists all image_recipes in a region.
SELECT
region,
arn
FROM awscc.imagebuilder.image_recipes_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new image_recipe resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.imagebuilder.image_recipes (
Name,
Version,
Components,
ParentImage,
region
)
SELECT
'{{ name }}',
'{{ version }}',
'{{ components }}',
'{{ parent_image }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.imagebuilder.image_recipes (
Name,
Description,
Version,
Components,
BlockDeviceMappings,
ParentImage,
WorkingDirectory,
AdditionalInstanceConfiguration,
Tags,
region
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ version }}',
'{{ components }}',
'{{ block_device_mappings }}',
'{{ parent_image }}',
'{{ working_directory }}',
'{{ additional_instance_configuration }}',
'{{ tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: image_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: block_device_mappings
value:
- 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: parent_image
value: '{{ parent_image }}'
- name: working_directory
value: '{{ working_directory }}'
- name: additional_instance_configuration
value:
systems_manager_agent:
uninstall_after_build: '{{ uninstall_after_build }}'
user_data_override: '{{ user_data_override }}'
- name: tags
value: {}
UPDATE example
Use the following StackQL query and manifest file to update a image_recipe resource, using stack-deploy.
/*+ update */
UPDATE awscc.imagebuilder.image_recipes
SET PatchDocument = string('{{ {
"AdditionalInstanceConfiguration": additional_instance_configuration,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.imagebuilder.image_recipes
WHERE
Identifier = '{{ arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the image_recipes resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
iam:GetRole,
iam:CreateServiceLinkedRole,
imagebuilder:GetComponent,
imagebuilder:GetImage,
imagebuilder:TagResource,
imagebuilder:GetImageRecipe,
imagebuilder:CreateImageRecipe,
ec2:DescribeImages
imagebuilder:GetImageRecipe
imagebuilder:TagResource,
imagebuilder:UntagResource
imagebuilder:UntagResource,
imagebuilder:GetImageRecipe,
imagebuilder:DeleteImageRecipe
imagebuilder:ListImageRecipes