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 | aws.ecs.task_sets |
Fields
Name | Datatype | Description |
---|---|---|
cluster | string | The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service to create the task set in. |
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. |
id | string | The ID of the task set. |
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. |
load_balancers | array | |
network_configuration | object | An object representing the network configuration for a task or service. |
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. |
scale | object | A floating-point percentage of the desired number of tasks to place and keep running in the task set. |
service | string | The short name or full Amazon Resource Name (ARN) of the service to create the task set in. |
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. |
tags | array | |
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. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | Cluster, Service, TaskDefinition, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all properties from an individual task_set
.
SELECT
region,
cluster,
external_id,
id,
launch_type,
load_balancers,
network_configuration,
platform_version,
scale,
service,
service_registries,
tags,
task_definition
FROM aws.ecs.task_sets
WHERE region = 'us-east-1' AND data__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 aws.ecs.task_sets (
Cluster,
Service,
TaskDefinition,
region
)
SELECT
'{{ Cluster }}',
'{{ Service }}',
'{{ TaskDefinition }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.ecs.task_sets (
Cluster,
ExternalId,
LaunchType,
LoadBalancers,
NetworkConfiguration,
PlatformVersion,
Scale,
Service,
ServiceRegistries,
Tags,
TaskDefinition,
region
)
SELECT
'{{ Cluster }}',
'{{ ExternalId }}',
'{{ LaunchType }}',
'{{ LoadBalancers }}',
'{{ NetworkConfiguration }}',
'{{ PlatformVersion }}',
'{{ Scale }}',
'{{ Service }}',
'{{ ServiceRegistries }}',
'{{ Tags }}',
'{{ TaskDefinition }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: task_set
props:
- name: Cluster
value: '{{ Cluster }}'
- name: ExternalId
value: '{{ ExternalId }}'
- name: LaunchType
value: '{{ LaunchType }}'
- name: LoadBalancers
value:
- ContainerName: '{{ ContainerName }}'
ContainerPort: '{{ ContainerPort }}'
TargetGroupArn: '{{ TargetGroupArn }}'
- name: NetworkConfiguration
value:
AwsVpcConfiguration:
AssignPublicIp: '{{ AssignPublicIp }}'
SecurityGroups:
- '{{ SecurityGroups[0] }}'
Subnets:
- '{{ Subnets[0] }}'
- name: PlatformVersion
value: '{{ PlatformVersion }}'
- name: Scale
value:
Unit: '{{ Unit }}'
Value: null
- name: Service
value: '{{ Service }}'
- name: ServiceRegistries
value:
- ContainerName: '{{ ContainerName }}'
ContainerPort: '{{ ContainerPort }}'
Port: '{{ Port }}'
RegistryArn: '{{ RegistryArn }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
- name: TaskDefinition
value: '{{ TaskDefinition }}'
DELETE
example
/*+ delete */
DELETE FROM aws.ecs.task_sets
WHERE data__Identifier = '<Cluster|Service|Id>'
AND region = 'us-east-1';
Permissions
To operate on the task_sets
resource, the following permissions are required:
Create
ecs:CreateTaskSet,
ecs:DescribeTaskSets,
ecs:TagResource
Read
ecs:DescribeTaskSets
Update
ecs:DescribeTaskSets,
ecs:TagResource,
ecs:UntagResource,
ecs:UpdateTaskSet
Delete
ecs:DeleteTaskSet,
ecs:DescribeTaskSets