AWS Cloud Map Public Dns Namespace
This page shows how to write Terraform and CloudFormation for AWS Cloud Map Public Dns Namespace and write them securely.
aws_service_discovery_public_dns_namespace (Terraform)
The Public Dns Namespace in AWS Cloud Map can be configured in Terraform with the resource name aws_service_discovery_public_dns_namespace. The following sections describe 4 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_service_discovery_public_dns_namespace" "this" {
description = var.description
name = var.name
tags = var.tags
}
resource "aws_service_discovery_public_dns_namespace" "namespace" {
name = local.service_namespace
}
resource "aws_service_discovery_service" "gubernator" {
name = local.gubernator_service_discovery
resource "aws_service_discovery_public_dns_namespace" "namespace" {
count = var.namespace_type == "public" ? 1 : 0
name = var.name
description = var.description
}
resource "aws_service_discovery_public_dns_namespace" "service-dns-sd" {
name = var.service_discovery_dns
}
resource "aws_service_discovery_service" "service-sd" {
name = var.service_discovery_name
Parameters
-
arnoptional computed - string -
descriptionoptional - string -
hosted_zoneoptional computed - string -
idoptional computed - string -
namerequired - string -
tagsoptional - map from string to string
Explanation in Terraform Registry
Provides a Service Discovery Public DNS Namespace resource.
AWS::ServiceDiscovery::PublicDnsNamespace (CloudFormation)
The PublicDnsNamespace in ServiceDiscovery can be configured in CloudFormation with the resource name AWS::ServiceDiscovery::PublicDnsNamespace. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
Descriptionoptional - String -
Propertiesoptional - Properties -
Tagsoptional - List of Tag -
Namerequired - String
Explanation in CloudFormation Registry
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.comand name your servicebackend, the resulting DNS name for the service isbackend.example.com. You can discover instances that were registered with a public DNS namespace by using either aDiscoverInstancesrequest or using DNS. For the current quota on the number of namespaces that you can create using the same AWS account, see AWS Cloud Map quotas in the AWS Cloud Map Developer Guide.Important The
CreatePublicDnsNamespaceAPI operation is not supported in the AWS GovCloud (US) Regions.
Frequently asked questions
What is AWS Cloud Map Public Dns Namespace?
AWS Cloud Map Public Dns Namespace is a resource for Cloud Map of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Cloud Map Public Dns Namespace?
For Terraform, the niveklabs/aws, mailgun/gubernator and figurate/terraform-aws-service-discovery-namespace source code examples are useful. See the Terraform Example section for further details.