AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
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.
For .NET Core this operation is only available in asynchronous form. Please refer to CreatePrivateDnsNamespaceAsync.
Namespace: Amazon.ServiceDiscovery
Assembly: AWSSDK.ServiceDiscovery.dll
Version: 3.x.y.z
public virtual CreatePrivateDnsNamespaceResponse CreatePrivateDnsNamespace( CreatePrivateDnsNamespaceRequest request )
Container for the necessary parameters to execute the CreatePrivateDnsNamespace service method.
Exception | Condition |
---|---|
DuplicateRequestException | The operation is already in progress. |
InvalidInputException | One or more specified values aren't valid. For example, a required value might be missing, a numeric value might be outside the allowed range, or a string value might exceed length constraints. |
NamespaceAlreadyExistsException | The namespace that you're trying to create already exists. |
ResourceLimitExceededException | The resource can't be created because you've reached the quota on the number of resources. |
TooManyTagsException | The list of tags on the resource is over the quota. The maximum number of tags that can be applied to a resource is 50. |
Example: Create private DNS namespace
var client = new AmazonServiceDiscoveryClient(); var response = client.CreatePrivateDnsNamespace(new CreatePrivateDnsNamespaceRequest { CreatorRequestId = "eedd6892-50f3-41b2-8af9-611d6e1d1a8c", Name = "example.com", Vpc = "vpc-1c56417b" }); string operationId = response.OperationId;
.NET Framework:
Supported in: 4.5 and newer, 3.5