createPrivateDnsNamespace
inline suspend fun ServiceDiscoveryClient.createPrivateDnsNamespace(crossinline block: CreatePrivateDnsNamespaceRequest.Builder.() -> Unit): CreatePrivateDnsNamespaceResponse
Creates a private namespace based on DNS, which is visible only inside a specified Amazon VPC. The namespace defines your service naming scheme. For example, if you name your namespace example.com
and name your service backend
, the resulting DNS name for the service is backend.example.com
. Service instances that are registered using a private DNS namespace can be discovered using either a DiscoverInstances
request or using DNS. For the current quota on the number of namespaces that you can create using the same Amazon Web Services account, see Cloud Map quotas in the Cloud Map Developer Guide.
Samples
fun main() {
//sampleStart
// Example Create private DNS namespace
val resp = serviceDiscoveryClient.createPrivateDnsNamespace {
name = "example.com"
vpc = "vpc-1c56417b"
creatorRequestId = "eedd6892-50f3-41b2-8af9-611d6e1d1a8c"
}
//sampleEnd
}