task_sets
Creates, updates, deletes or gets a task_set resource or lists task_sets in a region
Overview
| Name | task_sets |
| Type | Resource |
| Description | Create a task set in the specified cluster and service. This is used when a service uses the EXTERNAL deployment controller type. For more information, see https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.htmlin the Amazon Elastic Container Service Developer Guide. |
| Id | awscc.ecs.task_sets |
Fields
| Name | Datatype | Description |
|---|---|---|
platform_version | string | The platform version that the tasks in the task set should use. A platform version is specified only for tasks using the Fargate launch type. If one isn't specified, the LATEST platform version is used by default. |
external_id | string | An optional non-unique tag that identifies this task set in external systems. If the task set is associated with a service discovery registry, the tasks in this task set will have the ECS_TASK_SET_EXTERNAL_ID AWS Cloud Map attribute set to the provided value. |
cluster | string | The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service to create the task set in. |
load_balancers | array | |
service | string | The short name or full Amazon Resource Name (ARN) of the service to create the task set in. |
scale | object | A floating-point percentage of the desired number of tasks to place and keep running in the task set. |
service_registries | array | The details of the service discovery registries to assign to this task set. For more information, see https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html. |
capacity_provider_strategy | array | |
launch_type | string | The launch type that new tasks in the task set will use. For more information, see https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html in the Amazon Elastic Container Service Developer Guide. |
task_definition | string | The short name or full Amazon Resource Name (ARN) of the task definition for the tasks in the task set to use. |
network_configuration | object | An object representing the network configuration for a task or service. |
id | string | The ID of the task set. |
tags | array | |
region | string | AWS region. |
For more information, see AWS::ECS::TaskSet.
Methods
| Name | Accessible by | Required Params |
|---|---|---|
create_resource | INSERT | Cluster, Service, TaskDefinition, region |
delete_resource | DELETE | Identifier, region |
update_resource | UPDATE | Identifier, PatchDocument, region |
get_resource | SELECT | Identifier, region |
SELECT examples
Gets all properties from an individual task_set.
SELECT
region,
platform_version,
external_id,
cluster,
load_balancers,
service,
scale,
service_registries,
capacity_provider_strategy,
launch_type,
task_definition,
network_configuration,
id,
tags
FROM awscc.ecs.task_sets
WHERE
region = '{{ region }}' AND
Identifier = '{{ cluster }}|{{ service }}|{{ id }}';
INSERT example
Use the following StackQL query and manifest file to create a new task_set resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.ecs.task_sets (
Cluster,
Service,
TaskDefinition,
region
)
SELECT
'{{ cluster }}',
'{{ service }}',
'{{ task_definition }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.ecs.task_sets (
PlatformVersion,
ExternalId,
Cluster,
LoadBalancers,
Service,
Scale,
ServiceRegistries,
CapacityProviderStrategy,
LaunchType,
TaskDefinition,
NetworkConfiguration,
Tags,
region
)
SELECT
'{{ platform_version }}',
'{{ external_id }}',
'{{ cluster }}',
'{{ load_balancers }}',
'{{ service }}',
'{{ scale }}',
'{{ service_registries }}',
'{{ capacity_provider_strategy }}',
'{{ launch_type }}',
'{{ task_definition }}',
'{{ network_configuration }}',
'{{ 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_set
props:
- name: platform_version
value: '{{ platform_version }}'
- name: external_id
value: '{{ external_id }}'
- name: cluster
value: '{{ cluster }}'
- name: load_balancers
value:
- target_group_arn: '{{ target_group_arn }}'
container_name: '{{ container_name }}'
container_port: '{{ container_port }}'
- name: service
value: '{{ service }}'
- name: scale
value:
value: null
unit: '{{ unit }}'
- name: service_registries
value:
- container_name: '{{ container_name }}'
port: '{{ port }}'
container_port: '{{ container_port }}'
registry_arn: '{{ registry_arn }}'
- name: capacity_provider_strategy
value:
- capacity_provider: '{{ capacity_provider }}'
base: '{{ base }}'
weight: '{{ weight }}'
- name: launch_type
value: '{{ launch_type }}'
- name: task_definition
value: '{{ task_definition }}'
- name: network_configuration
value:
aws_vpc_configuration:
security_groups:
- '{{ security_groups[0] }}'
subnets:
- '{{ subnets[0] }}'
assign_public_ip: '{{ assign_public_ip }}'
- name: tags
value:
- value: '{{ value }}'
key: '{{ key }}'
UPDATE example
Use the following StackQL query and manifest file to update a task_set resource, using stack-deploy.
/*+ update */
UPDATE awscc.ecs.task_sets
SET PatchDocument = string('{{ {
"Scale": scale,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ cluster }}|{{ service }}|{{ id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.ecs.task_sets
WHERE
Identifier = '{{ cluster }}|{{ service }}|{{ 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_sets resource, the following permissions are required:
- Read
- Create
- Update
- Delete
ecs:DescribeTaskSets
ecs:CreateTaskSet,
ecs:DescribeTaskSets,
ecs:TagResource
ecs:DescribeTaskSets,
ecs:TagResource,
ecs:UntagResource,
ecs:UpdateTaskSet
ecs:DeleteTaskSet,
ecs:DescribeTaskSets