CfnComputeNodeGroupProps Struct
Properties for defining a CfnComputeNodeGroup.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_pcs as pcs } from 'aws-cdk-lib';
const cfnComputeNodeGroupProps: pcs.CfnComputeNodeGroupProps = {
clusterId: 'clusterId',
customLaunchTemplate: {
version: 'version',
// the properties below are optional
templateId: 'templateId',
},
iamInstanceProfileArn: 'iamInstanceProfileArn',
instanceConfigs: [{
instanceType: 'instanceType',
}],
scalingConfiguration: {
maxInstanceCount: 123,
minInstanceCount: 123,
},
subnetIds: ['subnetIds'],
// the properties below are optional
amiId: 'amiId',
name: 'name',
nodeLifecycleActions: {
stages: {
nodeBootstrapped: [{
name: 'name',
scriptSource: {
scriptLocation: 'scriptLocation',
// the properties below are optional
checksum: 'checksum',
s3VersionId: 's3VersionId',
},
// the properties below are optional
arguments: ['arguments'],
executionPolicy: 'executionPolicy',
onError: 'onError',
}],
nodeReady: [{
name: 'name',
scriptSource: {
scriptLocation: 'scriptLocation',
// the properties below are optional
checksum: 'checksum',
s3VersionId: 's3VersionId',
},
// the properties below are optional
arguments: ['arguments'],
executionPolicy: 'executionPolicy',
onError: 'onError',
}],
},
// the properties below are optional
scriptCachingPolicy: 'scriptCachingPolicy',
},
purchaseOption: 'purchaseOption',
slurmConfiguration: {
gresCustomSettings: [{
gresCustomSettingsKey: 'gresCustomSettings',
}],
scaleDownIdleTimeInSeconds: 123,
slurmCustomSettings: [{
parameterName: 'parameterName',
parameterValue: 'parameterValue',
}],
},
spotOptions: {
allocationStrategy: 'allocationStrategy',
},
tags: {
tagsKey: 'tags',
},
};
Properties
If not provided, AWS PCS uses the AMI ID specified in the custom launch template.
customLaunchTemplateIResolvable | CfnComputeNodeGroup.CustomLaunchTemplatePropertycustom_launch_templatetyping.Union[IResolvable, CustomLaunchTemplateProperty]customLaunchTemplateIResolvableCustomLaunchTemplateIResolvableCustomLaunchTemplateinterface{}required#iamInstanceProfileArnstringiam_instance_profile_arnstriamInstanceProfileArnStringIamInstanceProfileArnstringIamInstanceProfileArn*stringrequired#notes
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 AWS PCS in the AWS PCS User Guide .
instanceConfigsIResolvable | IResolvable | CfnComputeNodeGroup.InstanceConfigProperty[]instance_configstyping.Union[IResolvable, typing.List[typing.Union[IResolvable, InstanceConfigProperty]]]instanceConfigsIResolvableInstanceConfigsIResolvableInstanceConfigsinterface{}required#nodeLifecycleActionsIResolvable | CfnComputeNodeGroup.NodeLifecycleActionsPropertynode_lifecycle_actionstyping.Union[IResolvable, NodeLifecycleActionsProperty]nodeLifecycleActionsIResolvableNodeLifecycleActionsIResolvableNodeLifecycleActionsinterface{}#purchaseOptionstringpurchase_optionstrpurchaseOptionStringPurchaseOptionstringPurchaseOption*string#notes
AWS PCS supports On-Demand Instances, Spot Instances, and Amazon EC2 Capacity Blocks for ML. For more information, see Amazon EC2 billing and purchasing options in the Amazon Elastic Compute Cloud User Guide . For more information about AWS PCS support for Capacity Blocks, see Using Amazon EC2 Capacity Blocks for ML with AWS PCS in the AWS PCS User Guide . If you don't provide this option, it defaults to On-Demand.
scalingConfigurationIResolvable | CfnComputeNodeGroup.ScalingConfigurationPropertyscaling_configurationtyping.Union[IResolvable, ScalingConfigurationProperty]scalingConfigurationIResolvableScalingConfigurationIResolvableScalingConfigurationinterface{}required#slurmConfigurationIResolvable | CfnComputeNodeGroup.SlurmConfigurationPropertyslurm_configurationtyping.Union[IResolvable, SlurmConfigurationProperty]slurmConfigurationIResolvableSlurmConfigurationIResolvableSlurmConfigurationinterface{}#spotOptionsIResolvable | CfnComputeNodeGroup.SpotOptionsPropertyspot_optionstyping.Union[IResolvable, SpotOptionsProperty]spotOptionsIResolvableSpotOptionsIResolvableSpotOptionsinterface{}#subnetIdsstring[]subnet_idstyping.List[str]subnetIdsList<String>SubnetIdsstring[]SubnetIds*[]*stringrequired#The subnets must be in the same VPC as the cluster.
tags{ [key: string]: string }tagstyping.Mapping[str, str]tagsMap<String, String>TagsIDictionary<string, string>Tags*map[string]*string#Each tag consists of a tag key and tag value. The tag value is optional and can be an empty string.