Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
@aws-sdk/client-ecs
Advanced tools
AWS SDK for JavaScript Ecs Client for Node.js, Browser and React Native
@aws-sdk/client-ecs is a part of the AWS SDK for JavaScript, which allows developers to interact with the Amazon Elastic Container Service (ECS). ECS is a fully managed container orchestration service that makes it easy to deploy, manage, and scale containerized applications using Docker. This package provides a set of APIs to manage ECS clusters, services, tasks, and more.
Create Cluster
This feature allows you to create a new ECS cluster. The code sample demonstrates how to create a cluster named 'my-cluster' using the ECSClient and CreateClusterCommand.
const { ECSClient, CreateClusterCommand } = require('@aws-sdk/client-ecs');
const client = new ECSClient({ region: 'us-west-2' });
const command = new CreateClusterCommand({ clusterName: 'my-cluster' });
client.send(command).then(
(data) => console.log(data),
(error) => console.error(error)
);
Register Task Definition
This feature allows you to register a new task definition. The code sample demonstrates how to register a task definition with a single container named 'my-container' using the ECSClient and RegisterTaskDefinitionCommand.
const { ECSClient, RegisterTaskDefinitionCommand } = require('@aws-sdk/client-ecs');
const client = new ECSClient({ region: 'us-west-2' });
const command = new RegisterTaskDefinitionCommand({
family: 'my-task-family',
containerDefinitions: [
{
name: 'my-container',
image: 'my-image',
memory: 512,
cpu: 256,
essential: true,
},
],
});
client.send(command).then(
(data) => console.log(data),
(error) => console.error(error)
);
Run Task
This feature allows you to run a task on an ECS cluster. The code sample demonstrates how to run a task using a task definition named 'my-task-family' on a cluster named 'my-cluster' using the ECSClient and RunTaskCommand.
const { ECSClient, RunTaskCommand } = require('@aws-sdk/client-ecs');
const client = new ECSClient({ region: 'us-west-2' });
const command = new RunTaskCommand({
cluster: 'my-cluster',
taskDefinition: 'my-task-family',
count: 1,
});
client.send(command).then(
(data) => console.log(data),
(error) => console.error(error)
);
List Services
This feature allows you to list the services running in an ECS cluster. The code sample demonstrates how to list services in a cluster named 'my-cluster' using the ECSClient and ListServicesCommand.
const { ECSClient, ListServicesCommand } = require('@aws-sdk/client-ecs');
const client = new ECSClient({ region: 'us-west-2' });
const command = new ListServicesCommand({ cluster: 'my-cluster' });
client.send(command).then(
(data) => console.log(data),
(error) => console.error(error)
);
Dockerode is a Docker client for Node.js. It provides a way to interact with Docker containers, images, and other Docker resources. Unlike @aws-sdk/client-ecs, which is specific to AWS ECS, Dockerode is a more general-purpose Docker client that can be used with any Docker environment.
Kubernetes-client is a Node.js client for the Kubernetes API. It allows developers to interact with Kubernetes clusters, manage pods, services, deployments, and other Kubernetes resources. While @aws-sdk/client-ecs is specific to AWS ECS, kubernetes-client is used for managing Kubernetes clusters, which is another popular container orchestration platform.
Node-docker-api is another Docker client for Node.js. It provides a simple and flexible API to interact with Docker resources. Similar to Dockerode, it is not specific to AWS ECS and can be used with any Docker environment.
FAQs
AWS SDK for JavaScript Ecs Client for Node.js, Browser and React Native
The npm package @aws-sdk/client-ecs receives a total of 364,481 weekly downloads. As such, @aws-sdk/client-ecs popularity was classified as popular.
We found that @aws-sdk/client-ecs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.