Class: AWS.ECS
- Inherits:
-
AWS.Service
- Object
- AWS.Service
- AWS.ECS
- Identifier:
- ecs
- API Version:
- 2014-11-13
- Defined in:
- (unknown)
Overview
Constructs a service interface object. Each API operation is exposed as a function on service.
Service Description
Amazon Elastic Container Service (Amazon ECS) is a highly scalable, fast, container management service. It makes it easy to run, stop, and manage Docker containers. You can host your cluster on a serverless infrastructure that's managed by Amazon ECS by launching your services or tasks on Fargate. For more control, you can host your tasks on a cluster of Amazon Elastic Compute Cloud (Amazon EC2) or External (on-premises) instances that you manage.
Amazon ECS makes it easy to launch and stop container-based applications with simple API calls. This makes it easy to get the state of your cluster from a centralized service, and gives you access to many familiar Amazon EC2 features.
You can use Amazon ECS to schedule the placement of containers across your cluster based on your resource needs, isolation policies, and availability requirements. With Amazon ECS, you don't need to operate your own cluster management and configuration management systems. You also don't need to worry about scaling your management infrastructure.
Sending a Request Using ECS
var ecs = new AWS.ECS();
ecs.createCapacityProvider(params, function (err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Locking the API Version
In order to ensure that the ECS object uses this specific API, you can
construct the object by passing the apiVersion option to the constructor:
var ecs = new AWS.ECS({apiVersion: '2014-11-13'});
You can also set the API version globally in AWS.config.apiVersions using
the ecs service identifier:
AWS.config.apiVersions = {
ecs: '2014-11-13',
// other service API versions
};
var ecs = new AWS.ECS();
Waiter Resource States
This service supports a list of resource states that can be polled using the waitFor() method. The resource states are:
tasksRunning, tasksStopped, servicesStable, servicesInactive
Constructor Summary collapse
-
new AWS.ECS(options = {}) ⇒ Object
constructor
Constructs a service object.
Property Summary collapse
-
endpoint ⇒ AWS.Endpoint
readwrite
An Endpoint object representing the endpoint URL for service requests.
Properties inherited from AWS.Service
Method Summary collapse
-
createCapacityProvider(params = {}, callback) ⇒ AWS.Request
Creates a new capacity provider.
-
createCluster(params = {}, callback) ⇒ AWS.Request
Creates a new Amazon ECS cluster.
-
createService(params = {}, callback) ⇒ AWS.Request
Runs and maintains your desired number of tasks from a specified task definition.
-
createTaskSet(params = {}, callback) ⇒ AWS.Request
Create a task set in the specified cluster and service.
-
deleteAccountSetting(params = {}, callback) ⇒ AWS.Request
Disables an account setting for a specified user, role, or the root user for an account.
.
-
deleteAttributes(params = {}, callback) ⇒ AWS.Request
Deletes one or more custom attributes from an Amazon ECS resource.
.
-
deleteCapacityProvider(params = {}, callback) ⇒ AWS.Request
Deletes the specified capacity provider.
Note: TheFARGATEandFARGATE_SPOTcapacity providers are reserved and can't be deleted.- deleteCluster(params = {}, callback) ⇒ AWS.Request
Deletes the specified cluster.
- deleteService(params = {}, callback) ⇒ AWS.Request
Deletes a specified service within a cluster.
- deleteTaskDefinitions(params = {}, callback) ⇒ AWS.Request
Deletes one or more task definitions.
You must deregister a task definition revision before you delete it.
- deleteTaskSet(params = {}, callback) ⇒ AWS.Request
Deletes a specified task set within a service.
- deregisterContainerInstance(params = {}, callback) ⇒ AWS.Request
Deregisters an Amazon ECS container instance from the specified cluster.
- deregisterTaskDefinition(params = {}, callback) ⇒ AWS.Request
Deregisters the specified task definition by family and revision.
- describeCapacityProviders(params = {}, callback) ⇒ AWS.Request
Describes one or more of your capacity providers.
.
- describeClusters(params = {}, callback) ⇒ AWS.Request
Describes one or more of your clusters.
.
- describeContainerInstances(params = {}, callback) ⇒ AWS.Request
Describes one or more container instances.
- describeServices(params = {}, callback) ⇒ AWS.Request
Describes the specified services running in your cluster.
.
- describeTaskDefinition(params = {}, callback) ⇒ AWS.Request
Describes a task definition.
- describeTasks(params = {}, callback) ⇒ AWS.Request
Describes a specified task or tasks.
Currently, stopped tasks appear in the returned results for at least one hour.
If you have tasks with tags, and then delete the cluster, the tagged tasks are returned in the response.
- describeTaskSets(params = {}, callback) ⇒ AWS.Request
Describes the task sets in the specified cluster and service.
- discoverPollEndpoint(params = {}, callback) ⇒ AWS.Request
Note: This action is only used by the Amazon ECS agent, and it is not intended for use outside of the agent.- executeCommand(params = {}, callback) ⇒ AWS.Request
Runs a command remotely on a container within a task.
If you use a condition key in your IAM policy to refine the conditions for the policy statement, for example limit the actions to a specific cluster, you receive an
AccessDeniedExceptionwhen there is a mismatch between the condition key value and the corresponding parameter value.For information about required permissions and considerations, see Using Amazon ECS Exec for debugging in the Amazon ECS Developer Guide.
- getTaskProtection(params = {}, callback) ⇒ AWS.Request
Retrieves the protection status of tasks in an Amazon ECS service.
.
- listAccountSettings(params = {}, callback) ⇒ AWS.Request
Lists the account settings for a specified principal.
.
- listAttributes(params = {}, callback) ⇒ AWS.Request
Lists the attributes for Amazon ECS resources within a specified target type and cluster.
- listClusters(params = {}, callback) ⇒ AWS.Request
Returns a list of existing clusters.
.
- listContainerInstances(params = {}, callback) ⇒ AWS.Request
Returns a list of container instances in a specified cluster.
- listServices(params = {}, callback) ⇒ AWS.Request
Returns a list of services.
- listServicesByNamespace(params = {}, callback) ⇒ AWS.Request
This operation lists all of the services that are associated with a Cloud Map namespace.
- listTagsForResource(params = {}, callback) ⇒ AWS.Request
List the tags for an Amazon ECS resource.
.
- listTaskDefinitionFamilies(params = {}, callback) ⇒ AWS.Request
Returns a list of task definition families that are registered to your account.
- listTaskDefinitions(params = {}, callback) ⇒ AWS.Request
Returns a list of task definitions that are registered to your account.
- listTasks(params = {}, callback) ⇒ AWS.Request
Returns a list of tasks.
- putAccountSetting(params = {}, callback) ⇒ AWS.Request
Modifies an account setting.
- putAccountSettingDefault(params = {}, callback) ⇒ AWS.Request
Modifies an account setting for all users on an account for whom no individual account setting has been specified.
- putAttributes(params = {}, callback) ⇒ AWS.Request
Create or update an attribute on an Amazon ECS resource.
- putClusterCapacityProviders(params = {}, callback) ⇒ AWS.Request
Modifies the available capacity providers and the default capacity provider strategy for a cluster.
You must specify both the available capacity providers and a default capacity provider strategy for the cluster.
- registerContainerInstance(params = {}, callback) ⇒ AWS.Request
Note: This action is only used by the Amazon ECS agent, and it is not intended for use outside of the agent.- registerTaskDefinition(params = {}, callback) ⇒ AWS.Request
Registers a new task definition from the supplied
familyandcontainerDefinitions.- runTask(params = {}, callback) ⇒ AWS.Request
Starts a new task using the specified task definition.
Note: On March 21, 2024, a change was made to resolve the task definition revision before authorization.- startTask(params = {}, callback) ⇒ AWS.Request
Starts a new task from the specified task definition on the specified container instance or instances.
Note: On March 21, 2024, a change was made to resolve the task definition revision before authorization.- stopTask(params = {}, callback) ⇒ AWS.Request
Stops a running task.
- submitAttachmentStateChanges(params = {}, callback) ⇒ AWS.Request
Note: This action is only used by the Amazon ECS agent, and it is not intended for use outside of the agent.- submitContainerStateChange(params = {}, callback) ⇒ AWS.Request
Note: This action is only used by the Amazon ECS agent, and it is not intended for use outside of the agent.- submitTaskStateChange(params = {}, callback) ⇒ AWS.Request
Note: This action is only used by the Amazon ECS agent, and it is not intended for use outside of the agent.- tagResource(params = {}, callback) ⇒ AWS.Request
Associates the specified tags to a resource with the specified
resourceArn.- untagResource(params = {}, callback) ⇒ AWS.Request
Deletes specified tags from a resource.
.
- updateCapacityProvider(params = {}, callback) ⇒ AWS.Request
Modifies the parameters for a capacity provider.
.
- updateCluster(params = {}, callback) ⇒ AWS.Request
Updates the cluster.
.
- updateClusterSettings(params = {}, callback) ⇒ AWS.Request
Modifies the settings to use for a cluster.
.
- updateContainerAgent(params = {}, callback) ⇒ AWS.Request
Updates the Amazon ECS container agent on a specified container instance.
- updateContainerInstancesState(params = {}, callback) ⇒ AWS.Request
Modifies the status of an Amazon ECS container instance.
Once a container instance has reached an
ACTIVEstate, you can change the status of a container instance toDRAININGto manually remove an instance from a cluster, for example to perform system updates, update the Docker daemon, or scale down the cluster size.A container instance can't be changed to
DRAININGuntil it has reached anACTIVEstatus.- updateService(params = {}, callback) ⇒ AWS.Request
Modifies the parameters of a service.
Note: On March 21, 2024, a change was made to resolve the task definition revision before authorization.- updateServicePrimaryTaskSet(params = {}, callback) ⇒ AWS.Request
Modifies which task set in a service is the primary task set.
- updateTaskProtection(params = {}, callback) ⇒ AWS.Request
Updates the protection status of a task.
- updateTaskSet(params = {}, callback) ⇒ AWS.Request
Modifies a task set.
- waitFor(state, params = {}, callback) ⇒ AWS.Request
Waits for a given ECS resource.
Methods inherited from AWS.Service
makeRequest, makeUnauthenticatedRequest, setupRequestListeners, defineService
Constructor Details
new AWS.ECS(options = {}) ⇒ Object
Constructs a service object. This object has one method for each API operation.
Property Details
Method Details
createCapacityProvider(params = {}, callback) ⇒ AWS.Request
Creates a new capacity provider. Capacity providers are associated with an Amazon ECS cluster and are used in capacity provider strategies to facilitate cluster auto scaling.
Only capacity providers that use an Auto Scaling group can be created. Amazon ECS tasks on Fargate use the
FARGATEandFARGATE_SPOTcapacity providers. These providers are available to all accounts in the Amazon Web Services Regions that Fargate supports.createCluster(params = {}, callback) ⇒ AWS.Request
Creates a new Amazon ECS cluster. By default, your account receives a
defaultcluster when you launch your first container instance. However, you can create your own cluster with a unique name.Note: 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.createService(params = {}, callback) ⇒ AWS.Request
Runs and maintains your desired number of tasks from a specified task definition. If the number of tasks running in a service drops below the
desiredCount, Amazon ECS runs another copy of the task in the specified cluster. To update an existing service, use UpdateService.Note: On March 21, 2024, a change was made to resolve the task definition revision before authorization. When a task definition revision is not specified, authorization will occur using the latest revision of a task definition.In addition to maintaining the desired count of tasks in your service, you can optionally run your service behind one or more load balancers. The load balancers distribute traffic across the tasks that are associated with the service. For more information, see Service load balancing in the Amazon Elastic Container Service Developer Guide.
- deleteCluster(params = {}, callback) ⇒ AWS.Request