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.
You can use Amazon ECS to schedule the placement of containers across your cluster based on your resource needs, isolation policies, and availability requirements. Amazon EC2 Container Service eliminates the need for you to operate your own cluster management and configuration management systems or worry about scaling your management infrastructure.
Namespace: Amazon.ECS
Assembly: AWSSDK.dll
Version: (assembly version)
public interface IAmazonECS IDisposable
The IAmazonECS type exposes the following members
Name | Description | |
---|---|---|
CreateCluster(CreateClusterRequest) |
Creates a new Amazon ECS cluster. By default, your account receives a default
cluster when you launch your first container instance. However, you can create your
own cluster with a unique name with the CreateCluster action.
|
|
CreateClusterAsync(CreateClusterRequest, CancellationToken) | Initiates the asynchronous execution of the CreateCluster operation. | |
CreateService(CreateServiceRequest) |
Runs and maintains a desired number of tasks from a specified task definition. If
the number of tasks running in a service drops below desiredCount , Amazon
ECS spawns another instantiation of the task in the specified cluster. To update an
existing service, see UpdateService.
You can optionally specify a deployment configuration for your service. During a deployment
(which is triggered by changing the task definition of a service with an UpdateService
operation), the service scheduler uses the
If the
The When the service scheduler launches new tasks, it attempts to balance them across the Availability Zones in your cluster with the following logic:
|
|
CreateServiceAsync(CreateServiceRequest, CancellationToken) | Initiates the asynchronous execution of the CreateService operation. | |
DeleteCluster(DeleteClusterRequest) | Deletes the specified cluster. You must deregister all container instances from this cluster before you may delete it. You can list the container instances in a cluster with ListContainerInstances and deregister them with DeregisterContainerInstance. | |
DeleteClusterAsync(DeleteClusterRequest, CancellationToken) | Initiates the asynchronous execution of the DeleteCluster operation. | |
DeleteService(DeleteServiceRequest) |
Deletes a specified service within a cluster. You can delete a service if you have
no running tasks in it and the desired task count is zero. If the service is actively
maintaining tasks, you cannot delete it, and you must update the service to a desired
task count of zero. For more information, see UpdateService.
When you delete a service, if there are still running tasks that require cleanup,
the service status moves from |
|
DeleteServiceAsync(DeleteServiceRequest, CancellationToken) | Initiates the asynchronous execution of the DeleteService operation. | |
DeregisterContainerInstance(DeregisterContainerInstanceRequest) |
Deregisters an Amazon ECS container instance from the specified cluster. This instance
is no longer available to run tasks.
If you intend to use the container instance for some other purpose after deregistration, you should stop all of the tasks running on the container instance before deregistration to avoid any orphaned tasks from consuming resources. Deregistering a container instance removes the instance from a cluster, but it does not terminate the EC2 instance; if you are finished using the instance, be sure to terminate it in the Amazon EC2 console to stop billing. When you terminate a container instance, it is automatically deregistered from your cluster. |
|
DeregisterContainerInstanceAsync(DeregisterContainerInstanceRequest, CancellationToken) | Initiates the asynchronous execution of the DeregisterContainerInstance operation. | |
DeregisterTaskDefinition(DeregisterTaskDefinitionRequest) |
Deregisters the specified task definition by family and revision. Upon deregistration,
the task definition is marked as INACTIVE . Existing tasks and services
that reference an INACTIVE task definition continue to run without disruption.
Existing services that reference an INACTIVE task definition can still
scale up or down by modifying the service's desired count.
You cannot use an |
|
DeregisterTaskDefinitionAsync(DeregisterTaskDefinitionRequest, CancellationToken) | Initiates the asynchronous execution of the DeregisterTaskDefinition operation. | |
DescribeClusters(DescribeClustersRequest) | Describes one or more of your clusters. | |
DescribeClustersAsync(DescribeClustersRequest, CancellationToken) | Initiates the asynchronous execution of the DescribeClusters operation. | |
DescribeContainerInstances(DescribeContainerInstancesRequest) | Describes Amazon EC2 Container Service container instances. Returns metadata about registered and remaining resources on each container instance requested. | |
DescribeContainerInstancesAsync(DescribeContainerInstancesRequest, CancellationToken) | Initiates the asynchronous execution of the DescribeContainerInstances operation. | |
DescribeServices(DescribeServicesRequest) | Describes the specified services running in your cluster. | |
DescribeServicesAsync(DescribeServicesRequest, CancellationToken) | Initiates the asynchronous execution of the DescribeServices operation. | |
DescribeTaskDefinition(DescribeTaskDefinitionRequest) |
Describes a task definition. You can specify a family and revision
to find information about a specific task definition, or you can simply specify the
family to find the latest ACTIVE revision in that family.
You can only describe |
|
DescribeTaskDefinitionAsync(DescribeTaskDefinitionRequest, CancellationToken) | Initiates the asynchronous execution of the DescribeTaskDefinition operation. | |
DescribeTasks(DescribeTasksRequest) | Describes a specified task or tasks. | |
DescribeTasksAsync(DescribeTasksRequest, CancellationToken) | Initiates the asynchronous execution of the DescribeTasks operation. | |
ListClusters(ListClustersRequest) | Returns a list of existing clusters. | |
ListClustersAsync(ListClustersRequest, CancellationToken) | Initiates the asynchronous execution of the ListClusters operation. | |
ListContainerInstances(ListContainerInstancesRequest) | Returns a list of container instances in a specified cluster. | |
ListContainerInstancesAsync(ListContainerInstancesRequest, CancellationToken) | Initiates the asynchronous execution of the ListContainerInstances operation. | |
ListServices(ListServicesRequest) | Lists the services that are running in a specified cluster. | |
ListServicesAsync(ListServicesRequest, CancellationToken) | Initiates the asynchronous execution of the ListServices operation. | |
ListTaskDefinitionFamilies(ListTaskDefinitionFamiliesRequest) |
Returns a list of task definition families that are registered to your account (which
may include task definition families that no longer have any ACTIVE task
definitions). You can filter the results with the familyPrefix parameter.
|
|
ListTaskDefinitionFamiliesAsync(ListTaskDefinitionFamiliesRequest, CancellationToken) | Initiates the asynchronous execution of the ListTaskDefinitionFamilies operation. | |
ListTaskDefinitions(ListTaskDefinitionsRequest) |
Returns a list of task definitions that are registered to your account. You can filter
the results by family name with the familyPrefix parameter or by status
with the status parameter.
|
|
ListTaskDefinitionsAsync(ListTaskDefinitionsRequest, CancellationToken) | Initiates the asynchronous execution of the ListTaskDefinitions operation. | |
ListTasks(ListTasksRequest) |
Returns a list of tasks for a specified cluster. You can filter the results by family
name, by a particular container instance, or by the desired status of the task with
the family , containerInstance , and desiredStatus
parameters.
|
|
ListTasksAsync(ListTasksRequest, CancellationToken) | Initiates the asynchronous execution of the ListTasks operation. | |
RegisterTaskDefinition(RegisterTaskDefinitionRequest) |
Registers a new task definition from the supplied family and containerDefinitions .
Optionally, you can add data volumes to your containers with the volumes
parameter. For more information about task definition parameters and defaults, see
Amazon
ECS Task Definitions in the Amazon EC2 Container Service Developer Guide.
|
|
RegisterTaskDefinitionAsync(RegisterTaskDefinitionRequest, CancellationToken) | Initiates the asynchronous execution of the RegisterTaskDefinition operation. | |
RunTask(RunTaskRequest) |
Start a task using random placement and the default Amazon ECS scheduler. To use your
own scheduler or place a task on a specific container instance, use StartTask
instead.
The |
|
RunTaskAsync(RunTaskRequest, CancellationToken) | Initiates the asynchronous execution of the RunTask operation. | |
StartTask(StartTaskRequest) |
Starts a new task from the specified task definition on the specified container instance
or instances. To use the default Amazon ECS scheduler to place your task, use RunTask
instead.
The list of container instances to start tasks on is limited to 10. |
|
StartTaskAsync(StartTaskRequest, CancellationToken) | Initiates the asynchronous execution of the StartTask operation. | |
StopTask(StopTaskRequest) |
Stops a running task.
When StopTask is called on a task, the equivalent of |
|
StopTaskAsync(StopTaskRequest, CancellationToken) | Initiates the asynchronous execution of the StopTask operation. | |
UpdateContainerAgent(UpdateContainerAgentRequest) |
Updates the Amazon ECS container agent on a specified container instance. Updating
the Amazon ECS container agent does not interrupt running tasks or services on the
container instance. The process for updating the agent differs depending on whether
your container instance was launched with the Amazon ECS-optimized AMI or another
operating system.
|
|
UpdateContainerAgentAsync(UpdateContainerAgentRequest, CancellationToken) | Initiates the asynchronous execution of the UpdateContainerAgent operation. | |
UpdateService(UpdateServiceRequest) |
Modifies the desired count, deployment configuration, or task definition used in a
service.
You can add to or subtract from the number of instantiations of a task definition
in a service by specifying the cluster that the service is running in and a new You can use UpdateService to modify your task definition and deploy a new version of your service.
You can also update the deployment configuration of a service. When a deployment is
triggered by updating the task definition of a service, the service scheduler uses
the deployment configuration parameters,
If the
The When UpdateService stops a task during a deployment, the equivalent of docker stopis issued to the containers running in the task. This results in a SIGTERM
and a 30-second timeout, after which SIGKILL is sent and the containers
are forcibly stopped. If the container handles the SIGTERM gracefully
and exits within 30 seconds from receiving it, no SIGKILL is sent.
When the service scheduler launches new tasks, it attempts to balance them across the Availability Zones in your cluster with the following logic:
|
|
UpdateServiceAsync(UpdateServiceRequest, CancellationToken) | Initiates the asynchronous execution of the UpdateService operation. |
.NET Framework:
Supported in: 4.5, 4.0, 3.5
.NET for Windows Store apps:
Supported in: Windows 8