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 | aws.pcs.compute_node_groups |
Fields
Name | Datatype | Description |
---|---|---|
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. |
arn | string | The unique Amazon Resource Name (ARN) of the compute node group. |
cluster_id | string | The ID of the cluster of the compute node group. |
custom_launch_template | object | An Amazon EC2 launch template AWS PCS uses to launch compute nodes. |
error_info | array | The list of errors that occurred during compute node group provisioning. |
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. |
id | string | The generated unique ID of the compute node group. |
instance_configs | array | A list of EC2 instance configurations that AWS PCS can provision in the compute node group. |
name | string | The name that identifies 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. |
scaling_configuration | object | Specifies the boundaries of the compute node group auto scaling. |
slurm_configuration | object | Additional options related to the Slurm scheduler. |
spot_options | object | Additional configuration when you specify SPOT as the purchase option. |
status | string | The provisioning status of the compute node group. The provisioning status doesn't indicate the overall health of the compute node group. |
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. |
tags |
| 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. |
For more information, see AWS::PCS::ComputeNodeGroup
.
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | ClusterId, CustomLaunchTemplate, IamInstanceProfileArn, InstanceConfigs, ScalingConfiguration, SubnetIds, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.pcs.compute_node_groups (
ClusterId,
CustomLaunchTemplate,
IamInstanceProfileArn,
InstanceConfigs,
ScalingConfiguration,
SubnetIds,
region
)
SELECT
'{{ ClusterId }}',
'{{ CustomLaunchTemplate }}',
'{{ IamInstanceProfileArn }}',
'{{ InstanceConfigs }}',
'{{ ScalingConfiguration }}',
'{{ SubnetIds }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.pcs.compute_node_groups (
AmiId,
ClusterId,
CustomLaunchTemplate,
IamInstanceProfileArn,
InstanceConfigs,
Name,
PurchaseOption,
ScalingConfiguration,
SlurmConfiguration,
SpotOptions,
SubnetIds,
Tags,
region
)
SELECT
'{{ AmiId }}',
'{{ ClusterId }}',
'{{ CustomLaunchTemplate }}',
'{{ IamInstanceProfileArn }}',
'{{ InstanceConfigs }}',
'{{ Name }}',
'{{ PurchaseOption }}',
'{{ ScalingConfiguration }}',
'{{ SlurmConfiguration }}',
'{{ SpotOptions }}',
'{{ SubnetIds }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: compute_node_group
props:
- name: AmiId
value: '{{ AmiId }}'
- name: ClusterId
value: '{{ ClusterId }}'
- name: CustomLaunchTemplate
value:
Id: '{{ Id }}'
Version: '{{ Version }}'
- name: IamInstanceProfileArn
value: '{{ IamInstanceProfileArn }}'
- name: InstanceConfigs
value:
- InstanceType: '{{ InstanceType }}'
- name: Name
value: '{{ Name }}'
- name: PurchaseOption
value: '{{ PurchaseOption }}'
- name: ScalingConfiguration
value:
MaxInstanceCount: '{{ MaxInstanceCount }}'
MinInstanceCount: '{{ MinInstanceCount }}'
- name: SlurmConfiguration
value:
SlurmCustomSettings:
- ParameterName: '{{ ParameterName }}'
ParameterValue: '{{ ParameterValue }}'
- name: SpotOptions
value:
AllocationStrategy: '{{ AllocationStrategy }}'
- name: SubnetIds
value:
- '{{ SubnetIds[0] }}'
- name: Tags
value: null
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