compute_node_groups
Creates, updates, deletes or gets a compute_node_group resource or lists compute_node_groups in a region
Overview
| Name | compute_node_groups |
| Type | Resource |
| Description | AWS::PCS::ComputeNodeGroup resource creates an AWS PCS compute node group. |
| Id | awscc.pcs.compute_node_groups |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
status | string | The provisioning status of the compute node group. The provisioning status doesn't indicate the overall health of the compute node group. |
cluster_id | string | The ID of the cluster of the compute node group. |
error_info | array | The list of errors that occurred during compute node group provisioning. |
spot_options | object | Additional configuration when you specify SPOT as the purchase option. |
slurm_configuration | object | Additional options related to the Slurm scheduler. |
subnet_ids | array | The list of subnet IDs where instances are provisioned by the compute node group. The subnets must be in the same VPC as the cluster. |
name | string | The name that identifies the compute node group. |
scaling_configuration | object | Specifies the boundaries of the compute node group auto scaling. |
instance_configs | array | A list of EC2 instance configurations that AWS PCS can provision in the compute node group. |
id | string | The generated unique ID of the compute node group. |
purchase_option | string | Specifies how EC2 instances are purchased on your behalf. AWS PCS supports On-Demand and Spot instances. For more information, see Instance purchasing options in the Amazon Elastic Compute Cloud User Guide. If you don't provide this option, it defaults to On-Demand. |
arn | string | The unique Amazon Resource Name (ARN) of the compute node group. |
custom_launch_template | object | An Amazon EC2 launch template AWS PCS uses to launch compute nodes. |
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. |
ami_id | string | The ID of the Amazon Machine Image (AMI) that AWS PCS uses to launch instances. If not provided, AWS PCS uses the AMI ID specified in the custom launch template. |
iam_instance_profile_arn | string | The Amazon Resource Name (ARN) of the IAM instance profile used to pass an IAM role when launching EC2 instances. The role contained in your instance profile must have pcs:RegisterComputeNodeGroupInstance permissions attached to provision instances correctly. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
arn | string | The unique Amazon Resource Name (ARN) of the compute node group. |
region | string | AWS region. |
For more information, see AWS::PCS::ComputeNodeGroup.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | compute_node_groups | INSERT | ClusterId, CustomLaunchTemplate, IamInstanceProfileArn, InstanceConfigs, ScalingConfiguration, SubnetIds, region |
delete_resource | compute_node_groups | DELETE | Identifier, region |
update_resource | compute_node_groups | UPDATE | Identifier, PatchDocument, region |
list_resources | compute_node_groups_list_only | SELECT | region |
get_resource | compute_node_groups | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual compute_node_group.
SELECT
region,
status,
cluster_id,
error_info,
spot_options,
slurm_configuration,
subnet_ids,
name,
scaling_configuration,
instance_configs,
id,
purchase_option,
arn,
custom_launch_template,
tags,
ami_id,
iam_instance_profile_arn
FROM awscc.pcs.compute_node_groups
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';
Lists all compute_node_groups in a region.
SELECT
region,
arn
FROM awscc.pcs.compute_node_groups_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new compute_node_group resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.pcs.compute_node_groups (
ClusterId,
SubnetIds,
ScalingConfiguration,
InstanceConfigs,
CustomLaunchTemplate,
IamInstanceProfileArn,
region
)
SELECT
'{{ cluster_id }}',
'{{ subnet_ids }}',
'{{ scaling_configuration }}',
'{{ instance_configs }}',
'{{ custom_launch_template }}',
'{{ iam_instance_profile_arn }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.pcs.compute_node_groups (
ClusterId,
SpotOptions,
SlurmConfiguration,
SubnetIds,
Name,
ScalingConfiguration,
InstanceConfigs,
PurchaseOption,
CustomLaunchTemplate,
Tags,
AmiId,
IamInstanceProfileArn,
region
)
SELECT
'{{ cluster_id }}',
'{{ spot_options }}',
'{{ slurm_configuration }}',
'{{ subnet_ids }}',
'{{ name }}',
'{{ scaling_configuration }}',
'{{ instance_configs }}',
'{{ purchase_option }}',
'{{ custom_launch_template }}',
'{{ tags }}',
'{{ ami_id }}',
'{{ iam_instance_profile_arn }}',
'{{ 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: compute_node_group
props:
- name: cluster_id
value: '{{ cluster_id }}'
- name: spot_options
value:
allocation_strategy: '{{ allocation_strategy }}'
- name: slurm_configuration
value:
slurm_custom_settings:
- parameter_value: '{{ parameter_value }}'
parameter_name: '{{ parameter_name }}'
- name: subnet_ids
value:
- '{{ subnet_ids[0] }}'
- name: name
value: '{{ name }}'
- name: scaling_configuration
value:
max_instance_count: '{{ max_instance_count }}'
min_instance_count: '{{ min_instance_count }}'
- name: instance_configs
value:
- instance_type: '{{ instance_type }}'
- name: purchase_option
value: '{{ purchase_option }}'
- name: custom_launch_template
value:
version: '{{ version }}'
template_id: '{{ template_id }}'
- name: tags
value: null
- name: ami_id
value: '{{ ami_id }}'
- name: iam_instance_profile_arn
value: '{{ iam_instance_profile_arn }}'
UPDATE example
Use the following StackQL query and manifest file to update a compute_node_group resource, using stack-deploy.
/*+ update */
UPDATE awscc.pcs.compute_node_groups
SET PatchDocument = string('{{ {
"SpotOptions": spot_options,
"SlurmConfiguration": slurm_configuration,
"SubnetIds": subnet_ids,
"ScalingConfiguration": scaling_configuration,
"PurchaseOption": purchase_option,
"CustomLaunchTemplate": custom_launch_template,
"Tags": tags,
"AmiId": ami_id,
"IamInstanceProfileArn": iam_instance_profile_arn
} | 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.compute_node_groups
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 compute_node_groups resource, the following permissions are required:
- Read
- Create
- Update
- List
- Delete
pcs:GetComputeNodeGroup,
pcs:ListTagsForResource
ec2:DescribeImages,
ec2:DescribeVpcs,
ec2:DescribeSubnets,
ec2:DescribeSecurityGroups,
ec2:DescribeLaunchTemplates,
ec2:DescribeLaunchTemplateVersions,
ec2:DescribeInstanceTypes,
ec2:DescribeInstanceTypeOfferings,
ec2:RunInstances,
ec2:CreateFleet,
ec2:CreateTags,
iam:PassRole,
iam:GetInstanceProfile,
pcs:CreateComputeNodeGroup,
pcs:GetComputeNodeGroup,
pcs:ListTagsForResource,
pcs:TagResource
ec2:DescribeImages,
ec2:DescribeVpcs,
ec2:DescribeSubnets,
ec2:DescribeSecurityGroups,
ec2:DescribeLaunchTemplates,
ec2:DescribeLaunchTemplateVersions,
ec2:DescribeInstanceTypes,
ec2:DescribeInstanceTypeOfferings,
ec2:RunInstances,
ec2:CreateFleet,
ec2:CreateTags,
iam:PassRole,
iam:GetInstanceProfile,
pcs:GetComputeNodeGroup,
pcs:UpdateComputeNodeGroup,
pcs:ListTagsForResource,
pcs:TagResource,
pcs:UntagResource
pcs:ListClusters,
pcs:ListComputeNodeGroups
ec2:DescribeImages,
ec2:DescribeVpcs,
ec2:DescribeSubnets,
ec2:DescribeSecurityGroups,
ec2:DescribeLaunchTemplates,
ec2:DescribeLaunchTemplateVersions,
ec2:DescribeInstanceTypes,
ec2:DescribeInstanceTypeOfferings,
ec2:TerminateInstances,
ec2:CreateFleet,
ec2:CreateTags,
iam:PassRole,
iam:GetInstanceProfile,
pcs:GetComputeNodeGroup,
pcs:DeleteComputeNodeGroup,
pcs:ListTagsForResource,
pcs:TagResource,
pcs:UntagResource