Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-sdk/client-ecs

Package Overview
Dependencies
Maintainers
5
Versions
448
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/client-ecs

AWS SDK for JavaScript Ecs Client for Node.js, Browser and React Native

  • 3.716.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
478K
decreased by-11.56%
Maintainers
5
Weekly downloads
 
Created

What is @aws-sdk/client-ecs?

@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.

What are @aws-sdk/client-ecs's main functionalities?

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)
);

Other packages similar to @aws-sdk/client-ecs

FAQs

Package last updated on 19 Dec 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc