Skip to content

Cloud Map (Service Discovery)

CloudMock emulates AWS Cloud Map (Service Discovery), supporting namespace management, service registration, instance management, and instance discovery.

OperationStatusNotes
CreateHttpNamespaceSupportedCreates an HTTP namespace
CreatePrivateDnsNamespaceSupportedCreates a private DNS namespace
CreatePublicDnsNamespaceSupportedCreates a public DNS namespace
GetNamespaceSupportedReturns namespace details
ListNamespacesSupportedLists all namespaces
DeleteNamespaceSupportedDeletes a namespace
CreateServiceSupportedCreates a service
GetServiceSupportedReturns service details
ListServicesSupportedLists services
UpdateServiceSupportedUpdates a service
DeleteServiceSupportedDeletes a service
RegisterInstanceSupportedRegisters a service instance
DeregisterInstanceSupportedDeregisters an instance
GetInstanceSupportedReturns instance details
ListInstancesSupportedLists instances for a service
DiscoverInstancesSupportedDiscovers healthy instances
UpdateInstanceCustomHealthStatusSupportedUpdates custom health status
TagResourceSupportedAdds tags to a resource
UntagResourceSupportedRemoves tags from a resource
ListTagsForResourceSupportedLists tags for a resource
import { ServiceDiscoveryClient, CreateHttpNamespaceCommand, CreateServiceCommand } from '@aws-sdk/client-servicediscovery';
const client = new ServiceDiscoveryClient({
endpoint: 'http://localhost:4566',
region: 'us-east-1',
credentials: { accessKeyId: 'test', secretAccessKey: 'test' },
});
const { OperationId } = await client.send(new CreateHttpNamespaceCommand({
Name: 'my-namespace',
}));
await client.send(new CreateServiceCommand({
Name: 'my-service',
NamespaceId: 'ns-12345',
}));
import boto3
client = boto3.client('servicediscovery',
endpoint_url='http://localhost:4566',
region_name='us-east-1',
aws_access_key_id='test',
aws_secret_access_key='test')
client.create_http_namespace(Name='my-namespace')
client.create_service(Name='my-service', NamespaceId='ns-12345')
cloudmock.yml
services:
servicediscovery:
enabled: true
  • DNS namespaces do not create actual Route 53 hosted zones
  • Instance discovery returns registered instances without health filtering
  • Custom health status updates are stored but not used for filtering