servicediscovery function

AWS Cloud Map

AWS Cloud Map

Cloud Map

With Cloud Map, you can configure public DNS, private DNS, or HTTP namespaces that your microservice applications run in. When an instance becomes available, you can call the Cloud Map API to register the instance with Cloud Map. For public or private DNS namespaces, Cloud Map automatically creates DNS records and an optional health check. Clients that submit public or private DNS queries, or HTTP requests, for the service receive an answer that contains up to eight healthy records.

servicediscovery( config = list(), credentials = list(), endpoint = NULL, region = NULL )

Arguments

  • config: Optional configuration of credentials, endpoint, and/or region.

    • credentials :

      • creds :

        • access_key_id : AWS access key ID
        • secret_access_key : AWS secret access key
        • session_token : AWS temporary session token
      • profile : The name of a profile to use. If not given, then the default profile is used.

      • anonymous : Set anonymous credentials.

    • endpoint : The complete URL to use for the constructed client.

    • region : The AWS Region used in instantiating the client.

    • close_connection : Immediately close all HTTP connections.

    • timeout : The time in seconds till a timeout exception is thrown when attempting to make a connection. The default is 60 seconds.

    • s3_force_path_style : Set this to true to force the request to use path-style addressing, i.e. http://s3.amazonaws.com/BUCKET/KEY.

    • sts_regional_endpoint : Set sts regional endpoint resolver to regional or legacy https://docs.aws.amazon.com/sdkref/latest/guide/feature-sts-regionalized-endpoints.html

  • credentials: Optional credentials shorthand for the config parameter

    • creds :

      • access_key_id : AWS access key ID
      • secret_access_key : AWS secret access key
      • session_token : AWS temporary session token
    • profile : The name of a profile to use. If not given, then the default profile is used.

    • anonymous : Set anonymous credentials.

  • endpoint: Optional shorthand for complete URL to use for the constructed client.

  • region: Optional shorthand for AWS Region used in instantiating the client.

Returns

A client for the service. You can call the service's operations using syntax like svc$operation(...), where svc is the name you've assigned to the client. The available operations are listed in the Operations section.

Service syntax

svc <- servicediscovery(
  config = list(
    credentials = list(
 creds = list(
   access_key_id = "string",
   secret_access_key = "string",
   session_token = "string"
 ),
 profile = "string",
 anonymous = "logical"
    ),
    endpoint = "string",
    region = "string",
    close_connection = "logical",
    timeout = "numeric",
    s3_force_path_style = "logical",
    sts_regional_endpoint = "string"
  ),
  credentials = list(
    creds = list(
 access_key_id = "string",
 secret_access_key = "string",
 session_token = "string"
    ),
    profile = "string",
    anonymous = "logical"
  ),
  endpoint = "string",
  region = "string"
)

Operations

create_http_namespaceCreates an HTTP namespace
create_private_dns_namespaceCreates a private namespace based on DNS, which is visible only inside a specified Amazon VPC
create_public_dns_namespaceCreates a public namespace based on DNS, which is visible on the internet
create_serviceCreates a service
delete_namespaceDeletes a namespace from the current account
delete_serviceDeletes a specified service and all associated service attributes
delete_service_attributesDeletes specific attributes associated with a service
deregister_instanceDeletes the Amazon Route 53 DNS records and health check, if any, that Cloud Map created for the specified instance
discover_instancesDiscovers registered instances for a specified namespace and service
discover_instances_revisionDiscovers the increasing revision associated with an instance
get_instanceGets information about a specified instance
get_instances_health_statusGets the current health status (Healthy, Unhealthy, or Unknown) of one or more instances that are associated with a specified service
get_namespaceGets information about a namespace
get_operationGets information about any operation that returns an operation ID in the response, such as a CreateHttpNamespace request
get_serviceGets the settings for a specified service
get_service_attributesReturns the attributes associated with a specified service
list_instancesLists summary information about the instances that you registered by using a specified service
list_namespacesLists summary information about the namespaces that were created by the current Amazon Web Services account
list_operationsLists operations that match the criteria that you specify
list_servicesLists summary information for all the services that are associated with one or more namespaces
list_tags_for_resourceLists tags for the specified resource
register_instanceCreates or updates one or more records and, optionally, creates a health check based on the settings in a specified service
tag_resourceAdds one or more tags to the specified resource
untag_resourceRemoves one or more tags from the specified resource
update_http_namespaceUpdates an HTTP namespace
update_instance_custom_health_statusSubmits a request to change the health status of a custom health check to healthy or unhealthy
update_private_dns_namespaceUpdates a private DNS namespace
update_public_dns_namespaceUpdates a public DNS namespace
update_serviceSubmits a request to perform the following operations:
update_service_attributesSubmits a request to update a specified service to add service-level attributes

Examples

## Not run: svc <- servicediscovery() # This example creates an HTTP namespace. svc$create_http_namespace( CreatorRequestId = "example-creator-request-id-0001", Description = "Example.com AWS Cloud Map HTTP Namespace", Name = "example-http.com" ) ## End(Not run)
  • Maintainer: Dyfan Jones
  • License: Apache License (>= 2.0)
  • Last published: 2025-03-17