Class CfnCluster
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.ecs.CfnCluster
- All Implemented Interfaces:
IEnvironmentAware,IInspectable,ITaggable,IClusterRef,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.118.0 (build 02eec31)",
date="2025-11-10T13:40:05.015Z")
@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:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ecs.*;
CfnCluster cfnCluster = CfnCluster.Builder.create(this, "MyCfnCluster")
.capacityProviders(List.of("capacityProviders"))
.clusterName("clusterName")
.clusterSettings(List.of(ClusterSettingsProperty.builder()
.name("name")
.value("value")
.build()))
.configuration(ClusterConfigurationProperty.builder()
.executeCommandConfiguration(ExecuteCommandConfigurationProperty.builder()
.kmsKeyId("kmsKeyId")
.logConfiguration(ExecuteCommandLogConfigurationProperty.builder()
.cloudWatchEncryptionEnabled(false)
.cloudWatchLogGroupName("cloudWatchLogGroupName")
.s3BucketName("s3BucketName")
.s3EncryptionEnabled(false)
.s3KeyPrefix("s3KeyPrefix")
.build())
.logging("logging")
.build())
.managedStorageConfiguration(ManagedStorageConfigurationProperty.builder()
.fargateEphemeralStorageKmsKeyId("fargateEphemeralStorageKmsKeyId")
.kmsKeyId("kmsKeyId")
.build())
.build())
.defaultCapacityProviderStrategy(List.of(CapacityProviderStrategyItemProperty.builder()
.base(123)
.capacityProvider("capacityProvider")
.weight(123)
.build()))
.serviceConnectDefaults(ServiceConnectDefaultsProperty.builder()
.namespace("namespace")
.build())
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnCluster.static interfaceTheCapacityProviderStrategyItemproperty specifies the details of the default capacity provider strategy for the cluster.static interfaceThe execute command and managed storage configuration for the cluster.static interfaceThe settings to use when creating a cluster.static interfaceThe details of the execute command configuration.static interfaceThe log configuration for the results of the execute command actions.static interfaceThe managed storage configuration for the cluster.static interfaceUse this parameter to set a default Service Connect namespace.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.ecs.IClusterRef
IClusterRef.Jsii$Default, IClusterRef.Jsii$ProxyNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnCluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnCluster(software.amazon.jsii.JsiiObjectRef objRef) CfnCluster(software.constructs.Construct scope, String id) CfnCluster(software.constructs.Construct scope, String id, CfnClusterProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic IClusterReffromClusterArn(software.constructs.Construct scope, String id, String arn) Creates a new IClusterRef from an ARN.static IClusterReffromClusterName(software.constructs.Construct scope, String id, String clusterName) Creates a new IClusterRef from a clusterName.The Amazon Resource Name (ARN) of the Amazon ECS cluster, such asarn:aws:ecs:us-east-2:123456789012:cluster/MyECSCluster.The short name of one or more capacity providers to associate with the cluster.A user-generated string that you use to identify your cluster.A reference to a Cluster resource.The settings to use when creating a cluster.The execute command and managed storage configuration for the cluster.The default capacity provider strategy for the cluster.Use this parameter to set a default Service Connect namespace.getTags()Tag Manager which manages the tags for this resource.The metadata that you apply to the cluster to help you categorize and organize them.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetCapacityProviders(List<String> value) The short name of one or more capacity providers to associate with the cluster.voidsetClusterName(String value) A user-generated string that you use to identify your cluster.voidsetClusterSettings(List<Object> value) The settings to use when creating a cluster.voidsetClusterSettings(IResolvable value) The settings to use when creating a cluster.voidsetConfiguration(IResolvable value) The execute command and managed storage configuration for the cluster.voidThe execute command and managed storage configuration for the cluster.voidThe default capacity provider strategy for the cluster.voidThe default capacity provider strategy for the cluster.voidUse this parameter to set a default Service Connect namespace.voidUse this parameter to set a default Service Connect namespace.voidsetTagsRaw(List<CfnTag> value) The metadata that you apply to the cluster to help you categorize and organize them.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
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) - 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) - 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
-
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.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- 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:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrArn
The Amazon Resource Name (ARN) of the Amazon ECS cluster, such asarn:aws:ecs:us-east-2:123456789012:cluster/MyECSCluster. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getClusterRef
A reference to a Cluster resource.- Specified by:
getClusterRefin interfaceIClusterRef
-
getTags
Tag Manager which manages the tags for this resource. -
getCapacityProviders
The short name of one or more capacity providers to associate with the cluster. -
setCapacityProviders
The short name of one or more capacity providers to associate with the cluster. -
getClusterName
A user-generated string that you use to identify your cluster. -
setClusterName
A user-generated string that you use to identify your cluster. -
getClusterSettings
The settings to use when creating a cluster.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnCluster.ClusterSettingsProperty> -
setClusterSettings
The settings to use when creating a cluster. -
setClusterSettings
The settings to use when creating a cluster. -
getConfiguration
The execute command and managed storage configuration for the cluster.Returns union: either
IResolvableorCfnCluster.ClusterConfigurationProperty -
setConfiguration
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
The default capacity provider strategy for the cluster.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnCluster.CapacityProviderStrategyItemProperty> -
setDefaultCapacityProviderStrategy
The default capacity provider strategy for the cluster. -
setDefaultCapacityProviderStrategy
The default capacity provider strategy for the cluster. -
getServiceConnectDefaults
Use this parameter to set a default Service Connect namespace.Returns union: either
IResolvableorCfnCluster.ServiceConnectDefaultsProperty -
setServiceConnectDefaults
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
The metadata that you apply to the cluster to help you categorize and organize them. -
setTagsRaw
The metadata that you apply to the cluster to help you categorize and organize them.
-