AWS Cloud Map Instance

This page shows how to write Terraform and CloudFormation for AWS Cloud Map Instance and write them securely.

aws_service_discovery_instance (Terraform)

The Instance in AWS Cloud Map can be configured in Terraform with the resource name aws_service_discovery_instance. The following sections describe 1 example of how to use the resource and its parameters.

Example Usage from GitHub
resource "aws_service_discovery_instance" "service-discovery-web-service" {
  instance_id = "web-server-instance-id"
  service_id  =

  attributes = {
    AWS_ALIAS_DNS_NAME = aws_lb.webserver_lb.dns_name

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).


The following arguments are supported:

  • instance_id - (Required, ForceNew) The ID of the service instance.
  • service_id - (Required, ForceNew) The ID of the service that you want to use to create the instance.
  • attributes - (Required) A map contains the attributes of the instance. Check the doc for the supported attributes and syntax.

In addition to all arguments above, the following attributes are exported:

  • id - The ID of the instance.

Explanation in Terraform Registry

Provides a Service Discovery Instance resource.

AWS::ServiceDiscovery::Instance (CloudFormation)

The Instance in ServiceDiscovery can be configured in CloudFormation with the resource name AWS::ServiceDiscovery::Instance. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.


Explanation in CloudFormation Registry

A complex type that contains information about an instance that AWS Cloud Map creates when you submit a RegisterInstance request.

Frequently asked questions

What is AWS Cloud Map Instance?

AWS Cloud Map Instance 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 Instance?

For Terraform, the vadhri/cloud-tech-notebook source code example is useful. See the Terraform Example section for further details.