Class CfnCluster
A CloudFormation AWS::ECS::Cluster
.
Inherited Members
Namespace: Amazon.CDK.AWS.ECS
Assembly: Amazon.CDK.AWS.ECS.dll
Syntax (csharp)
public class CfnCluster : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnCluster
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
The AWS::ECS::Cluster
resource creates an Amazon Elastic Container Service (Amazon ECS) cluster.
CloudformationResource: AWS::ECS::Cluster
Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-cluster.html
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ECS;
var cfnCluster = new CfnCluster(this, "MyCfnCluster", new CfnClusterProps {
CapacityProviders = new [] { "capacityProviders" },
ClusterName = "clusterName",
ClusterSettings = new [] { new ClusterSettingsProperty {
Name = "name",
Value = "value"
} },
Configuration = new ClusterConfigurationProperty {
ExecuteCommandConfiguration = new ExecuteCommandConfigurationProperty {
KmsKeyId = "kmsKeyId",
LogConfiguration = new ExecuteCommandLogConfigurationProperty {
CloudWatchEncryptionEnabled = false,
CloudWatchLogGroupName = "cloudWatchLogGroupName",
S3BucketName = "s3BucketName",
S3EncryptionEnabled = false,
S3KeyPrefix = "s3KeyPrefix"
},
Logging = "logging"
}
},
DefaultCapacityProviderStrategy = new [] { new CapacityProviderStrategyItemProperty {
Base = 123,
CapacityProvider = "capacityProvider",
Weight = 123
} },
ServiceConnectDefaults = new ServiceConnectDefaultsProperty {
Namespace = "namespace"
},
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
});
Synopsis
Constructors
CfnCluster(Construct, String, ICfnClusterProps) | Create a new |
CfnCluster(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnCluster(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
AttrArn | The Amazon Resource Name (ARN) of the Amazon ECS cluster, such as |
CapacityProviders | The short name of one or more capacity providers to associate with the cluster. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
ClusterName | A user-generated string that you use to identify your cluster. |
ClusterSettings | The settings to use when creating a cluster. |
Configuration | The execute command configuration for the cluster. |
DefaultCapacityProviderStrategy | The default capacity provider strategy for the cluster. |
ServiceConnectDefaults | Use this parameter to set a default Service Connect namespace. |
Tags | The metadata that you apply to the cluster to help you categorize and organize them. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnCluster(Construct, String, ICfnClusterProps)
Create a new AWS::ECS::Cluster
.
public CfnCluster(Construct scope, string id, ICfnClusterProps props = null)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnClusterProps
- resource properties.
CfnCluster(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnCluster(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnCluster(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnCluster(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
AttrArn
The Amazon Resource Name (ARN) of the Amazon ECS cluster, such as arn:aws:ecs:us-east-2:123456789012:cluster/MyECSCluster
.
public virtual string AttrArn { get; }
Property Value
System.String
Remarks
CloudformationAttribute: Arn
CapacityProviders
The short name of one or more capacity providers to associate with the cluster.
public virtual string[] CapacityProviders { get; set; }
Property Value
System.String[]
Remarks
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 when calling the CreateService or RunTask actions.
If specifying a capacity provider that uses an Auto Scaling group, the capacity provider must be created but not associated with another cluster. New Auto Scaling group capacity providers can be created with the CreateCapacityProvider API operation.
To use a 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.
The PutCapacityProvider API operation is used to update the list of available capacity providers for a cluster after the cluster is created.
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
ClusterName
A user-generated string that you use to identify your cluster.
public virtual string ClusterName { get; set; }
Property Value
System.String
Remarks
If you don't specify a name, AWS CloudFormation generates a unique physical ID for the name.
ClusterSettings
The settings to use when creating a cluster.
public virtual object ClusterSettings { get; set; }
Property Value
System.Object
Remarks
This parameter is used to turn on CloudWatch Container Insights for a cluster.
Configuration
The execute command configuration for the cluster.
public virtual object Configuration { get; set; }
Property Value
System.Object
Remarks
DefaultCapacityProviderStrategy
The default capacity provider strategy for the cluster.
public virtual object DefaultCapacityProviderStrategy { get; set; }
Property Value
System.Object
Remarks
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.
ServiceConnectDefaults
Use this parameter to set a default Service Connect namespace.
public virtual object ServiceConnectDefaults { get; set; }
Property Value
System.Object
Remarks
After you set a default Service Connect namespace, any new services with Service Connect turned on that are created in the cluster are added as client services in the namespace. This setting only applies to new services that set the enabled
parameter to true
in the ServiceConnectConfiguration
. You can set the namespace of each service individually in the ServiceConnectConfiguration
to override this default parameter.
Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see Service Connect in the Amazon Elastic Container Service Developer Guide .
Tags
The metadata that you apply to the cluster to help you categorize and organize them.
public virtual TagManager Tags { get; }
Property Value
Remarks
Each tag consists of a key and an optional value. You define both.
The following basic restrictions apply to tags:
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
- tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>