primary_task_sets
Creates, updates, deletes or gets a primary_task_set resource or lists primary_task_sets in a region
Overview
| Name | primary_task_sets |
| Type | Resource |
| Description | A pseudo-resource that manages which of your ECS task sets is primary. |
| Id | awscc.ecs.primary_task_sets |
Fields
| Name | Datatype | Description |
|---|---|---|
task_set_id | string | The ID or full Amazon Resource Name (ARN) of the task set. |
cluster | string | The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service to create the task set in. |
service | string | The short name or full Amazon Resource Name (ARN) of the service to create the task set in. |
region | string | AWS region. |
For more information, see AWS::ECS::PrimaryTaskSet.
Methods
| Name | Accessible by | Required Params |
|---|---|---|
create_resource | INSERT | Cluster, Service, TaskSetId, region |
update_resource | UPDATE | Identifier, PatchDocument, region |
get_resource | SELECT | Identifier, region |
SELECT examples
Gets all properties from an individual primary_task_set.
SELECT
region,
task_set_id,
cluster,
service
FROM awscc.ecs.primary_task_sets
WHERE
region = '{{ region }}' AND
Identifier = '{{ cluster }}|{{ service }}';
INSERT example
Use the following StackQL query and manifest file to create a new primary_task_set resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.ecs.primary_task_sets (
TaskSetId,
Cluster,
Service,
region
)
SELECT
'{{ task_set_id }}',
'{{ cluster }}',
'{{ service }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.ecs.primary_task_sets (
TaskSetId,
Cluster,
Service,
region
)
SELECT
'{{ task_set_id }}',
'{{ cluster }}',
'{{ service }}',
'{{ 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: primary_task_set
props:
- name: task_set_id
value: '{{ task_set_id }}'
- name: cluster
value: '{{ cluster }}'
- name: service
value: '{{ service }}'
UPDATE example
Use the following StackQL query and manifest file to update a primary_task_set resource, using stack-deploy.
/*+ update */
UPDATE awscc.ecs.primary_task_sets
SET PatchDocument = string('{{ {
"TaskSetId": task_set_id
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ cluster }}|{{ service }}'
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 primary_task_sets resource, the following permissions are required:
- Create
- Update
ecs:DescribeTaskSets,
ecs:UpdateServicePrimaryTaskSet
ecs:DescribeTaskSets,
ecs:UpdateServicePrimaryTaskSet