store_image_tasks
Creates, updates, deletes, gets or lists a store_image_tasks resource.
Overview
| Name | store_image_tasks |
| Type | Resource |
| Id | aws.ec2.store_image_tasks |
Fields
The following fields are returned by SELECT queries:
- describe_store_image_tasks
| Name | Datatype | Description |
|---|---|---|
ami_id | string | The ID of the AMI that is being stored. |
bucket | string | The name of the Amazon S3 bucket that contains the stored AMI object. |
progress_percentage | integer | The progress of the task as a percentage. |
s3object_key | string | The name of the stored AMI object in the bucket. |
store_task_failure_reason | string | If the tasks fails, the reason for the failure is returned. If the task succeeds, null is returned. |
store_task_state | string | The state of the store task (InProgress, Completed, or Failed). |
task_start_time | string | The time the task started. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_store_image_tasks | select | region | ImageId, DryRun, Filter, NextToken, MaxResults | Describes the progress of the AMI store tasks. You can describe the store tasks for specified AMIs. If you don't specify the AMIs, you get a paginated list of store tasks from the last 31 days. For each AMI task, the response indicates if the task is InProgress, Completed, or Failed. For tasks InProgress, the response shows the estimated progress as a percentage. Tasks are listed in reverse chronological order. Currently, only tasks from the past 31 days can be viewed. To use this API, you must have the required permissions. For more information, see Permissions for storing and restoring AMIs using S3 in the Amazon EC2 User Guide. For more information, see Store and restore an AMI using S3 in the Amazon EC2 User Guide. |
create_store_image_task | insert | ImageId, region | Bucket, S3ObjectTag, DryRun | Stores an AMI as a single object in an Amazon S3 bucket. To use this API, you must have the required permissions. For more information, see Permissions for storing and restoring AMIs using S3 in the Amazon EC2 User Guide. For more information, see Store and restore an AMI using S3 in the Amazon EC2 User Guide. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
ImageId | string | The ID of the AMI. |
region | string | AWS region (default: us-east-1) |
Bucket | string | The name of the Amazon S3 bucket in which the AMI object will be stored. The bucket must be in the Region in which the request is being made. The AMI object appears in the bucket only after the upload task has completed. |
DryRun | boolean | Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation. |
Filter | array | The filters. task-state - Returns tasks in a certain state (InProgress | Completed | Failed) bucket - Returns task information for tasks that targeted a specific bucket. For the filter value, specify the bucket name. When you specify the ImageIds parameter, any filters that you specify are ignored. To use the filters, you must remove the ImageIds parameter. |
ImageId | array | The AMI IDs for which to show progress. Up to 20 AMI IDs can be included in a request. |
MaxResults | integer | The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination. You cannot specify this parameter and the ImageIds parameter in the same call. |
NextToken | string | The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request. |
S3ObjectTag | array | The tags to apply to the AMI object that will be stored in the Amazon S3 bucket. |
SELECT examples
- describe_store_image_tasks
Describes the progress of the AMI store tasks. You can describe the store tasks for specified AMIs. If you don't specify the AMIs, you get a paginated list of store tasks from the last 31 days. For each AMI task, the response indicates if the task is InProgress, Completed, or Failed. For tasks InProgress, the response shows the estimated progress as a percentage. Tasks are listed in reverse chronological order. Currently, only tasks from the past 31 days can be viewed. To use this API, you must have the required permissions. For more information, see Permissions for storing and restoring AMIs using S3 in the Amazon EC2 User Guide. For more information, see Store and restore an AMI using S3 in the Amazon EC2 User Guide.
SELECT
ami_id,
bucket,
progress_percentage,
s3object_key,
store_task_failure_reason,
store_task_state,
task_start_time
FROM aws.ec2.store_image_tasks
WHERE region = '{{ region }}' -- required
AND ImageId = '{{ ImageId }}'
AND DryRun = '{{ DryRun }}'
AND Filter = '{{ Filter }}'
AND NextToken = '{{ NextToken }}'
AND MaxResults = '{{ MaxResults }}'
;
INSERT examples
- create_store_image_task
- Manifest
Stores an AMI as a single object in an Amazon S3 bucket. To use this API, you must have the required permissions. For more information, see Permissions for storing and restoring AMIs using S3 in the Amazon EC2 User Guide. For more information, see Store and restore an AMI using S3 in the Amazon EC2 User Guide.
INSERT INTO aws.ec2.store_image_tasks (
ImageId,
region,
Bucket,
S3ObjectTag,
DryRun
)
SELECT
'{{ ImageId }}',
'{{ region }}',
'{{ Bucket }}',
'{{ S3ObjectTag }}',
'{{ DryRun }}'
RETURNING
object_key
;
# Description fields are for documentation purposes
- name: store_image_tasks
props:
- name: ImageId
value: "{{ ImageId }}"
description: Required parameter for the store_image_tasks resource.
- name: region
value: "{{ region }}"
description: Required parameter for the store_image_tasks resource.
- name: Bucket
value: "{{ Bucket }}"
description: The name of the Amazon S3 bucket in which the AMI object will be stored. The bucket must be in the Region in which the request is being made. The AMI object appears in the bucket only after the upload task has completed.
description: The name of the Amazon S3 bucket in which the AMI object will be stored. The bucket must be in the Region in which the request is being made. The AMI object appears in the bucket only after the upload task has completed.
- name: S3ObjectTag
value: "{{ S3ObjectTag }}"
description: The tags to apply to the AMI object that will be stored in the Amazon S3 bucket.
description: The tags to apply to the AMI object that will be stored in the Amazon S3 bucket.
- name: DryRun
value: {{ DryRun }}
description: Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
description: Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.