Skip to main content

primary_task_sets

Creates, updates, deletes or gets a primary_task_set resource or lists primary_task_sets in a region

Overview

Nameprimary_task_sets
TypeResource
DescriptionA pseudo-resource that manages which of your ECS task sets is primary.
Idawscc.ecs.primary_task_sets

Fields

NameDatatypeDescription
task_set_idstringThe ID or full Amazon Resource Name (ARN) of the task set.
clusterstringThe short name or full Amazon Resource Name (ARN) of the cluster that hosts the service to create the task set in.
servicestringThe short name or full Amazon Resource Name (ARN) of the service to create the task set in.
regionstringAWS region.

For more information, see AWS::ECS::PrimaryTaskSet.

Methods

NameAccessible byRequired Params
create_resourceINSERTCluster, Service, TaskSetId, region
update_resourceUPDATEIdentifier, PatchDocument, region
get_resourceSELECTIdentifier, 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.

/*+ 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
;

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:

ParameterDescription
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:

ecs:DescribeTaskSets,
ecs:UpdateServicePrimaryTaskSet