Skip to main content

namespaces

Creates, updates, deletes, gets or lists a namespaces resource.

Overview

Namenamespaces
TypeResource
Idaws.servicediscovery.namespaces

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe Amazon Resource Name (ARN) that Cloud Map assigns to the namespace when you create it.
create_datestring (date-time)The date that the namespace was created, in Unix date/time format and Coordinated Universal Time (UTC). The value of CreateDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
creator_request_idstringA unique string that identifies the request and that allows failed requests to be retried without the risk of running an operation twice.
descriptionstringThe description that you specify for the namespace when you create it.
idstringThe ID of a namespace.
namestringThe name of the namespace, such as example.com. (pattern: <code>^[!-~]{1,1024}$</code>)
propertiesobjectA complex type that contains information that's specific to the type of the namespace.
resource_ownerstringThe ID of the Amazon Web Services account that created the namespace. If this isn't your account ID, it's the ID of the account that shared the namespace with your account. For more information about shared namespaces, see Cross-account Cloud Map namespace sharing in the Cloud Map Developer Guide.
service_countintegerThe number of services that are associated with the namespace.
typestringThe type of the namespace. The methods for discovering instances depends on the value that you specify: HTTP Instances can be discovered only programmatically, using the Cloud Map DiscoverInstances API. DNS_PUBLIC Instances can be discovered using public DNS queries and using the DiscoverInstances API. DNS_PRIVATE Instances can be discovered using DNS queries in VPCs and using the DiscoverInstances API. (DNS_PUBLIC, DNS_PRIVATE, HTTP)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_namespaceselectregionGets information about a namespace.
create_private_dns_namespaceinsertregion, VpcCreates 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.
create_http_namespaceinsertregionCreates an HTTP namespace. Service instances registered using an HTTP namespace can be discovered using a DiscoverInstances request but can't be discovered 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.
update_http_namespaceupdateregionUpdates an HTTP namespace.
delete_namespacedeleteregionDeletes a namespace from the current account. If the namespace still contains one or more services, the request fails.
create_public_dns_namespaceexecregionCreates a public namespace based on DNS, which is visible on the internet. 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. You can discover instances that were registered with a public DNS namespace by 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. The CreatePublicDnsNamespace API operation is not supported in the Amazon Web Services GovCloud (US) Regions.
discover_instances_revisionexecregion, NamespaceName, ServiceNameDiscovers the increasing revision associated with an instance.
list_namespacesexecregionLists summary information about the namespaces that were created by the current Amazon Web Services account and shared with the current Amazon Web Services account.
update_private_dns_namespaceexecregionUpdates a private DNS namespace.
update_public_dns_namespaceexecregionUpdates a public DNS namespace.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Gets information about a namespace.

SELECT
arn,
create_date,
creator_request_id,
description,
id,
name,
properties,
resource_owner,
service_count,
type
FROM aws.servicediscovery.namespaces
WHERE region = '{{ region }}' -- required
;

INSERT examples

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.

INSERT INTO aws.servicediscovery.namespaces (
Name,
CreatorRequestId,
Description,
Vpc,
Tags,
Properties,
region
)
SELECT
'{{ Name }}',
'{{ CreatorRequestId }}',
'{{ Description }}',
'{{ Vpc }}' /* required */,
'{{ Tags }}',
'{{ Properties }}',
'{{ region }}'
RETURNING
operation_id
;

UPDATE examples

Updates an HTTP namespace.

UPDATE aws.servicediscovery.namespaces
SET
Id = '{{ Id }}',
UpdaterRequestId = '{{ UpdaterRequestId }}',
Namespace = '{{ Namespace }}'
WHERE
region = '{{ region }}' --required
RETURNING
operation_id;

DELETE examples

Deletes a namespace from the current account. If the namespace still contains one or more services, the request fails.

DELETE FROM aws.servicediscovery.namespaces
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Creates a public namespace based on DNS, which is visible on the internet. 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. You can discover instances that were registered with a public DNS namespace by 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. The CreatePublicDnsNamespace API operation is not supported in the Amazon Web Services GovCloud (US) Regions.

EXEC aws.servicediscovery.namespaces.create_public_dns_namespace
@region='{{ region }}' --required
@@json=
'{
"Name": "{{ Name }}",
"CreatorRequestId": "{{ CreatorRequestId }}",
"Description": "{{ Description }}",
"Tags": "{{ Tags }}",
"Properties": "{{ Properties }}"
}'
;