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 = 'us-east-1' AND
Identifier = '{{ arn }}';
Lists all clusters in a region.
SELECT
region,
arn
FROM awscc.pcs.clusters_list_only
WHERE
region = 'us-east-1';
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 }}';
/*+ create */
INSERT INTO awscc.pcs.clusters (
Name,
Networking,
Scheduler,
Size,
SlurmConfiguration,
Tags,
region
)
SELECT
'{{ name }}',
'{{ networking }}',
'{{ scheduler }}',
'{{ size }}',
'{{ slurm_configuration }}',
'{{ tags }}',
'{{ region }}';
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 }}';
DELETE example
/*+ delete */
DELETE FROM awscc.pcs.clusters
WHERE
Identifier = '{{ arn }}' AND
region = 'us-east-1';
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