CfnComputeNodeGroupPropsMixin
- class aws_cdk.cfn_property_mixins.aws_pcs.CfnComputeNodeGroupPropsMixin(props, *, strategy=None)
Bases:
MixinCreates an AWS PCS compute node group resource.
For more information, see Creating a compute node group in AWS PCS in the AWS PCS User Guide .
- See:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-pcs-computenodegroup.html
- CloudformationResource:
AWS::PCS::ComputeNodeGroup
- Mixin:
true
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.cfn_property_mixins import aws_pcs as pcs import aws_cdk as cdk # merge_strategy: cdk.IMergeStrategy cfn_compute_node_group_props_mixin = pcs.CfnComputeNodeGroupPropsMixin(pcs.CfnComputeNodeGroupMixinProps( ami_id="amiId", cluster_id="clusterId", custom_launch_template=pcs.CfnComputeNodeGroupPropsMixin.CustomLaunchTemplateProperty( template_id="templateId", version="version" ), iam_instance_profile_arn="iamInstanceProfileArn", instance_configs=[pcs.CfnComputeNodeGroupPropsMixin.InstanceConfigProperty( instance_type="instanceType" )], name="name", node_lifecycle_actions=pcs.CfnComputeNodeGroupPropsMixin.NodeLifecycleActionsProperty( script_caching_policy="scriptCachingPolicy", stages=pcs.CfnComputeNodeGroupPropsMixin.NodeLifecycleStagesProperty( node_bootstrapped=[pcs.CfnComputeNodeGroupPropsMixin.NodeLifecycleScriptProperty( arguments=["arguments"], execution_policy="executionPolicy", name="name", on_error="onError", script_source=pcs.CfnComputeNodeGroupPropsMixin.ScriptSourceProperty( checksum="checksum", s3_version_id="s3VersionId", script_location="scriptLocation" ) )], node_ready=[pcs.CfnComputeNodeGroupPropsMixin.NodeLifecycleScriptProperty( arguments=["arguments"], execution_policy="executionPolicy", name="name", on_error="onError", script_source=pcs.CfnComputeNodeGroupPropsMixin.ScriptSourceProperty( checksum="checksum", s3_version_id="s3VersionId", script_location="scriptLocation" ) )] ) ), purchase_option="purchaseOption", scaling_configuration=pcs.CfnComputeNodeGroupPropsMixin.ScalingConfigurationProperty( max_instance_count=123, min_instance_count=123 ), slurm_configuration=pcs.CfnComputeNodeGroupPropsMixin.SlurmConfigurationProperty( scale_down_idle_time_in_seconds=123, slurm_custom_settings=[pcs.CfnComputeNodeGroupPropsMixin.SlurmCustomSettingProperty( parameter_name="parameterName", parameter_value="parameterValue" )] ), spot_options=pcs.CfnComputeNodeGroupPropsMixin.SpotOptionsProperty( allocation_strategy="allocationStrategy" ), subnet_ids=["subnetIds"], tags={ "tags_key": "tags" } ), strategy=merge_strategy )
Create a mixin to apply properties to
AWS::PCS::ComputeNodeGroup.- Parameters:
props (
Union[CfnComputeNodeGroupMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[IMergeStrategy]) – Strategy for merging nested properties. Default: - PropertyMergeStrategy.combine()
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
None
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['amiId', 'clusterId', 'customLaunchTemplate', 'iamInstanceProfileArn', 'instanceConfigs', 'name', 'nodeLifecycleActions', 'purchaseOption', 'scalingConfiguration', 'slurmConfiguration', 'spotOptions', 'subnetIds', 'tags']
Static Methods
- classmethod is_mixin(x)
Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.
CustomLaunchTemplateProperty
- class CfnComputeNodeGroupPropsMixin.CustomLaunchTemplateProperty(*, template_id=None, version=None)
Bases:
objectAn Amazon EC2 launch template AWS PCS uses to launch compute nodes.
- Parameters:
template_id (
Optional[str]) – The ID of the EC2 launch template to use to provision instances.version (
Optional[str]) – The version of the EC2 launch template to use to provision instances.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.cfn_property_mixins import aws_pcs as pcs custom_launch_template_property = pcs.CfnComputeNodeGroupPropsMixin.CustomLaunchTemplateProperty( template_id="templateId", version="version" )
Attributes
- template_id
The ID of the EC2 launch template to use to provision instances.
- version
The version of the EC2 launch template to use to provision instances.
ErrorInfoProperty
- class CfnComputeNodeGroupPropsMixin.ErrorInfoProperty(*, code=None, message=None)
Bases:
objectAn error that occurred during resource creation.
- Parameters:
code (
Optional[str]) – The short-form error code.message (
Optional[str]) – The detailed error information.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.cfn_property_mixins import aws_pcs as pcs error_info_property = pcs.CfnComputeNodeGroupPropsMixin.ErrorInfoProperty( code="code", message="message" )
Attributes
- code
The short-form error code.
- message
The detailed error information.
InstanceConfigProperty
- class CfnComputeNodeGroupPropsMixin.InstanceConfigProperty(*, instance_type=None)
Bases:
objectAn EC2 instance configuration AWS PCS uses to launch compute nodes.
- Parameters:
instance_type (
Optional[str]) – The EC2 instance type that AWS PCS can provision in the compute node group. Example:t2.xlarge- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.cfn_property_mixins import aws_pcs as pcs instance_config_property = pcs.CfnComputeNodeGroupPropsMixin.InstanceConfigProperty( instance_type="instanceType" )
Attributes
- instance_type
The EC2 instance type that AWS PCS can provision in the compute node group.
Example:
t2.xlarge
NodeLifecycleActionsProperty
- class CfnComputeNodeGroupPropsMixin.NodeLifecycleActionsProperty(*, script_caching_policy=None, stages=None)
Bases:
objectCustom scripts that run at defined points in a compute node’s lifecycle.
- Parameters:
script_caching_policy (
Optional[str]) – Controls whether lifecycle scripts are downloaded once at first boot (CACHE_ONCE) or re-downloaded on every reboot (REFRESH_ON_REBOOT). Defaults to CACHE_ONCE.stages (
Union[IResolvable,NodeLifecycleStagesProperty,Dict[str,Any],None]) – The ordered scripts to run at each compute node lifecycle stage.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.cfn_property_mixins import aws_pcs as pcs node_lifecycle_actions_property = pcs.CfnComputeNodeGroupPropsMixin.NodeLifecycleActionsProperty( script_caching_policy="scriptCachingPolicy", stages=pcs.CfnComputeNodeGroupPropsMixin.NodeLifecycleStagesProperty( node_bootstrapped=[pcs.CfnComputeNodeGroupPropsMixin.NodeLifecycleScriptProperty( arguments=["arguments"], execution_policy="executionPolicy", name="name", on_error="onError", script_source=pcs.CfnComputeNodeGroupPropsMixin.ScriptSourceProperty( checksum="checksum", s3_version_id="s3VersionId", script_location="scriptLocation" ) )], node_ready=[pcs.CfnComputeNodeGroupPropsMixin.NodeLifecycleScriptProperty( arguments=["arguments"], execution_policy="executionPolicy", name="name", on_error="onError", script_source=pcs.CfnComputeNodeGroupPropsMixin.ScriptSourceProperty( checksum="checksum", s3_version_id="s3VersionId", script_location="scriptLocation" ) )] ) )
Attributes
- script_caching_policy
Controls whether lifecycle scripts are downloaded once at first boot (CACHE_ONCE) or re-downloaded on every reboot (REFRESH_ON_REBOOT).
Defaults to CACHE_ONCE.
- stages
The ordered scripts to run at each compute node lifecycle stage.
NodeLifecycleScriptProperty
- class CfnComputeNodeGroupPropsMixin.NodeLifecycleScriptProperty(*, arguments=None, execution_policy=None, name=None, on_error=None, script_source=None)
Bases:
objectA single lifecycle script with its source, arguments, and error behavior.
- Parameters:
arguments (
Optional[Sequence[str]]) – An ordered list of arguments passed to the script.execution_policy (
Optional[str]) – Whether the script runs only on the node’s first boot (FIRST_BOOT_ONLY) or on every boot including reboots (EVERY_BOOT). Defaults to FIRST_BOOT_ONLY.name (
Optional[str]) – A human-readable name that identifies the script.on_error (
Optional[str]) – The behavior when the script exits with an error. Defaults to TERMINATE.script_source (
Union[IResolvable,ScriptSourceProperty,Dict[str,Any],None]) – The external location of a lifecycle script.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.cfn_property_mixins import aws_pcs as pcs node_lifecycle_script_property = pcs.CfnComputeNodeGroupPropsMixin.NodeLifecycleScriptProperty( arguments=["arguments"], execution_policy="executionPolicy", name="name", on_error="onError", script_source=pcs.CfnComputeNodeGroupPropsMixin.ScriptSourceProperty( checksum="checksum", s3_version_id="s3VersionId", script_location="scriptLocation" ) )
Attributes
- arguments
An ordered list of arguments passed to the script.
- execution_policy
Whether the script runs only on the node’s first boot (FIRST_BOOT_ONLY) or on every boot including reboots (EVERY_BOOT).
Defaults to FIRST_BOOT_ONLY.
- name
A human-readable name that identifies the script.
- on_error
The behavior when the script exits with an error.
Defaults to TERMINATE.
- script_source
The external location of a lifecycle script.
NodeLifecycleStagesProperty
- class CfnComputeNodeGroupPropsMixin.NodeLifecycleStagesProperty(*, node_bootstrapped=None, node_ready=None)
Bases:
objectThe ordered scripts to run at each compute node lifecycle stage.
- Parameters:
node_bootstrapped (
Union[IResolvable,Sequence[Union[IResolvable,NodeLifecycleScriptProperty,Dict[str,Any]]],None]) – Scripts to run after the node is bootstrapped, once the PCS configuration phase completes and before slurmd starts.node_ready (
Union[IResolvable,Sequence[Union[IResolvable,NodeLifecycleScriptProperty,Dict[str,Any]]],None]) – Scripts to execute when the node becomes ready (every boot).
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.cfn_property_mixins import aws_pcs as pcs node_lifecycle_stages_property = pcs.CfnComputeNodeGroupPropsMixin.NodeLifecycleStagesProperty( node_bootstrapped=[pcs.CfnComputeNodeGroupPropsMixin.NodeLifecycleScriptProperty( arguments=["arguments"], execution_policy="executionPolicy", name="name", on_error="onError", script_source=pcs.CfnComputeNodeGroupPropsMixin.ScriptSourceProperty( checksum="checksum", s3_version_id="s3VersionId", script_location="scriptLocation" ) )], node_ready=[pcs.CfnComputeNodeGroupPropsMixin.NodeLifecycleScriptProperty( arguments=["arguments"], execution_policy="executionPolicy", name="name", on_error="onError", script_source=pcs.CfnComputeNodeGroupPropsMixin.ScriptSourceProperty( checksum="checksum", s3_version_id="s3VersionId", script_location="scriptLocation" ) )] )
Attributes
- node_bootstrapped
Scripts to run after the node is bootstrapped, once the PCS configuration phase completes and before slurmd starts.
- node_ready
Scripts to execute when the node becomes ready (every boot).
ScalingConfigurationProperty
- class CfnComputeNodeGroupPropsMixin.ScalingConfigurationProperty(*, max_instance_count=None, min_instance_count=None)
Bases:
objectSpecifies the boundaries of the compute node group auto scaling.
- Parameters:
max_instance_count (
Union[int,float,None]) – The upper bound of the number of instances allowed in the compute fleet.min_instance_count (
Union[int,float,None]) – The lower bound of the number of instances allowed in the compute fleet.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.cfn_property_mixins import aws_pcs as pcs scaling_configuration_property = pcs.CfnComputeNodeGroupPropsMixin.ScalingConfigurationProperty( max_instance_count=123, min_instance_count=123 )
Attributes
- max_instance_count
The upper bound of the number of instances allowed in the compute fleet.
- min_instance_count
The lower bound of the number of instances allowed in the compute fleet.
ScriptSourceProperty
- class CfnComputeNodeGroupPropsMixin.ScriptSourceProperty(*, checksum=None, s3_version_id=None, script_location=None)
Bases:
objectThe external location of a lifecycle script.
- Parameters:
checksum (
Optional[str]) – A 64-character hexadecimal SHA-256 digest used to verify script integrity.s3_version_id (
Optional[str]) – The S3 object version ID of the script, when stored in a versioned bucket.script_location (
Optional[str]) – The S3 URI or HTTPS URL where the script is stored.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.cfn_property_mixins import aws_pcs as pcs script_source_property = pcs.CfnComputeNodeGroupPropsMixin.ScriptSourceProperty( checksum="checksum", s3_version_id="s3VersionId", script_location="scriptLocation" )
Attributes
- checksum
A 64-character hexadecimal SHA-256 digest used to verify script integrity.
- s3_version_id
The S3 object version ID of the script, when stored in a versioned bucket.
- script_location
The S3 URI or HTTPS URL where the script is stored.
SlurmConfigurationProperty
- class CfnComputeNodeGroupPropsMixin.SlurmConfigurationProperty(*, scale_down_idle_time_in_seconds=None, slurm_custom_settings=None)
Bases:
objectAdditional options related to the Slurm scheduler.
- Parameters:
scale_down_idle_time_in_seconds (
Union[int,float,None]) – The time before an idle node is scaled down.slurm_custom_settings (
Union[IResolvable,Sequence[Union[IResolvable,SlurmCustomSettingProperty,Dict[str,Any]]],None]) – Additional Slurm-specific configuration that directly maps to Slurm settings.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.cfn_property_mixins import aws_pcs as pcs slurm_configuration_property = pcs.CfnComputeNodeGroupPropsMixin.SlurmConfigurationProperty( scale_down_idle_time_in_seconds=123, slurm_custom_settings=[pcs.CfnComputeNodeGroupPropsMixin.SlurmCustomSettingProperty( parameter_name="parameterName", parameter_value="parameterValue" )] )
Attributes
- scale_down_idle_time_in_seconds
The time before an idle node is scaled down.
- slurm_custom_settings
Additional Slurm-specific configuration that directly maps to Slurm settings.
SlurmCustomSettingProperty
- class CfnComputeNodeGroupPropsMixin.SlurmCustomSettingProperty(*, parameter_name=None, parameter_value=None)
Bases:
objectAdditional settings that directly map to Slurm settings.
AWS PCS supports a subset of Slurm settings. For more information, see Configuring custom Slurm settings in AWS PCS in the AWS PCS User Guide .
- Parameters:
parameter_name (
Optional[str]) –AWS PCS supports custom Slurm settings for clusters, compute node groups, and queues. For more information, see Configuring custom Slurm settings in AWS PCS in the AWS PCS User Guide .
parameter_value (
Optional[str]) – The values for the configured Slurm settings.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.cfn_property_mixins import aws_pcs as pcs slurm_custom_setting_property = pcs.CfnComputeNodeGroupPropsMixin.SlurmCustomSettingProperty( parameter_name="parameterName", parameter_value="parameterValue" )
Attributes
- parameter_name
AWS PCS supports custom Slurm settings for clusters, compute node groups, and queues.
For more information, see Configuring custom Slurm settings in AWS PCS in the AWS PCS User Guide .
- parameter_value
The values for the configured Slurm settings.
SpotOptionsProperty
- class CfnComputeNodeGroupPropsMixin.SpotOptionsProperty(*, allocation_strategy=None)
Bases:
objectAdditional configuration when you specify
SPOTas thepurchaseOptionfor theCreateComputeNodeGroupAPI action.- Parameters:
allocation_strategy (
Optional[str]) – The Amazon EC2 allocation strategy AWS PCS uses to provision EC2 instances. AWS 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 in the Amazon Elastic Compute Cloud User Guide . If you don’t provide this option, it defaults to price capacity optimized .- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.cfn_property_mixins import aws_pcs as pcs spot_options_property = pcs.CfnComputeNodeGroupPropsMixin.SpotOptionsProperty( allocation_strategy="allocationStrategy" )
Attributes
- allocation_strategy
The Amazon EC2 allocation strategy AWS PCS uses to provision EC2 instances.
AWS 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 in the Amazon Elastic Compute Cloud User Guide . If you don’t provide this option, it defaults to price capacity optimized .