clusters
Creates, updates, deletes or gets a cluster resource or lists clusters in a region
Overview
| Name | clusters |
| Type | Resource |
| Description | AWS::PCS::Cluster resource creates an AWS PCS cluster. |
| Id | awscc.pcs.clusters |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
arn | string | The unique Amazon Resource Name (ARN) of the cluster. |
endpoints | array | The list of endpoints available for interaction with the scheduler. |
error_info | array | The list of errors that occurred during cluster provisioning. |
id | string | The generated unique ID of the cluster. |
name | string | The name that identifies the cluster. |
networking | object | The networking configuration for the cluster's control plane. |
scheduler | object | The cluster management and job scheduling software associated with the cluster. |
size | string | The size of the cluster. |
slurm_configuration | object | Additional options related to the Slurm scheduler. |
status | string | The provisioning status of the cluster. The provisioning status doesn't indicate the overall health of the cluster. |
tags | object | 1 or more tags added to the resource. Each tag consists of a tag key and tag value. The tag value is optional and can be an empty string. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
arn | string | The unique Amazon Resource Name (ARN) of the cluster. |
region | string | AWS region. |
For more information, see AWS::PCS::Cluster.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | clusters | INSERT | Networking, Scheduler, Size, region |
delete_resource | clusters | DELETE | Identifier, region |
update_resource | clusters | UPDATE | Identifier, PatchDocument, region |
list_resources | clusters_list_only | SELECT | region |
get_resource | clusters | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual cluster.
SELECT
region,
arn,
endpoints,
error_info,
id,
name,
networking,
scheduler,
size,
slurm_configuration,
status,
tags
FROM awscc.pcs.clusters
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';
Lists all clusters in a region.
SELECT
region,
arn
FROM awscc.pcs.clusters_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new cluster resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.pcs.clusters (
Networking,
Scheduler,
Size,
region
)
SELECT
'{{ networking }}',
'{{ scheduler }}',
'{{ size }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.pcs.clusters (
Name,
Networking,
Scheduler,
Size,
SlurmConfiguration,
Tags,
region
)
SELECT
'{{ name }}',
'{{ networking }}',
'{{ scheduler }}',
'{{ size }}',
'{{ slurm_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: cluster
props:
- name: name
value: '{{ name }}'
- name: networking
value:
security_group_ids:
- '{{ security_group_ids[0] }}'
subnet_ids:
- '{{ subnet_ids[0] }}'
network_type: '{{ network_type }}'
- name: scheduler
value:
type: '{{ type }}'
version: '{{ version }}'
- name: size
value: '{{ size }}'
- name: slurm_configuration
value:
accounting:
default_purge_time_in_days: '{{ default_purge_time_in_days }}'
mode: '{{ mode }}'
auth_key:
secret_arn: '{{ secret_arn }}'
secret_version: '{{ secret_version }}'
scale_down_idle_time_in_seconds: '{{ scale_down_idle_time_in_seconds }}'
slurm_custom_settings:
- parameter_value: '{{ parameter_value }}'
parameter_name: '{{ parameter_name }}'
- name: tags
value: null
UPDATE example
Use the following StackQL query and manifest file to update a cluster resource, using stack-deploy.
/*+ update */
UPDATE awscc.pcs.clusters
SET PatchDocument = string('{{ {
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.pcs.clusters
WHERE
Identifier = '{{ arn }}' 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 clusters resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
ec2:CreateNetworkInterface,
ec2:DescribeVpcs,
ec2:DescribeSubnets,
ec2:DescribeSecurityGroups,
ec2:GetSecurityGroupsForVpc,
iam:CreateServiceLinkedRole,
secretsmanager:CreateSecret,
secretsmanager:TagResource,
pcs:CreateCluster,
pcs:GetCluster,
pcs:ListTagsForResource,
pcs:TagResource
pcs:GetCluster,
pcs:ListTagsForResource
pcs:GetCluster,
pcs:ListTagsForResource,
pcs:TagResource,
pcs:UntagResource
pcs:DeleteCluster,
pcs:GetCluster
pcs:ListClusters