AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Container for the parameters to the CreateCluster operation.
Creates a new Amazon ECS cluster. By default, your account receives a
When you call the CreateCluster
API operation, Amazon ECS attempts to create the Amazon ECS service-linked role for
your account. This is so that it can manage required resources in other Amazon Web
Services services on your behalf. However, if the user that makes the call doesn't
have permissions to create the service-linked role, it isn't created. For more information,
see Using
service-linked roles for Amazon ECS in the Amazon Elastic Container Service
Developer Guide.
default
cluster when you launch your first container instance. However, you can create your
own cluster with a unique name.
Namespace: Amazon.ECS.Model
Assembly: AWSSDK.ECS.dll
Version: 3.x.y.z
public class CreateClusterRequest : AmazonECSRequest IAmazonWebServiceRequest
The CreateClusterRequest type exposes the following members
Name | Description | |
---|---|---|
![]() |
CreateClusterRequest() |
Name | Type | Description | |
---|---|---|---|
![]() |
CapacityProviders | System.Collections.Generic.List<System.String> |
Gets and sets the property CapacityProviders. The short name of one or more capacity providers to associate with the cluster. 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 Fargate capacity provider, specify either the The PutCapacityProvider API operation is used to update the list of available capacity providers for a cluster after the cluster is created. |
![]() |
ClusterName | System.String |
Gets and sets the property ClusterName.
The name of your cluster. If you don't specify a name for your cluster, you create
a cluster that's named |
![]() |
Configuration | Amazon.ECS.Model.ClusterConfiguration |
Gets and sets the property Configuration.
The |
![]() |
DefaultCapacityProviderStrategy | System.Collections.Generic.List<Amazon.ECS.Model.CapacityProviderStrategyItem> |
Gets and sets the property DefaultCapacityProviderStrategy. The capacity provider strategy to set as the default for the cluster. After a default capacity provider strategy is set for a cluster, when you call the CreateService or RunTask APIs with no capacity provider strategy or launch type specified, the default capacity provider strategy for the cluster is used. If a default capacity provider strategy isn't defined for a cluster when it was created, it can be defined later with the PutClusterCapacityProviders API operation. |
![]() |
ServiceConnectDefaults | Amazon.ECS.Model.ClusterServiceConnectDefaultsRequest |
Gets and sets the property ServiceConnectDefaults.
Use this parameter to set a default Service Connect namespace. 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 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. |
![]() |
Settings | System.Collections.Generic.List<Amazon.ECS.Model.ClusterSetting> |
Gets and sets the property Settings.
The setting to use when creating a cluster. This parameter is used to turn on CloudWatch
Container Insights for a cluster. If this value is specified, it overrides the |
![]() |
Tags | System.Collections.Generic.List<Amazon.ECS.Model.Tag> |
Gets and sets the property Tags. The metadata that you apply to the cluster to help you categorize and organize them. Each tag consists of a key and an optional value. You define both. The following basic restrictions apply to tags:
|
This example creates a cluster in your default region.
var client = new AmazonECSClient(); var response = client.CreateCluster(new CreateClusterRequest { ClusterName = "my_cluster" }); Cluster cluster = response.Cluster;
.NET:
Supported in: 8.0 and newer, Core 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5 and newer, 3.5