updateServiceAttributes
abstract suspend fun updateServiceAttributes(input: UpdateServiceAttributesRequest): UpdateServiceAttributesResponse
Submits a request to update a specified service to add service-level attributes.
Samples
fun main() {
//sampleStart
// Updates service attributes using a service ARN instead of service ID, useful when working with
// shared namespaces.
val resp = serviceDiscoveryClient.updateServiceAttributes {
serviceId = "arn:aws:servicediscovery:us-west-2:123456789012:service/srv-abcd1234xmpl5678"
attributes = mapOf<String, String>(
"Port" to "8080",
"Protocol" to "HTTP"
)
}
//sampleEnd
}
fun main() {
//sampleStart
// This example submits a request to update the specified service to add a port attribute with the
// value 80.
val resp = serviceDiscoveryClient.updateServiceAttributes {
serviceId = "srv-e4anhexample0004"
attributes = mapOf<String, String>(
"port" to "80"
)
}
//sampleEnd
}