cluster_capacity_provider_associations
Creates, updates, deletes or gets a cluster_capacity_provider_association resource or lists cluster_capacity_provider_associations in a region
Overview
| Name | cluster_capacity_provider_associations |
| Type | Resource |
| Description | Associate a set of ECS Capacity Providers with a specified ECS Cluster |
| Id | awscc.ecs.cluster_capacity_provider_associations |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
default_capacity_provider_strategy | array | List of capacity providers to associate with the cluster |
capacity_providers | array | List of capacity providers to associate with the cluster |
cluster | string | The name of the cluster |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
cluster | string | The name of the cluster |
region | string | AWS region. |
For more information, see AWS::ECS::ClusterCapacityProviderAssociations.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | cluster_capacity_provider_associations | INSERT | CapacityProviders, Cluster, DefaultCapacityProviderStrategy, region |
delete_resource | cluster_capacity_provider_associations | DELETE | Identifier, region |
update_resource | cluster_capacity_provider_associations | UPDATE | Identifier, PatchDocument, region |
list_resources | cluster_capacity_provider_associations_list_only | SELECT | region |
get_resource | cluster_capacity_provider_associations | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual cluster_capacity_provider_association.
SELECT
region,
default_capacity_provider_strategy,
capacity_providers,
cluster
FROM awscc.ecs.cluster_capacity_provider_associations
WHERE
region = '{{ region }}' AND
Identifier = '{{ cluster }}';
Lists all cluster_capacity_provider_associations in a region.
SELECT
region,
cluster
FROM awscc.ecs.cluster_capacity_provider_associations_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new cluster_capacity_provider_association resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.ecs.cluster_capacity_provider_associations (
DefaultCapacityProviderStrategy,
CapacityProviders,
Cluster,
region
)
SELECT
'{{ default_capacity_provider_strategy }}',
'{{ capacity_providers }}',
'{{ cluster }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.ecs.cluster_capacity_provider_associations (
DefaultCapacityProviderStrategy,
CapacityProviders,
Cluster,
region
)
SELECT
'{{ default_capacity_provider_strategy }}',
'{{ capacity_providers }}',
'{{ cluster }}',
'{{ 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: cluster_capacity_provider_association
props:
- name: default_capacity_provider_strategy
value:
- capacity_provider: '{{ capacity_provider }}'
base: '{{ base }}'
weight: '{{ weight }}'
- name: capacity_providers
value:
- null
- name: cluster
value: '{{ cluster }}'
UPDATE example
Use the following StackQL query and manifest file to update a cluster_capacity_provider_association resource, using stack-deploy.
/*+ update */
UPDATE awscc.ecs.cluster_capacity_provider_associations
SET PatchDocument = string('{{ {
"DefaultCapacityProviderStrategy": default_capacity_provider_strategy,
"CapacityProviders": capacity_providers
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ cluster }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.ecs.cluster_capacity_provider_associations
WHERE
Identifier = '{{ cluster }}' 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 cluster_capacity_provider_associations resource, the following permissions are required:
- Read
- Create
- Update
- List
- Delete
ecs:DescribeClusters
ecs:DescribeClusters,
ecs:PutClusterCapacityProviders,
ecs:DescribeCapacityProviders
ecs:DescribeClusters,
ecs:PutClusterCapacityProviders
ecs:DescribeClusters,
ecs:ListClusters
ecs:PutClusterCapacityProviders,
ecs:DescribeClusters