Class CfnCluster

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

@Generated(value="jsii-pacmak/1.126.0 (build 206d44b)", date="2026-02-19T19:23:39.223Z") @Stability(Stable) public class CfnCluster extends CfnResource implements IInspectable, IClusterRef, ITaggable
The AWS::ECS::Cluster resource creates an Amazon Elastic Container Service (Amazon ECS) cluster.

Example:

 import software.amazon.awscdk.services.ecs.*;
 import software.amazon.awscdk.mixins.preview.services.ecs.mixins.ClusterSettings;
 CfnCluster cluster = new CfnCluster(scope, "Cluster");
 Mixins.of(cluster).apply(new ClusterSettings(List.of(ClusterSettingsProperty.builder()
         .name("containerInsights")
         .value("enhanced")
         .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, @Nullable CfnClusterProps props)
      Create a new AWS::ECS::Cluster.

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

      @Stability(Stable) public CfnCluster(@NotNull software.constructs.Construct scope, @NotNull String id)
      Create a new AWS::ECS::Cluster.

      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.
  • Method Details

    • arnForCluster

      @Stability(Stable) @NotNull public static String arnForCluster(@NotNull IClusterRef resource)
      Parameters:
      resource - This parameter is required.
    • fromClusterArn

      @Stability(Stable) @NotNull public static IClusterRef fromClusterArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String arn)
      Creates a new IClusterRef from an ARN.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      arn - This parameter is required.
    • fromClusterName

      @Stability(Stable) @NotNull public static IClusterRef fromClusterName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String clusterName)
      Creates a new IClusterRef from a clusterName.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      clusterName - This parameter is required.
    • isCfnCluster

      @Stability(Stable) @NotNull public static Boolean isCfnCluster(@NotNull Object x)
      Checks whether the given object is a CfnCluster.

      Parameters:
      x - This parameter is required.
    • 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 Amazon Resource Name (ARN) of the Amazon ECS cluster, such as arn:aws:ecs:us-east-2:123456789012:cluster/MyECSCluster .
    • 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
    • getTags

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

      @Stability(Stable) @Nullable public List<String> getCapacityProviders()
      The short name of one or more capacity providers to associate with the cluster.
    • setCapacityProviders

      @Stability(Stable) public void setCapacityProviders(@Nullable List<String> value)
      The short name of one or more capacity providers to associate with the cluster.
    • getClusterName

      @Stability(Stable) @Nullable public String getClusterName()
      A user-generated string that you use to identify your cluster.
    • setClusterName

      @Stability(Stable) public void setClusterName(@Nullable String value)
      A user-generated string that you use to identify your cluster.
    • getClusterSettings

      @Stability(Stable) @Nullable public Object getClusterSettings()
      The settings to use when creating a cluster.

      Returns union: either IResolvable or Listinvalid input: '<'either IResolvable or CfnCluster.ClusterSettingsProperty>

    • setClusterSettings

      @Stability(Stable) public void setClusterSettings(@Nullable IResolvable value)
      The settings to use when creating a cluster.
    • setClusterSettings

      @Stability(Stable) public void setClusterSettings(@Nullable List<Object> value)
      The settings to use when creating a cluster.
    • getConfiguration

      @Stability(Stable) @Nullable public Object getConfiguration()
      The execute command and managed storage configuration for the cluster.

      Returns union: either IResolvable or CfnCluster.ClusterConfigurationProperty

    • setConfiguration

      @Stability(Stable) public void setConfiguration(@Nullable IResolvable value)
      The execute command and managed storage configuration for the cluster.
    • setConfiguration

      @Stability(Stable) public void setConfiguration(@Nullable CfnCluster.ClusterConfigurationProperty value)
      The execute command and managed storage configuration for the cluster.
    • getDefaultCapacityProviderStrategy

      @Stability(Stable) @Nullable public Object getDefaultCapacityProviderStrategy()
      The default capacity provider strategy for the cluster.

      Returns union: either IResolvable or Listinvalid input: '<'either IResolvable or CfnCluster.CapacityProviderStrategyItemProperty>

    • setDefaultCapacityProviderStrategy

      @Stability(Stable) public void setDefaultCapacityProviderStrategy(@Nullable IResolvable value)
      The default capacity provider strategy for the cluster.
    • setDefaultCapacityProviderStrategy

      @Stability(Stable) public void setDefaultCapacityProviderStrategy(@Nullable List<Object> value)
      The default capacity provider strategy for the cluster.
    • getServiceConnectDefaults

      @Stability(Stable) @Nullable public Object getServiceConnectDefaults()
      Use this parameter to set a default Service Connect namespace.

      Returns union: either IResolvable or CfnCluster.ServiceConnectDefaultsProperty

    • setServiceConnectDefaults

      @Stability(Stable) public void setServiceConnectDefaults(@Nullable IResolvable value)
      Use this parameter to set a default Service Connect namespace.
    • setServiceConnectDefaults

      @Stability(Stable) public void setServiceConnectDefaults(@Nullable CfnCluster.ServiceConnectDefaultsProperty value)
      Use this parameter to set a default Service Connect namespace.
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      The metadata that you apply to the cluster to help you categorize and organize them.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)
      The metadata that you apply to the cluster to help you categorize and organize them.