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

@aws-sdk/client-servicediscovery

Package Overview
Dependencies
Maintainers
4
Versions
427
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/client-servicediscovery

@aws-sdk/client-servicediscovery client

  • 1.0.0-alpha.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
65K
decreased by-0.31%
Maintainers
4
Weekly downloads
 
Created

What is @aws-sdk/client-servicediscovery?

@aws-sdk/client-servicediscovery is a part of the AWS SDK for JavaScript, which allows developers to interact with AWS Cloud Map. AWS Cloud Map is a cloud resource discovery service that lets you define custom names for your application resources, and it maintains the updated location of these dynamically changing resources.

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

Create Service

This feature allows you to create a new service within a specified namespace. The code sample demonstrates how to create a service with DNS configuration.

const { ServiceDiscoveryClient, CreateServiceCommand } = require('@aws-sdk/client-servicediscovery');

const client = new ServiceDiscoveryClient({ region: 'us-west-2' });
const command = new CreateServiceCommand({
  Name: 'my-service',
  NamespaceId: 'ns-12345678',
  DnsConfig: {
    NamespaceId: 'ns-12345678',
    RoutingPolicy: 'MULTIVALUE',
    DnsRecords: [
      {
        Type: 'A',
        TTL: 60
      }
    ]
  }
});

client.send(command).then(
  (data) => console.log(data),
  (error) => console.error(error)
);

Register Instance

This feature allows you to register an instance to a service. The code sample demonstrates how to register an instance with specific attributes like IP address and port.

const { ServiceDiscoveryClient, RegisterInstanceCommand } = require('@aws-sdk/client-servicediscovery');

const client = new ServiceDiscoveryClient({ region: 'us-west-2' });
const command = new RegisterInstanceCommand({
  ServiceId: 'srv-12345678',
  InstanceId: 'i-12345678',
  Attributes: {
    AWS_INSTANCE_IPV4: '192.0.2.44',
    AWS_INSTANCE_PORT: '80'
  }
});

client.send(command).then(
  (data) => console.log(data),
  (error) => console.error(error)
);

Discover Instances

This feature allows you to discover registered instances for a given namespace and service. The code sample demonstrates how to discover instances with a maximum result limit.

const { ServiceDiscoveryClient, DiscoverInstancesCommand } = require('@aws-sdk/client-servicediscovery');

const client = new ServiceDiscoveryClient({ region: 'us-west-2' });
const command = new DiscoverInstancesCommand({
  NamespaceName: 'my-namespace',
  ServiceName: 'my-service',
  MaxResults: 10
});

client.send(command).then(
  (data) => console.log(data),
  (error) => console.error(error)
);

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

FAQs

Package last updated on 10 Jan 2020

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