task_definitions
Creates, updates, deletes or gets a task_definition resource or lists task_definitions in a region
Overview
| Name | task_definitions |
| Type | Resource |
| Description | Creates a gateway task definition. |
| Id | awscc.iotwireless.task_definitions |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the new resource. |
auto_create_tasks | boolean | Whether to automatically create tasks using this task definition for all gateways with the specified current version. If false, the task must me created by calling CreateWirelessGatewayTask. |
update | object | Information about the gateways to update. |
lo_ra_wan_update_gateway_task_entry | object | The list of task definitions. |
id | string | The ID of the new wireless gateway task definition |
task_definition_type | string | A filter to list only the wireless gateway task definitions that use this task definition type |
arn | string | TaskDefinition arn. Returned after successful create. |
tags | array | A list of key-value pairs that contain metadata for the destination. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the new wireless gateway task definition |
region | string | AWS region. |
For more information, see AWS::IoTWireless::TaskDefinition.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | task_definitions | INSERT | AutoCreateTasks, region |
delete_resource | task_definitions | DELETE | Identifier, region |
update_resource | task_definitions | UPDATE | Identifier, PatchDocument, region |
list_resources | task_definitions_list_only | SELECT | region |
get_resource | task_definitions | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual task_definition.
SELECT
region,
name,
auto_create_tasks,
update,
lo_ra_wan_update_gateway_task_entry,
id,
task_definition_type,
arn,
tags
FROM awscc.iotwireless.task_definitions
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}';
Lists all task_definitions in a region.
SELECT
region,
id
FROM awscc.iotwireless.task_definitions_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new task_definition resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.iotwireless.task_definitions (
AutoCreateTasks,
region
)
SELECT
'{{ auto_create_tasks }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.iotwireless.task_definitions (
Name,
AutoCreateTasks,
Update,
LoRaWANUpdateGatewayTaskEntry,
TaskDefinitionType,
Tags,
region
)
SELECT
'{{ name }}',
'{{ auto_create_tasks }}',
'{{ update }}',
'{{ lo_ra_wan_update_gateway_task_entry }}',
'{{ task_definition_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: task_definition
props:
- name: name
value: '{{ name }}'
- name: auto_create_tasks
value: '{{ auto_create_tasks }}'
- name: update
value:
update_data_source: '{{ update_data_source }}'
update_data_role: '{{ update_data_role }}'
lo_ra_wan:
update_signature: '{{ update_signature }}'
sig_key_crc: '{{ sig_key_crc }}'
current_version:
package_version: '{{ package_version }}'
model: '{{ model }}'
station: '{{ station }}'
update_version: null
- name: lo_ra_wan_update_gateway_task_entry
value:
current_version: null
update_version: null
- name: task_definition_type
value: '{{ task_definition_type }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a task_definition resource, using stack-deploy.
/*+ update */
UPDATE awscc.iotwireless.task_definitions
SET PatchDocument = string('{{ {
"Name": name,
"AutoCreateTasks": auto_create_tasks,
"Update": update,
"LoRaWANUpdateGatewayTaskEntry": lo_ra_wan_update_gateway_task_entry,
"TaskDefinitionType": task_definition_type,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.iotwireless.task_definitions
WHERE
Identifier = '{{ id }}' 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 task_definitions resource, the following permissions are required:
- Create
- Update
- Read
- Delete
- List
iotwireless:CreateWirelessGatewayTaskDefinition,
iotwireless:TagResource,
iam:GetRole,
iam:PassRole
iotwireless:GetWirelessGatewayTaskDefinition,
iotwireless:TagResource,
iotwireless:UntagResource
iotwireless:GetWirelessGatewayTaskDefinition,
iotwireless:ListTagsForResource
iotwireless:DeleteWirelessGatewayTaskDefinition
iotwireless:ListWirelessGatewayTaskDefinitions,
iotwireless:ListTagsForResource