create_private_dns_namespace
¶
create_private_dns_namespace(
name: NamespaceNamePrivate,
vpc: ResourceId,
*,
config_overrides: Optional[ServiceDiscoveryClientConfig] = None,
creator_request_id: Optional[ResourceId] = None,
description: Optional[ResourceDescription] = None,
tags: Optional[TagList] = None,
properties: Optional[PrivateDnsNamespaceProperties] = None,
) -> 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.
Parameters:
-
name(NamespaceNamePrivate) –The name that you want to assign to this namespace. When you create a private DNS namespace, Cloud Map automatically creates an Amazon Route 53 private hosted zone that has the same name as the namespace.
-
creator_request_id(Optional[ResourceId], default:None) –A unique string that identifies the request and that allows failed
CreatePrivateDnsNamespacerequests to be retried without the risk of running the operation twice.CreatorRequestIdcan be any unique string (for example, a date/timestamp). -
description(Optional[ResourceDescription], default:None) –A description for the namespace.
-
vpc(ResourceId) –The ID of the Amazon VPC that you want to associate the namespace with.
-
tags(Optional[TagList], default:None) –The tags to add to the namespace. Each tag consists of a key and an optional value that you define. Tags keys can be up to 128 characters in length, and tag values can be up to 256 characters in length.
-
properties(Optional[PrivateDnsNamespaceProperties], default:None) –Properties for the private DNS namespace.
Raises:
-
DuplicateRequest–The operation is already in progress.
-
InvalidInput–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.
-
NamespaceAlreadyExists–The namespace that you're trying to create already exists.
-
ResourceLimitExceeded–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.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Example: Create private DNS namespace Example: Create private DNS namespace
>>> client.create_private_dns_namespace(name='example.com', vpc='vpc-1c56417b', creator_request_id='eedd6892-50f3-41b2-8af9-611d6e1d1a8c')
Source code in docs_src/capo_servicediscovery/_services/service_discovery.py
313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 | |