Skip to main content

compute_node_groups

Creates, updates, deletes or gets a compute_node_group resource or lists compute_node_groups in a region

Overview

Namecompute_node_groups
TypeResource
DescriptionAWS::PCS::ComputeNodeGroup resource creates an AWS PCS compute node group.
Idaws.pcs.compute_node_groups

Fields

NameDatatypeDescription
ami_idstringThe 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.
arnstringThe unique Amazon Resource Name (ARN) of the compute node group.
cluster_idstringThe ID of the cluster of the compute node group.
custom_launch_templateobjectAn Amazon EC2 launch template AWS PCS uses to launch compute nodes.
error_infoarrayThe list of errors that occurred during compute node group provisioning.
iam_instance_profile_arnstringThe 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.
idstringThe generated unique ID of the compute node group.
instance_configsarrayA list of EC2 instance configurations that AWS PCS can provision in the compute node group.
namestringThe name that identifies the compute node group.
purchase_optionstringSpecifies 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.
scaling_configurationobjectSpecifies the boundaries of the compute node group auto scaling.
slurm_configurationobjectAdditional options related to the Slurm scheduler.
spot_optionsobjectAdditional configuration when you specify SPOT as the purchase option.
statusstringThe provisioning status of the compute node group. The provisioning status doesn't indicate the overall health of the compute node group.
subnet_idsarrayThe list of subnet IDs where instances are provisioned by the compute node group. The subnets must be in the same VPC as the cluster.
tags1 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.
regionstringAWS region.

For more information, see AWS::PCS::ComputeNodeGroup.

Methods

NameAccessible byRequired Params
create_resourceINSERTClusterId, CustomLaunchTemplate, IamInstanceProfileArn, InstanceConfigs, ScalingConfiguration, SubnetIds, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all compute_node_groups in a region.

SELECT
region,
ami_id,
arn,
cluster_id,
custom_launch_template,
error_info,
iam_instance_profile_arn,
id,
instance_configs,
name,
purchase_option,
scaling_configuration,
slurm_configuration,
spot_options,
status,
subnet_ids,
tags
FROM aws.pcs.compute_node_groups
WHERE region = 'us-east-1';

Gets all properties from an individual compute_node_group.

SELECT
region,
ami_id,
arn,
cluster_id,
custom_launch_template,
error_info,
iam_instance_profile_arn,
id,
instance_configs,
name,
purchase_option,
scaling_configuration,
slurm_configuration,
spot_options,
status,
subnet_ids,
tags
FROM aws.pcs.compute_node_groups
WHERE region = 'us-east-1' AND data__Identifier = '<Arn>';

INSERT example

Use the following StackQL query and manifest file to create a new compute_node_group resource, using stack-deploy.

/*+ create */
INSERT INTO aws.pcs.compute_node_groups (
ClusterId,
CustomLaunchTemplate,
IamInstanceProfileArn,
InstanceConfigs,
ScalingConfiguration,
SubnetIds,
region
)
SELECT
'{{ ClusterId }}',
'{{ CustomLaunchTemplate }}',
'{{ IamInstanceProfileArn }}',
'{{ InstanceConfigs }}',
'{{ ScalingConfiguration }}',
'{{ SubnetIds }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.pcs.compute_node_groups
WHERE data__Identifier = '<Arn>'
AND region = 'us-east-1';

Permissions

To operate on the compute_node_groups resource, the following permissions are required:

Create

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

Read

pcs:GetComputeNodeGroup,
pcs:ListTagsForResource

Update

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

Delete

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

List

pcs:ListClusters,
pcs:ListComputeNodeGroups