Class CfnCluster

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggableV2, IClusterRef, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.113.0 (build fc68b25)", date="2025-09-15T14:52:03.140Z") @Stability(Stable) public class CfnCluster extends CfnResource implements IInspectable, IClusterRef, ITaggableV2
Creates an AWS PCS cluster resource.

For more information, see Creating a cluster in AWS Parallel Computing Service in the AWS PCS User Guide .

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.pcs.*;
 CfnCluster cfnCluster = CfnCluster.Builder.create(this, "MyCfnCluster")
         .networking(NetworkingProperty.builder()
                 .networkType("networkType")
                 .securityGroupIds(List.of("securityGroupIds"))
                 .subnetIds(List.of("subnetIds"))
                 .build())
         .scheduler(SchedulerProperty.builder()
                 .type("type")
                 .version("version")
                 .build())
         .size("size")
         // the properties below are optional
         .name("name")
         .slurmConfiguration(SlurmConfigurationProperty.builder()
                 .accounting(AccountingProperty.builder()
                         .mode("mode")
                         // the properties below are optional
                         .defaultPurgeTimeInDays(123)
                         .build())
                 .authKey(AuthKeyProperty.builder()
                         .secretArn("secretArn")
                         .secretVersion("secretVersion")
                         .build())
                 .scaleDownIdleTimeInSeconds(123)
                 .slurmCustomSettings(List.of(SlurmCustomSettingProperty.builder()
                         .parameterName("parameterName")
                         .parameterValue("parameterValue")
                         .build()))
                 .build())
         .tags(Map.of(
                 "tagsKey", "tags"))
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnCluster

      protected CfnCluster(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnCluster

      protected CfnCluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnCluster

      @Stability(Stable) public CfnCluster(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnClusterProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The unique Amazon Resource Name (ARN) of the cluster.
    • getAttrEndpoints

      @Stability(Stable) @NotNull public IResolvable getAttrEndpoints()
      The list of endpoints available for interaction with the scheduler.
    • getAttrErrorInfo

      @Stability(Stable) @NotNull public IResolvable getAttrErrorInfo()
      The list of errors that occurred during cluster provisioning.
    • getAttrId

      @Stability(Stable) @NotNull public String getAttrId()
      The generated unique ID of the cluster.
    • getAttrStatus

      @Stability(Stable) @NotNull public String getAttrStatus()
      The provisioning status of the cluster.

      The provisioning status doesn't indicate the overall health of the cluster. > 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 AWS PCS in the AWS PCS User Guide .

    • getCdkTagManager

      @Stability(Stable) @NotNull public TagManager getCdkTagManager()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getCdkTagManager in interface ITaggableV2
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getClusterRef

      @Stability(Stable) @NotNull public ClusterReference getClusterRef()
      A reference to a Cluster resource.
      Specified by:
      getClusterRef in interface IClusterRef
    • getNetworking

      @Stability(Stable) @NotNull public Object getNetworking()
      The networking configuration for the cluster's control plane.
    • setNetworking

      @Stability(Stable) public void setNetworking(@NotNull IResolvable value)
      The networking configuration for the cluster's control plane.
    • setNetworking

      @Stability(Stable) public void setNetworking(@NotNull CfnCluster.NetworkingProperty value)
      The networking configuration for the cluster's control plane.
    • getScheduler

      @Stability(Stable) @NotNull public Object getScheduler()
      The cluster management and job scheduling software associated with the cluster.
    • setScheduler

      @Stability(Stable) public void setScheduler(@NotNull IResolvable value)
      The cluster management and job scheduling software associated with the cluster.
    • setScheduler

      @Stability(Stable) public void setScheduler(@NotNull CfnCluster.SchedulerProperty value)
      The cluster management and job scheduling software associated with the cluster.
    • getSize

      @Stability(Stable) @NotNull public String getSize()
      The size of the cluster.
    • setSize

      @Stability(Stable) public void setSize(@NotNull String value)
      The size of the cluster.
    • getName

      @Stability(Stable) @Nullable public String getName()
      The name that identifies the cluster.
    • setName

      @Stability(Stable) public void setName(@Nullable String value)
      The name that identifies the cluster.
    • getSlurmConfiguration

      @Stability(Stable) @Nullable public Object getSlurmConfiguration()
      Additional options related to the Slurm scheduler.
    • setSlurmConfiguration

      @Stability(Stable) public void setSlurmConfiguration(@Nullable IResolvable value)
      Additional options related to the Slurm scheduler.
    • setSlurmConfiguration

      @Stability(Stable) public void setSlurmConfiguration(@Nullable CfnCluster.SlurmConfigurationProperty value)
      Additional options related to the Slurm scheduler.
    • getTags

      @Stability(Stable) @Nullable public Map<String,String> getTags()
      1 or more tags added to the resource.
    • setTags

      @Stability(Stable) public void setTags(@Nullable Map<String,String> value)
      1 or more tags added to the resource.