<a id="cli-aws-pcs-update-compute-node-group"></a>

# update-compute-node-group

## Description

Updates a compute node group. You can update many of the fields related to your compute node group including the configurations for networking, compute nodes, and settings specific to your scheduler (such as Slurm).

See also: [AWS API Documentation](https://docs.aws.amazon.com/goto/WebAPI/pcs-2023-02-10/UpdateComputeNodeGroup)

## Synopsis

```
  update-compute-node-group
--cluster-identifier <value>
--compute-node-group-identifier <value>
[--ami-id <value>]
[--subnet-ids <value>]
[--custom-launch-template <value>]
[--purchase-option <value>]
[--spot-options <value>]
[--scaling-configuration <value>]
[--iam-instance-profile-arn <value>]
[--slurm-configuration <value>]
[--node-lifecycle-actions <value>]
[--client-token <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]
[--cli-error-format <value>]
```

## Options

`--cluster-identifier` (string) [required]

> The name or ID of the cluster of the compute node group.

> Constraints:

> * pattern: `(pcs_[a-zA-Z0-9]+|[A-Za-z][A-Za-z0-9-]{2,40})`

`--compute-node-group-identifier` (string) [required]

> The name or ID of the compute node group.

> Constraints:

> * pattern: `(pcs_[a-zA-Z0-9]+|[A-Za-z][A-Za-z0-9-]{2,25})`

`--ami-id` (string)

> The ID of the Amazon Machine Image (AMI) that PCS uses to launch instances. If not provided, PCS uses the AMI ID specified in the custom launch template.

> Constraints:

> * pattern: `ami-[a-z0-9]+`

`--subnet-ids` (list)

> The list of subnet IDs where the compute node group provisions instances. The subnets must be in the same VPC as the cluster.

> (string)

Syntax:

```
"string" "string" ...
```

`--custom-launch-template` (structure)

> An Amazon EC2 launch template PCS uses to launch compute nodes.

> id -> (string) [required]

> > The ID of the EC2 launch template to use to provision instances.

> > Example: `lt-xxxx`

> version -> (string) [required]

> > The version of the EC2 launch template to use to provision instances.

Shorthand Syntax:

```
id=string,version=string
```

JSON Syntax:

```json
{
  "id": "string",
  "version": "string"
}
```

`--purchase-option` (string)

> Specifies how EC2 instances are purchased on your behalf. PCS supports On-Demand Instances, Spot Instances, Interruptible Capacity Reservations, On-Demand Capacity Reservations, and Amazon EC2 Capacity Blocks for ML. For more information, see [Amazon EC2 billing and purchasing options](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-purchasing-options.html) in the *Amazon Elastic Compute Cloud User Guide* . For more information about PCS support for Capacity Blocks, see [Using Amazon EC2 Capacity Blocks for ML with PCS](https://docs.aws.amazon.com/pcs/latest/userguide/capacity-blocks.html) in the *PCS User Guide* . For more information about PCS support for interruptible capacity reservations, see [Using I-ODCRs with PCS](https://docs.aws.amazon.com/pcs/latest/userguide/capacity-reservations-iodcr.html) in the *PCS User Guide* . Choose On-Demand if you plan to use an On-Demand Capacity Reservation (ODCR). For more information, see [Using ODCRs with PCS](https://docs.aws.amazon.com/pcs/latest/userguide/capacity-reservations-odcr.html) . If you don’t provide this option, it defaults to On-Demand.

> Possible values:

> * `ONDEMAND`
> * `SPOT`
> * `CAPACITY_BLOCK`
> * `INTERRUPTIBLE_CAPACITY_RESERVATION`

`--spot-options` (structure)

> Additional configuration when you specify `SPOT` as the `purchaseOption` for the `CreateComputeNodeGroup` API action.

> allocationStrategy -> (string)

> > The Amazon EC2 allocation strategy PCS uses to provision EC2 instances. PCS supports **lowest price** , **capacity optimized** , and **price capacity optimized** . For more information, see [Use allocation strategies to determine how EC2 Fleet or Spot Fleet fulfills Spot and On-Demand capacity](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-allocation-strategy.html) in the *Amazon Elastic Compute Cloud User Guide* . If you don’t provide this option, it defaults to **price capacity optimized** .

> > Possible values:

> > * `lowest-price`
> > * `capacity-optimized`
> > * `price-capacity-optimized`

Shorthand Syntax:

```
allocationStrategy=string
```

JSON Syntax:

```json
{
  "allocationStrategy": "lowest-price"|"capacity-optimized"|"price-capacity-optimized"
}
```

`--scaling-configuration` (structure)

> Specifies the boundaries of the compute node group auto scaling.

> minInstanceCount -> (integer) [required]

> > The lower bound of the number of instances allowed in the compute fleet.

> > Constraints:

> > * min: `0`

> maxInstanceCount -> (integer) [required]

> > The upper bound of the number of instances allowed in the compute fleet.

> > Constraints:

> > * min: `0`

Shorthand Syntax:

```
minInstanceCount=integer,maxInstanceCount=integer
```

JSON Syntax:

```json
{
  "minInstanceCount": integer,
  "maxInstanceCount": integer
}
```

`--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 the `pcs:RegisterComputeNodeGroupInstance` permission and the role name must start with `AWSPCS` or must have the path `/aws-pcs/` . For more information, see [IAM instance profiles for PCS](https://docs.aws.amazon.com/pcs/latest/userguide/security-instance-profiles.html) in the *PCS User Guide* .

> Constraints:

> * pattern: `arn:aws([a-zA-Z-]{0,10})?:iam::[0-9]{12}:instance-profile/([!-~]{1,510}/)?([\w+=,.@-]{1,128})`

`--slurm-configuration` (structure)

> Additional options related to the Slurm scheduler.

> scaleDownIdleTimeInSeconds -> (integer)

> > The time (in seconds) before an idle node is scaled down. If not specified, the cluster-level setting applies. This overrides the cluster-level `scaleDownIdleTimeInSeconds` setting. A value of `-1` removes the override and applies the cluster-level setting to this compute node group. Requires Slurm version 25.11 or later.

> > Constraints:

> > * min: `-1`
> > * max: `10000000`

> slurmCustomSettings -> (list)

> > Additional Slurm-specific configuration that directly maps to Slurm settings.

> > (structure)

> > > Additional settings that directly map to Slurm settings.

> > > #### WARNING
> > > PCS supports a subset of Slurm settings. For more information, see [Configuring custom Slurm settings in PCS](https://docs.aws.amazon.com/pcs/latest/userguide/slurm-custom-settings.html) in the *PCS User Guide* .

> > > parameterName -> (string) [required]

> > > > PCS supports custom Slurm settings for clusters, compute node groups, and queues. For more information, see [Configuring custom Slurm settings in PCS](https://docs.aws.amazon.com/pcs/latest/userguide/slurm-custom-settings.html) in the *PCS User Guide* .

> > > parameterValue -> (string) [required]

> > > > The values for the configured Slurm settings.

> gresCustomSettings -> (list)

> > The additional Slurm `gres.conf` records for the compute node group. Each item is a map of `gres.conf` attribute names to values that describes one `gres.conf` record, such as a GPU topology, MIG, MPS, or custom GRES entry. PCS adds the `NodeName=` prefix and merges these records with the GPU record it derives from the instance type.

> > (map)

> > > A single Slurm `gres.conf` record, expressed as a map of `gres.conf` attribute names to their values. For example, `{"Name": "gpu", "Type": "a100", "File": "/dev/nvidia[0-7]"}` or `{"AutoDetect": "nvml"}` . PCS adds the `NodeName=` prefix for the compute node group.

> > > #### WARNING
> > > PCS supports a subset of `gres.conf` settings. For more information, see [Configuring custom GRES settings in PCS](https://docs.aws.amazon.com/pcs/latest/userguide/gres-custom-settings.html) in the *PCS User Guide* .

> > > key -> (string)

> > > value -> (string)

Shorthand Syntax:

```
scaleDownIdleTimeInSeconds=integer,slurmCustomSettings=[{parameterName=string,parameterValue=string},{parameterName=string,parameterValue=string}],gresCustomSettings=[{KeyName1=string,KeyName2=string},{KeyName1=string,KeyName2=string}]
```

JSON Syntax:

```json
{
  "scaleDownIdleTimeInSeconds": integer,
  "slurmCustomSettings": [
    {
      "parameterName": "string",
      "parameterValue": "string"
    }
    ...
  ],
  "gresCustomSettings": [
    {"string": "string"
      ...}
    ...
  ]
}
```

`--node-lifecycle-actions` (structure)

> The lifecycle actions to run on compute nodes in the compute node group. Use lifecycle actions to run custom scripts at defined stages of a compute node’s lifecycle, such as when a compute node finishes bootstrapping or becomes ready to accept jobs.

> stages -> (structure) [required]

> > The lifecycle stages where you configure scripts to run.

> > nodeBootstrapped -> (list)

> > > The scripts to run after PCS finishes setting up the compute node and before the Slurm daemon (`slurmd` ) starts. Use this stage for tasks that must complete before the node accepts jobs, such as mounting shared storage, configuring networking, or installing software packages.

> > > Constraints:

> > > * min: `1`
> > > * max: `20`

> > > (structure)

> > > > A script to run during a compute node lifecycle stage.

> > > > name -> (string) [required]

> > > > > A unique name for the script. The name can be up to 64 characters long. Valid characters are letters, numbers, spaces, underscores (`_` ), and hyphens (`-` ). The first character must be a letter or a number.

> > > > > Constraints:

> > > > > * min: `1`
> > > > > * max: `64`
> > > > > * pattern: `[A-Za-z0-9][A-Za-z0-9 _-]*`

> > > > scriptSource -> (structure) [required]

> > > > > The source location and integrity information for the script.

> > > > > scriptLocation -> (string) [required]

> > > > > > The location of the script. Specify either an Amazon S3 URI in the format `s3://bucket-name/key` or an HTTPS URL.

> > > > > > Constraints:

> > > > > > * min: `1`
> > > > > > * max: `1024`
> > > > > > * pattern: `(s3://[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]/.+|https://([a-zA-Z0-9](?:[a-zA-Z0-9_-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}(?::[0-9]{1,5})?(?:[/?#][^\s]*)?)`

> > > > > s3VersionId -> (string)

> > > > > > The Amazon S3 version ID of the script. Use this value to pin the script to a specific version in a versioned Amazon S3 bucket. This value is only valid when `scriptLocation` is an Amazon S3 URI.

> > > > > > Constraints:

> > > > > > * min: `0`
> > > > > > * max: `1024`

> > > > > checksum -> (string)

> > > > > > The SHA-256 checksum of the script content, as a 64-character hexadecimal string. This value is optional. When specified, PCS uses this value to verify the integrity of the downloaded script.

> > > > > > Constraints:

> > > > > > * min: `64`
> > > > > > * max: `64`
> > > > > > * pattern: `[a-fA-F0-9]{64}`

> > > > arguments -> (list)

> > > > > The command-line arguments to pass to the script. You can specify up to 20 arguments, and each argument can be up to 256 characters long.

> > > > > Constraints:

> > > > > * min: `0`
> > > > > * max: `20`

> > > > > (string)

> > > > > > Constraints:

> > > > > > * min: `0`
> > > > > > * max: `256`

> > > > onError -> (string)

> > > > > The behavior when the script fails. The default value is `TERMINATE` . Valid values:

> > > > > * `TERMINATE` – Terminates the compute node.
> > > > > * `STOP_SEQUENCE` – Stops running subsequent scripts in the sequence but doesn’t terminate the compute node.
> > > > > * `CONTINUE` – Ignores the error and continues running the next script.

> > > > > Possible values:

> > > > > * `TERMINATE`
> > > > > * `STOP_SEQUENCE`
> > > > > * `CONTINUE`

> > > > executionPolicy -> (string)

> > > > > The policy that determines when the script runs. The default value is `FIRST_BOOT_ONLY` . Valid values:

> > > > > * `FIRST_BOOT_ONLY` – Runs the script only the first time the compute node boots.
> > > > > * `EVERY_BOOT` – Runs the script every time the compute node boots, including reboots.

> > > > > Possible values:

> > > > > * `FIRST_BOOT_ONLY`
> > > > > * `EVERY_BOOT`

> > nodeReady -> (list)

> > > The scripts to run after the Slurm daemon (`slurmd` ) starts and the compute node registers with the Slurm controller. Use this stage for tasks that require Slurm to be running, such as running Slurm commands.

> > > Constraints:

> > > * min: `1`
> > > * max: `20`

> > > (structure)

> > > > A script to run during a compute node lifecycle stage.

> > > > name -> (string) [required]

> > > > > A unique name for the script. The name can be up to 64 characters long. Valid characters are letters, numbers, spaces, underscores (`_` ), and hyphens (`-` ). The first character must be a letter or a number.

> > > > > Constraints:

> > > > > * min: `1`
> > > > > * max: `64`
> > > > > * pattern: `[A-Za-z0-9][A-Za-z0-9 _-]*`

> > > > scriptSource -> (structure) [required]

> > > > > The source location and integrity information for the script.

> > > > > scriptLocation -> (string) [required]

> > > > > > The location of the script. Specify either an Amazon S3 URI in the format `s3://bucket-name/key` or an HTTPS URL.

> > > > > > Constraints:

> > > > > > * min: `1`
> > > > > > * max: `1024`
> > > > > > * pattern: `(s3://[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]/.+|https://([a-zA-Z0-9](?:[a-zA-Z0-9_-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}(?::[0-9]{1,5})?(?:[/?#][^\s]*)?)`

> > > > > s3VersionId -> (string)

> > > > > > The Amazon S3 version ID of the script. Use this value to pin the script to a specific version in a versioned Amazon S3 bucket. This value is only valid when `scriptLocation` is an Amazon S3 URI.

> > > > > > Constraints:

> > > > > > * min: `0`
> > > > > > * max: `1024`

> > > > > checksum -> (string)

> > > > > > The SHA-256 checksum of the script content, as a 64-character hexadecimal string. This value is optional. When specified, PCS uses this value to verify the integrity of the downloaded script.

> > > > > > Constraints:

> > > > > > * min: `64`
> > > > > > * max: `64`
> > > > > > * pattern: `[a-fA-F0-9]{64}`

> > > > arguments -> (list)

> > > > > The command-line arguments to pass to the script. You can specify up to 20 arguments, and each argument can be up to 256 characters long.

> > > > > Constraints:

> > > > > * min: `0`
> > > > > * max: `20`

> > > > > (string)

> > > > > > Constraints:

> > > > > > * min: `0`
> > > > > > * max: `256`

> > > > onError -> (string)

> > > > > The behavior when the script fails. The default value is `TERMINATE` . Valid values:

> > > > > * `TERMINATE` – Terminates the compute node.
> > > > > * `STOP_SEQUENCE` – Stops running subsequent scripts in the sequence but doesn’t terminate the compute node.
> > > > > * `CONTINUE` – Ignores the error and continues running the next script.

> > > > > Possible values:

> > > > > * `TERMINATE`
> > > > > * `STOP_SEQUENCE`
> > > > > * `CONTINUE`

> > > > executionPolicy -> (string)

> > > > > The policy that determines when the script runs. The default value is `FIRST_BOOT_ONLY` . Valid values:

> > > > > * `FIRST_BOOT_ONLY` – Runs the script only the first time the compute node boots.
> > > > > * `EVERY_BOOT` – Runs the script every time the compute node boots, including reboots.

> > > > > Possible values:

> > > > > * `FIRST_BOOT_ONLY`
> > > > > * `EVERY_BOOT`

> scriptCachingPolicy -> (string)

> > The caching policy for node lifecycle scripts. The default value is `CACHE_ONCE` . Valid values:

> > * `CACHE_ONCE` – Downloads each script once and reuses it on subsequent boots.
> > * `REFRESH_ON_REBOOT` – Downloads each script on every boot.

> > Possible values:

> > * `CACHE_ONCE`
> > * `REFRESH_ON_REBOOT`

JSON Syntax:

```json
{
  "stages": {
    "nodeBootstrapped": [
      {
        "name": "string",
        "scriptSource": {
          "scriptLocation": "string",
          "s3VersionId": "string",
          "checksum": "string"
        },
        "arguments": ["string", ...],
        "onError": "TERMINATE"|"STOP_SEQUENCE"|"CONTINUE",
        "executionPolicy": "FIRST_BOOT_ONLY"|"EVERY_BOOT"
      }
      ...
    ],
    "nodeReady": [
      {
        "name": "string",
        "scriptSource": {
          "scriptLocation": "string",
          "s3VersionId": "string",
          "checksum": "string"
        },
        "arguments": ["string", ...],
        "onError": "TERMINATE"|"STOP_SEQUENCE"|"CONTINUE",
        "executionPolicy": "FIRST_BOOT_ONLY"|"EVERY_BOOT"
      }
      ...
    ]
  },
  "scriptCachingPolicy": "CACHE_ONCE"|"REFRESH_ON_REBOOT"
}
```

`--client-token` (string)

> A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect. If you don’t specify a client token, the CLI and SDK automatically generate 1 for you.

> Constraints:

> * min: `8`
> * max: `100`

`--cli-input-json` | `--cli-input-yaml` (string)
Reads arguments from the JSON string provided. The JSON string follows the format provided by `--generate-cli-skeleton`. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with `--cli-input-yaml`.

`--generate-cli-skeleton` (string)
Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value `input`, prints a sample input JSON that can be used as an argument for `--cli-input-json`. Similarly, if provided `yaml-input` it will print a sample input YAML that can be used with `--cli-input-yaml`. If provided with the value `output`, it validates the command inputs and returns a sample output JSON for that command. The generated JSON skeleton is not stable between versions of the AWS CLI and there are no backwards compatibility guarantees in the JSON skeleton generated.

## Global Options

`--debug` (boolean)

Turn on debug logging.

`--endpoint-url` (string)

Override command’s default URL with the given URL.

`--no-verify-ssl` (boolean)

By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.

`--no-paginate` (boolean)

Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.

`--output` (string)

The formatting style for command output.

* json
* text
* table
* yaml
* yaml-stream
* off

`--query` (string)

A JMESPath query to use in filtering the response data.

`--profile` (string)

Use a specific profile from your credential file.

`--region` (string)

The region to use. Overrides config/env settings.

`--version` (string)

Display the version of this tool.

`--color` (string)

Turn on/off color output.

* on
* off
* auto

`--no-sign-request` (boolean)

Do not sign requests. Credentials will not be loaded if this argument is provided.

`--ca-bundle` (string)

The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.

`--cli-read-timeout` (int)

The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.

`--cli-connect-timeout` (int)

The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.

`--cli-binary-format` (string)

The formatting style to be used for binary blobs. The default format is base64. The base64 format expects binary blobs to be provided as a base64 encoded string. The raw-in-base64-out format preserves compatibility with AWS CLI V1 behavior and binary values must be passed literally. When providing contents from a file that map to a binary blob `fileb://` will always be treated as binary and use the file contents directly regardless of the `cli-binary-format` setting. When using `file://` the file contents will need to properly formatted for the configured `cli-binary-format`.

* base64
* raw-in-base64-out

`--no-cli-pager` (boolean)

Disable cli pager for output.

`--cli-auto-prompt` (boolean)

Automatically prompt for CLI input parameters.

`--no-cli-auto-prompt` (boolean)

Disable automatically prompt for CLI input parameters.

`--cli-error-format` (string)

The formatting style for error output. By default, errors are displayed in enhanced format.

* legacy
* json
* yaml
* text
* table
* enhanced

## Output

computeNodeGroup -> (structure)

> A compute node group associated with a cluster.

> name -> (string) [required]

> > The name that identifies the compute node group.

> > Constraints:

> > * min: `3`
> > * max: `25`
> > * pattern: `(?!pcs_)^[A-Za-z][A-Za-z0-9-]+`

> id -> (string) [required]

> > The generated unique ID of the compute node group.

> arn -> (string) [required]

> > The unique Amazon Resource Name (ARN) of the compute node group.

> clusterId -> (string) [required]

> > The ID of the cluster of the compute node group.

> createdAt -> (timestamp) [required]

> > The date and time the resource was created.

> modifiedAt -> (timestamp) [required]

> > The date and time the resource was modified.

> status -> (string) [required]

> > The provisioning status of the compute node group.

> > #### NOTE
> > The provisioning status doesn’t indicate the overall health of the compute node group.

> > #### WARNING
> > The resource enters the `SUSPENDING` and `SUSPENDED` states when the scheduler is beyond end of life and we have suspended the cluster. When in these states, you can’t use the cluster. The cluster controller is down and all compute instances are terminated. The resources still count toward your service quotas. You can delete a resource if its status is `SUSPENDED` . For more information, see [Frequently asked questions about Slurm versions in PCS](https://docs.aws.amazon.com/pcs/latest/userguide/slurm-versions_faq.html) in the *PCS User Guide* .

> > Possible values:

> > * `CREATING`
> > * `ACTIVE`
> > * `UPDATING`
> > * `DELETING`
> > * `CREATE_FAILED`
> > * `DELETE_FAILED`
> > * `UPDATE_FAILED`
> > * `DELETED`
> > * `SUSPENDING`
> > * `SUSPENDED`
> > * `RESUMING`

> amiId -> (string)

> > The ID of the Amazon Machine Image (AMI) that PCS uses to launch instances. If not provided, PCS uses the AMI ID specified in the custom launch template.

> > Constraints:

> > * pattern: `ami-[a-z0-9]+`

> subnetIds -> (list) [required]

> > 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.

> > Constraints:

> > * min: `1`

> > (string)

> > > Constraints:

> > > * pattern: `subnet-\w{8,17}`

> purchaseOption -> (string)

> > Specifies how EC2 instances are purchased on your behalf. PCS supports On-Demand Instances, Spot Instances, Interruptible Capacity Reservations, On-Demand Capacity Reservations, and Amazon EC2 Capacity Blocks for ML. For more information, see [Amazon EC2 billing and purchasing options](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-purchasing-options.html) in the *Amazon Elastic Compute Cloud User Guide* . For more information about PCS support for Capacity Blocks, see [Using Amazon EC2 Capacity Blocks for ML with PCS](https://docs.aws.amazon.com/pcs/latest/userguide/capacity-blocks.html) in the *PCS User Guide* . For more information about PCS support for interruptible capacity reservations, see [Using I-ODCRs with PCS](https://docs.aws.amazon.com/pcs/latest/userguide/capacity-reservations-iodcr.html) in the *PCS User Guide* . Choose On-Demand if you plan to use an On-Demand Capacity Reservation (ODCR). For more information, see [Using ODCRs with PCS](https://docs.aws.amazon.com/pcs/latest/userguide/capacity-reservations-odcr.html) . If you don’t provide this option, it defaults to On-Demand.

> > Possible values:

> > * `ONDEMAND`
> > * `SPOT`
> > * `CAPACITY_BLOCK`
> > * `INTERRUPTIBLE_CAPACITY_RESERVATION`

> customLaunchTemplate -> (structure) [required]

> > An Amazon EC2 launch template PCS uses to launch compute nodes.

> > id -> (string) [required]

> > > The ID of the EC2 launch template to use to provision instances.

> > > Example: `lt-xxxx`

> > version -> (string) [required]

> > > The version of the EC2 launch template to use to provision instances.

> iamInstanceProfileArn -> (string) [required]

> > 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 the `pcs:RegisterComputeNodeGroupInstance` permission and the role name must start with `AWSPCS` or must have the path `/aws-pcs/` . For more information, see [IAM instance profiles for PCS](https://docs.aws.amazon.com/pcs/latest/userguide/security-instance-profiles.html) in the *PCS User Guide* .

> > Constraints:

> > * pattern: `arn:aws([a-zA-Z-]{0,10})?:iam::[0-9]{12}:instance-profile/([!-~]{1,510}/)?([\w+=,.@-]{1,128})`

> scalingConfiguration -> (structure) [required]

> > Specifies the boundaries of the compute node group auto scaling.

> > minInstanceCount -> (integer) [required]

> > > The lower bound of the number of instances allowed in the compute fleet.

> > > Constraints:

> > > * min: `0`

> > maxInstanceCount -> (integer) [required]

> > > The upper bound of the number of instances allowed in the compute fleet.

> > > Constraints:

> > > * min: `0`

> instanceConfigs -> (list) [required]

> > A list of EC2 instance configurations that PCS can provision in the compute node group.

> > (structure)

> > > An EC2 instance configuration PCS uses to launch compute nodes.

> > > instanceType -> (string)

> > > > The EC2 instance type that PCS can provision in the compute node group.

> > > > Example: `t2.xlarge`

> spotOptions -> (structure)

> > Additional configuration when you specify `SPOT` as the `purchaseOption` for the `CreateComputeNodeGroup` API action.

> > allocationStrategy -> (string)

> > > The Amazon EC2 allocation strategy PCS uses to provision EC2 instances. PCS supports **lowest price** , **capacity optimized** , and **price capacity optimized** . For more information, see [Use allocation strategies to determine how EC2 Fleet or Spot Fleet fulfills Spot and On-Demand capacity](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-allocation-strategy.html) in the *Amazon Elastic Compute Cloud User Guide* . If you don’t provide this option, it defaults to **price capacity optimized** .

> > > Possible values:

> > > * `lowest-price`
> > > * `capacity-optimized`
> > > * `price-capacity-optimized`

> slurmConfiguration -> (structure)

> > Additional options related to the Slurm scheduler.

> > scaleDownIdleTimeInSeconds -> (integer)

> > > The time (in seconds) before an idle node is scaled down. If not specified, the cluster-level setting applies. This overrides the cluster-level `scaleDownIdleTimeInSeconds` setting. A value of `-1` removes the override and applies the cluster-level setting to this compute node group. Requires Slurm version 25.11 or later.

> > > Constraints:

> > > * min: `-1`
> > > * max: `10000000`

> > slurmCustomSettings -> (list)

> > > Additional Slurm-specific configuration that directly maps to Slurm settings.

> > > (structure)

> > > > Additional settings that directly map to Slurm settings.

> > > > #### WARNING
> > > > PCS supports a subset of Slurm settings. For more information, see [Configuring custom Slurm settings in PCS](https://docs.aws.amazon.com/pcs/latest/userguide/slurm-custom-settings.html) in the *PCS User Guide* .

> > > > parameterName -> (string) [required]

> > > > > PCS supports custom Slurm settings for clusters, compute node groups, and queues. For more information, see [Configuring custom Slurm settings in PCS](https://docs.aws.amazon.com/pcs/latest/userguide/slurm-custom-settings.html) in the *PCS User Guide* .

> > > > parameterValue -> (string) [required]

> > > > > The values for the configured Slurm settings.

> > gresCustomSettings -> (list)

> > > The additional Slurm `gres.conf` records for the compute node group. Each item is a map of `gres.conf` attribute names to values that describes one `gres.conf` record, such as a GPU topology, MIG, MPS, or custom GRES entry. PCS adds the `NodeName=` prefix and merges these records with the GPU record it derives from the instance type.

> > > (map)

> > > > A single Slurm `gres.conf` record, expressed as a map of `gres.conf` attribute names to their values. For example, `{"Name": "gpu", "Type": "a100", "File": "/dev/nvidia[0-7]"}` or `{"AutoDetect": "nvml"}` . PCS adds the `NodeName=` prefix for the compute node group.

> > > > #### WARNING
> > > > PCS supports a subset of `gres.conf` settings. For more information, see [Configuring custom GRES settings in PCS](https://docs.aws.amazon.com/pcs/latest/userguide/gres-custom-settings.html) in the *PCS User Guide* .

> > > > key -> (string)

> > > > value -> (string)

> nodeLifecycleActions -> (structure)

> > The lifecycle actions to run on compute nodes in the compute node group. Use lifecycle actions to run custom scripts at defined stages of a compute node’s lifecycle, such as when a compute node finishes bootstrapping or becomes ready to accept jobs.

> > stages -> (structure) [required]

> > > The lifecycle stages where you configure scripts to run.

> > > nodeBootstrapped -> (list)

> > > > The scripts to run after PCS finishes setting up the compute node and before the Slurm daemon (`slurmd` ) starts. Use this stage for tasks that must complete before the node accepts jobs, such as mounting shared storage, configuring networking, or installing software packages.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `20`

> > > > (structure)

> > > > > A script to run during a compute node lifecycle stage.

> > > > > name -> (string) [required]

> > > > > > A unique name for the script. The name can be up to 64 characters long. Valid characters are letters, numbers, spaces, underscores (`_` ), and hyphens (`-` ). The first character must be a letter or a number.

> > > > > > Constraints:

> > > > > > * min: `1`
> > > > > > * max: `64`
> > > > > > * pattern: `[A-Za-z0-9][A-Za-z0-9 _-]*`

> > > > > scriptSource -> (structure) [required]

> > > > > > The source location and integrity information for the script.

> > > > > > scriptLocation -> (string) [required]

> > > > > > > The location of the script. Specify either an Amazon S3 URI in the format `s3://bucket-name/key` or an HTTPS URL.

> > > > > > > Constraints:

> > > > > > > * min: `1`
> > > > > > > * max: `1024`
> > > > > > > * pattern: `(s3://[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]/.+|https://([a-zA-Z0-9](?:[a-zA-Z0-9_-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}(?::[0-9]{1,5})?(?:[/?#][^\s]*)?)`

> > > > > > s3VersionId -> (string)

> > > > > > > The Amazon S3 version ID of the script. Use this value to pin the script to a specific version in a versioned Amazon S3 bucket. This value is only valid when `scriptLocation` is an Amazon S3 URI.

> > > > > > > Constraints:

> > > > > > > * min: `0`
> > > > > > > * max: `1024`

> > > > > > checksum -> (string)

> > > > > > > The SHA-256 checksum of the script content, as a 64-character hexadecimal string. This value is optional. When specified, PCS uses this value to verify the integrity of the downloaded script.

> > > > > > > Constraints:

> > > > > > > * min: `64`
> > > > > > > * max: `64`
> > > > > > > * pattern: `[a-fA-F0-9]{64}`

> > > > > arguments -> (list)

> > > > > > The command-line arguments to pass to the script. You can specify up to 20 arguments, and each argument can be up to 256 characters long.

> > > > > > Constraints:

> > > > > > * min: `0`
> > > > > > * max: `20`

> > > > > > (string)

> > > > > > > Constraints:

> > > > > > > * min: `0`
> > > > > > > * max: `256`

> > > > > onError -> (string)

> > > > > > The behavior when the script fails. The default value is `TERMINATE` . Valid values:

> > > > > > * `TERMINATE` – Terminates the compute node.
> > > > > > * `STOP_SEQUENCE` – Stops running subsequent scripts in the sequence but doesn’t terminate the compute node.
> > > > > > * `CONTINUE` – Ignores the error and continues running the next script.

> > > > > > Possible values:

> > > > > > * `TERMINATE`
> > > > > > * `STOP_SEQUENCE`
> > > > > > * `CONTINUE`

> > > > > executionPolicy -> (string)

> > > > > > The policy that determines when the script runs. The default value is `FIRST_BOOT_ONLY` . Valid values:

> > > > > > * `FIRST_BOOT_ONLY` – Runs the script only the first time the compute node boots.
> > > > > > * `EVERY_BOOT` – Runs the script every time the compute node boots, including reboots.

> > > > > > Possible values:

> > > > > > * `FIRST_BOOT_ONLY`
> > > > > > * `EVERY_BOOT`

> > > nodeReady -> (list)

> > > > The scripts to run after the Slurm daemon (`slurmd` ) starts and the compute node registers with the Slurm controller. Use this stage for tasks that require Slurm to be running, such as running Slurm commands.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `20`

> > > > (structure)

> > > > > A script to run during a compute node lifecycle stage.

> > > > > name -> (string) [required]

> > > > > > A unique name for the script. The name can be up to 64 characters long. Valid characters are letters, numbers, spaces, underscores (`_` ), and hyphens (`-` ). The first character must be a letter or a number.

> > > > > > Constraints:

> > > > > > * min: `1`
> > > > > > * max: `64`
> > > > > > * pattern: `[A-Za-z0-9][A-Za-z0-9 _-]*`

> > > > > scriptSource -> (structure) [required]

> > > > > > The source location and integrity information for the script.

> > > > > > scriptLocation -> (string) [required]

> > > > > > > The location of the script. Specify either an Amazon S3 URI in the format `s3://bucket-name/key` or an HTTPS URL.

> > > > > > > Constraints:

> > > > > > > * min: `1`
> > > > > > > * max: `1024`
> > > > > > > * pattern: `(s3://[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]/.+|https://([a-zA-Z0-9](?:[a-zA-Z0-9_-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}(?::[0-9]{1,5})?(?:[/?#][^\s]*)?)`

> > > > > > s3VersionId -> (string)

> > > > > > > The Amazon S3 version ID of the script. Use this value to pin the script to a specific version in a versioned Amazon S3 bucket. This value is only valid when `scriptLocation` is an Amazon S3 URI.

> > > > > > > Constraints:

> > > > > > > * min: `0`
> > > > > > > * max: `1024`

> > > > > > checksum -> (string)

> > > > > > > The SHA-256 checksum of the script content, as a 64-character hexadecimal string. This value is optional. When specified, PCS uses this value to verify the integrity of the downloaded script.

> > > > > > > Constraints:

> > > > > > > * min: `64`
> > > > > > > * max: `64`
> > > > > > > * pattern: `[a-fA-F0-9]{64}`

> > > > > arguments -> (list)

> > > > > > The command-line arguments to pass to the script. You can specify up to 20 arguments, and each argument can be up to 256 characters long.

> > > > > > Constraints:

> > > > > > * min: `0`
> > > > > > * max: `20`

> > > > > > (string)

> > > > > > > Constraints:

> > > > > > > * min: `0`
> > > > > > > * max: `256`

> > > > > onError -> (string)

> > > > > > The behavior when the script fails. The default value is `TERMINATE` . Valid values:

> > > > > > * `TERMINATE` – Terminates the compute node.
> > > > > > * `STOP_SEQUENCE` – Stops running subsequent scripts in the sequence but doesn’t terminate the compute node.
> > > > > > * `CONTINUE` – Ignores the error and continues running the next script.

> > > > > > Possible values:

> > > > > > * `TERMINATE`
> > > > > > * `STOP_SEQUENCE`
> > > > > > * `CONTINUE`

> > > > > executionPolicy -> (string)

> > > > > > The policy that determines when the script runs. The default value is `FIRST_BOOT_ONLY` . Valid values:

> > > > > > * `FIRST_BOOT_ONLY` – Runs the script only the first time the compute node boots.
> > > > > > * `EVERY_BOOT` – Runs the script every time the compute node boots, including reboots.

> > > > > > Possible values:

> > > > > > * `FIRST_BOOT_ONLY`
> > > > > > * `EVERY_BOOT`

> > scriptCachingPolicy -> (string)

> > > The caching policy for node lifecycle scripts. The default value is `CACHE_ONCE` . Valid values:

> > > * `CACHE_ONCE` – Downloads each script once and reuses it on subsequent boots.
> > > * `REFRESH_ON_REBOOT` – Downloads each script on every boot.

> > > Possible values:

> > > * `CACHE_ONCE`
> > > * `REFRESH_ON_REBOOT`

> errorInfo -> (list)

> > The list of errors that occurred during compute node group provisioning.

> > (structure)

> > > An error that occurred during resource creation.

> > > code -> (string)

> > > > The short-form error code.

> > > message -> (string)

> > > > The detailed error information.
