AWS Cloud Map ExecModule
Overview
AwsCloudMapModule inventories AWS Cloud Map namespaces in a region and reads the service summaries for a selected namespace. Platform teams can use the results to reconcile a service catalog, check for expected registrations after a deployment, or collect service discovery context during an incident.
Use the namespace inventory to find the right discovery scope, then pass its ID or ARN to the service inventory. The service summaries include the registered instance count when AWS provides it. Pair the inventory with telemetry or health checks when you need to determine whether an application can serve traffic.
Usage
- Create an AWS Cloud Map connection in the Integration Account Console. Verify the connection and confirm it is
READY. - Add AWS Cloud Map to a Workflow Studio task, select the connection under General > Connection, and enter the AWS region.
- Run
list_namespacesto find the namespace. Map its ID or ARN tonamespaceIdon alist_servicestask. Use the ARN for a namespace shared with your account. - Check
statusbefore using the inventory. IfhasMoreis true, passnextTokento a subsequent invocation with the same parameters.
Inputs
| Input | Type | Required | Default | Purpose |
|---|---|---|---|---|
operation | string | No | list_namespaces | Select list_namespaces or list_services. |
region | string | Yes | — | Commercial AWS or AWS GovCloud region to query. |
namespaceId | string | For list_services | — | Cloud Map namespace ID beginning with ns- or a namespace ARN in the selected region and partition. Use the ARN for shared namespaces. Omit for list_namespaces. |
pageSize | integer | No | 50 | Request 1–100 results per page. |
nextToken | string | No | — | Opaque continuation token from the preceding page, up to 4,096 printable ASCII characters. |
Outputs
| Output | Meaning |
|---|---|
status | success or error. |
operation, region, namespaceId | Request scope when available. namespaceId identifies the namespace queried by list_services. |
namespaces | One page of namespace summaries with namespaceId and, when available, arn, name, type, and serviceCount. |
services | One page of service summaries with serviceId and, when available, arn, name, type, and instanceCount. |
hasMore, nextToken | Whether AWS returned a continuation token and the token when present. |
requestId | AWS request reference when available. |
error | Redacted failure with code, message, retryable, and httpStatus when available. |
IntegrationAccount Requirements
Use a verified IntegrationAccount with account name AWS and status READY. Store the key pair in the protected AWS Access Key ID and AWS Secret Access Key fields. The module signs regional requests with AWS Signature Version 4. This connector supports a basic access key pair. Session-token and assumed-role credentials are outside its scope.
Grant servicediscovery:ListNamespaces for namespace inventory and servicediscovery:ListServices for service inventory. AWS requires Resource: "*" for these list actions because neither accepts an individual resource ARN in an IAM policy. Grant only the actions the workflow needs. AWS Cloud Map authorization reference
Configuration
Select the verified AWS connection and enter the region in the task. The module derives the regional Cloud Map HTTPS endpoint from the region. Use a separate invocation for each connection, region, and namespace you want to inventory. Keep credentials in the protected connection fields. The module rejects custom endpoints and inline credentials.
Operations
list_namespacescallsListNamespacesfor one page of regional namespaces that the AWS account owns or that are shared with it. Compare names and types with your expected discovery scopes, or pass a namespace identifier to the service operation. AWS ListNamespaces referencelist_servicescallsListServicesfor one page of services associated with the specified namespace. The request uses aNAMESPACE_IDequality filter. Use the summaries to reconcile expected services or investigate a change in registration count. AWS ListServices reference · AWS service filter reference
Errors and Failure Modes
- For
VALIDATION_ERROR, check the operation, region, page size, and namespace identifier. If you supplied an ARN, make sure its region and partition match the selected region. - For
INTEGRATION_ACCOUNT_ERROR, check that the AWS connection is verified,READY, and has both protected key fields. - AWS HTTP errors use the
AWS_CLOUD_MAP_HTTP_prefix followed by the status code. If AWS denies access, verify the IAM list permissions and the selected connection. For a shared namespace, confirm the AWS account can access the share and supply the namespace ARN. Save the AWS request ID if present. INVALID_PROVIDER_RESPONSEmeans the returned page failed a consistency check, such as AWS returning the same continuation token that the request sent. Stop collecting results and inspect the affected request before restarting pagination.- The AWS SDK can retry eligible transient failures up to twice, with up to 15 seconds per attempt and 50 seconds for the whole request. If a request still fails, use the returned
retryableflag to decide whether the workflow should retry. Back off and bound concurrency across inventory runs. If AWS rejects an invalid or expired token, restart pagination without it.
Example
A deployment review can verify that the checkout service appears under the expected private discovery namespace. After finding the namespace with list_namespaces, configure a second task.
{
"operation": "list_services",
"region": "us-west-2",
"namespaceId": "ns-abcdefghijklmnop",
"pageSize": 25
}
A possible result follows.
{
"status": "success",
"operation": "list_services",
"region": "us-west-2",
"namespaceId": "ns-abcdefghijklmnop",
"services": [
{
"serviceId": "srv-abcdefghijklmnop",
"arn": "arn:aws:servicediscovery:us-west-2:123456789012:service/srv-abcdefghijklmnop",
"name": "checkout",
"type": "DNS_HTTP",
"instanceCount": 3
}
],
"hasMore": false
}
The checkout service has three registered instances. The workflow can record that count against its expected inventory and use a separate health check to evaluate readiness.
Notes
- Each invocation reads one page. Keep the connection, operation, region, namespace, and page size fixed while following a continuation token. AWS can return an empty filtered page with another token. Continue while
hasMoreis true, even if the current page contains no services. - Both operations are read-only and safe to repeat. Inventory can change between requests. Use the AWS Cloud Map service quotas when setting a polling schedule. AWS Cloud Map endpoints and quotas
- Instance registration and deregistration, discovery queries, health checks, DNS configuration, and namespace or service changes are outside this connector's scope.