@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.583Z") @Stability(value=Stable) public class CfnCluster extends CfnResource implements IInspectable
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())
.build())
.defaultCapacityProviderStrategy(List.of(CapacityProviderStrategyItemProperty.builder()
.base(123)
.capacityProvider("capacityProvider")
.weight(123)
.build()))
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnCluster.Builder
A fluent builder for
CfnCluster. |
static interface |
CfnCluster.CapacityProviderStrategyItemProperty
The `CapacityProviderStrategyItem` property specifies the details of the default capacity provider strategy for the cluster.
|
static interface |
CfnCluster.ClusterConfigurationProperty
The execute command configuration for the cluster.
|
static interface |
CfnCluster.ClusterSettingsProperty
The settings to use when creating a cluster.
|
static interface |
CfnCluster.ExecuteCommandConfigurationProperty
The details of the execute command configuration.
|
static interface |
CfnCluster.ExecuteCommandLogConfigurationProperty
The log configuration for the results of the execute command actions.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnCluster(software.constructs.Construct scope,
String id)
Create a new `AWS::ECS::Cluster`.
|
|
CfnCluster(software.constructs.Construct scope,
String id,
CfnClusterProps props)
Create a new `AWS::ECS::Cluster`.
|
protected |
CfnCluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnCluster(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAttrArn()
The Amazon Resource Name (ARN) of the Amazon ECS cluster, such as `arn:aws:ecs:us-east-2:123456789012:cluster/MyECSCluster` .
|
List<String> |
getCapacityProviders()
The short name of one or more capacity providers to associate with the cluster.
|
protected Map<String,Object> |
getCfnProperties() |
String |
getClusterName()
A user-generated string that you use to identify your cluster.
|
Object |
getClusterSettings()
The setting to use when creating a cluster.
|
Object |
getConfiguration()
The execute command configuration for the cluster.
|
Object |
getDefaultCapacityProviderStrategy()
The default capacity provider strategy for the cluster.
|
TagManager |
getTags()
The metadata that you apply to the cluster to help you categorize and organize them.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setCapacityProviders(List<String> value)
The short name of one or more capacity providers to associate with the cluster.
|
void |
setClusterName(String value)
A user-generated string that you use to identify your cluster.
|
void |
setClusterSettings(IResolvable value)
The setting to use when creating a cluster.
|
void |
setClusterSettings(List<Object> value)
The setting to use when creating a cluster.
|
void |
setConfiguration(CfnCluster.ClusterConfigurationProperty value)
The execute command configuration for the cluster.
|
void |
setConfiguration(IResolvable value)
The execute command configuration for the cluster.
|
void |
setDefaultCapacityProviderStrategy(IResolvable value)
The default capacity provider strategy for the cluster.
|
void |
setDefaultCapacityProviderStrategy(List<Object> value)
The default capacity provider strategy for the cluster.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnCluster(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnCluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnCluster(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@Nullable
CfnClusterProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties.@Stability(value=Stable)
public CfnCluster(@NotNull
software.constructs.Construct scope,
@NotNull
String id)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrArn()
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public TagManager getTags()
Each tag consists of a key and an optional value. You define both.
The following basic restrictions apply to tags:
aws: , AWS: , or any upper or lowercase combination of such as a prefix for either keys or values as it is reserved for AWS use. You cannot edit or delete tag keys or values with this prefix. Tags with this prefix do not count against your tags per resource limit.@Stability(value=Stable) @Nullable public List<String> getCapacityProviders()
A capacity provider must be associated with a cluster before it can be included as part of the default capacity provider strategy of the cluster or used in a capacity provider strategy.
If specifying a capacity provider that uses an Auto Scaling group, the capacity provider must already be created and not already associated with another cluster.
To use an AWS Fargate capacity provider, specify either the FARGATE or FARGATE_SPOT capacity providers. The AWS Fargate capacity providers are available to all accounts and only need to be associated with a cluster to be used.
@Stability(value=Stable)
public void setCapacityProviders(@Nullable
List<String> value)
A capacity provider must be associated with a cluster before it can be included as part of the default capacity provider strategy of the cluster or used in a capacity provider strategy.
If specifying a capacity provider that uses an Auto Scaling group, the capacity provider must already be created and not already associated with another cluster.
To use an AWS Fargate capacity provider, specify either the FARGATE or FARGATE_SPOT capacity providers. The AWS Fargate capacity providers are available to all accounts and only need to be associated with a cluster to be used.
@Stability(value=Stable) @Nullable public String getClusterName()
If you don't specify a name, AWS CloudFormation generates a unique physical ID for the name.
@Stability(value=Stable)
public void setClusterName(@Nullable
String value)
If you don't specify a name, AWS CloudFormation generates a unique physical ID for the name.
@Stability(value=Stable) @Nullable public Object getClusterSettings()
This parameter is used to enable CloudWatch Container Insights for a cluster. If this value is specified, it will override the containerInsights value set with PutAccountSetting or PutAccountSettingDefault .
@Stability(value=Stable)
public void setClusterSettings(@Nullable
IResolvable value)
This parameter is used to enable CloudWatch Container Insights for a cluster. If this value is specified, it will override the containerInsights value set with PutAccountSetting or PutAccountSettingDefault .
@Stability(value=Stable)
public void setClusterSettings(@Nullable
List<Object> value)
This parameter is used to enable CloudWatch Container Insights for a cluster. If this value is specified, it will override the containerInsights value set with PutAccountSetting or PutAccountSettingDefault .
@Stability(value=Stable) @Nullable public Object getConfiguration()
@Stability(value=Stable)
public void setConfiguration(@Nullable
CfnCluster.ClusterConfigurationProperty value)
@Stability(value=Stable)
public void setConfiguration(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public Object getDefaultCapacityProviderStrategy()
When services or tasks are run in the cluster with no launch type or capacity provider strategy specified, the default capacity provider strategy is used.
@Stability(value=Stable)
public void setDefaultCapacityProviderStrategy(@Nullable
IResolvable value)
When services or tasks are run in the cluster with no launch type or capacity provider strategy specified, the default capacity provider strategy is used.
@Stability(value=Stable)
public void setDefaultCapacityProviderStrategy(@Nullable
List<Object> value)
When services or tasks are run in the cluster with no launch type or capacity provider strategy specified, the default capacity provider strategy is used.
Copyright © 2022. All rights reserved.