consumable_resources
Creates, updates, deletes or gets a consumable_resource resource or lists consumable_resources in a region
Overview
| Name | consumable_resources |
| Type | Resource |
| Description | Resource Type definition for AWS::Batch::ConsumableResource |
| Id | awscc.batch.consumable_resources |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
consumable_resource_name | string | Name of ConsumableResource. |
consumable_resource_arn | string | ARN of the Scheduling Policy. |
total_quantity | integer | Total Quantity of ConsumableResource. |
in_use_quantity | integer | In-use Quantity of ConsumableResource. |
available_quantity | integer | Available Quantity of ConsumableResource. |
resource_type | string | Type of Consumable Resource. |
created_at | integer | |
tags | object | A key-value pair to associate with a resource. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
consumable_resource_arn | string | ARN of the Scheduling Policy. |
region | string | AWS region. |
For more information, see AWS::Batch::ConsumableResource.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | consumable_resources | INSERT | ResourceType, TotalQuantity, region |
delete_resource | consumable_resources | DELETE | Identifier, region |
update_resource | consumable_resources | UPDATE | Identifier, PatchDocument, region |
list_resources | consumable_resources_list_only | SELECT | region |
get_resource | consumable_resources | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual consumable_resource.
SELECT
region,
consumable_resource_name,
consumable_resource_arn,
total_quantity,
in_use_quantity,
available_quantity,
resource_type,
created_at,
tags
FROM awscc.batch.consumable_resources
WHERE
region = '{{ region }}' AND
Identifier = '{{ consumable_resource_arn }}';
Lists all consumable_resources in a region.
SELECT
region,
consumable_resource_arn
FROM awscc.batch.consumable_resources_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new consumable_resource resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.batch.consumable_resources (
TotalQuantity,
ResourceType,
region
)
SELECT
'{{ total_quantity }}',
'{{ resource_type }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.batch.consumable_resources (
ConsumableResourceName,
TotalQuantity,
ResourceType,
Tags,
region
)
SELECT
'{{ consumable_resource_name }}',
'{{ total_quantity }}',
'{{ resource_type }}',
'{{ 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: consumable_resource
props:
- name: consumable_resource_name
value: '{{ consumable_resource_name }}'
- name: total_quantity
value: '{{ total_quantity }}'
- name: resource_type
value: '{{ resource_type }}'
- name: tags
value: {}
UPDATE example
Use the following StackQL query and manifest file to update a consumable_resource resource, using stack-deploy.
/*+ update */
UPDATE awscc.batch.consumable_resources
SET PatchDocument = string('{{ {
"TotalQuantity": total_quantity
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ consumable_resource_arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.batch.consumable_resources
WHERE
Identifier = '{{ consumable_resource_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 consumable_resources resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
Batch:CreateConsumableResource,
Batch:TagResource
Batch:DescribeConsumableResource
Batch:UpdateConsumableResource,
Batch:TagResource,
Batch:UnTagResource
Batch:DescribeConsumableResource,
Batch:DeleteConsumableResource
Batch:ListConsumableResources