Skip to content

Update Service

servicediscovery_update_service R Documentation

Submits a request to perform the following operations:

Description

Submits a request to perform the following operations:

  • Update the TTL setting for existing DnsRecords configurations

  • Add, update, or delete HealthCheckConfig for a specified service

You can't add, update, or delete a HealthCheckCustomConfig configuration.

For public and private DNS namespaces, note the following:

  • If you omit any existing DnsRecords or HealthCheckConfig configurations from an update_service request, the configurations are deleted from the service.

  • If you omit an existing HealthCheckCustomConfig configuration from an update_service request, the configuration isn't deleted from the service.

You can't call update_service and update settings in the following scenarios:

  • When the service is associated with an HTTP namespace

  • When the service is associated with a shared namespace and contains instances that were registered by Amazon Web Services accounts other than the account making the update_service call

When you update settings for a service, Cloud Map also updates the corresponding settings in all the records and health checks that were created by using the specified service.

Usage

servicediscovery_update_service(Id, Service)

Arguments

Id

[required] The ID or Amazon Resource Name (ARN) of the service that you want to update. If the namespace associated with the service is shared with your Amazon Web Services account, specify the service ARN. For more information about shared namespaces, see Cross-account Cloud Map namespace sharing in the Cloud Map Developer Guide

Service

[required] A complex type that contains the new settings for the service. You can specify a maximum of 30 attributes (key-value pairs).

Value

A list with the following syntax:

list(
  OperationId = "string"
)

Request syntax

svc$update_service(
  Id = "string",
  Service = list(
    Description = "string",
    DnsConfig = list(
      DnsRecords = list(
        list(
          Type = "SRV"|"A"|"AAAA"|"CNAME",
          TTL = 123
        )
      )
    ),
    HealthCheckConfig = list(
      Type = "HTTP"|"HTTPS"|"TCP",
      ResourcePath = "string",
      FailureThreshold = 123
    )
  )
)

Examples

## Not run: 
# This example submits a request to replace the DnsConfig and
# HealthCheckConfig settings of a specified service.
svc$update_service(
  Id = "srv-e4anhexample0004",
  Service = list(
    DnsConfig = list(
      DnsRecords = list(
        list(
          TTL = 60L,
          Type = "A"
        )
      )
    ),
    HealthCheckConfig = list(
      FailureThreshold = 2L,
      ResourcePath = "/",
      Type = "HTTP"
    )
  )
)

## End(Not run)