Commit Graph
2 Commits
Author SHA1 Message Date
Abhigya 04878b8c57 feat(cloudmap): resolve DNS namespaces and register ECS tasks in them (#4122)
* feat(cloudmap): resolve DNS namespaces and register ECS tasks in them

Cloud Map's control plane already accepted namespaces, services and
instances and read them back correctly, but nothing answered DNS for
<service>.<namespace>. A container that registered successfully still
failed to resolve its peers, and the gap only surfaced at application
runtime because every API call looked right.

The embedded DNS server now consults DnsRecordSource implementations
before forwarding a query upstream, and Cloud Map provides one: a DNS
namespace resolves to the AWS_INSTANCE_IPV4 of the instances registered
under it, one A record each. The SPI keeps the direction right, since
core must not import a service. Which instances answer follows Route 53:
the healthy ones while any instance is healthy, all of them when none
is, and at most eight records either way. HTTP namespaces do not
resolve, matching AWS, where they are reachable only through
DiscoverInstances.

An ECS service that declares serviceRegistries now registers each running
task as an instance of the named Cloud Map service, and deregisters it
when the task stops, mirroring EcsLoadBalancerRegistrar. The address is
the task's ENI address on an awsvpc task and the container's Docker
network address otherwise, which is the one a peer container can reach.
Alongside it the instance carries the metadata attributes the ECS
service discovery documentation lists: AVAILABILITY_ZONE, REGION,
ECS_SERVICE_NAME, ECS_CLUSTER_NAME and ECS_TASK_DEFINITION_FAMILY.
serviceRegistries stays raw: registryArn, containerName and
containerPort are the only members anything acts on.

* test(ecs): pin the Cloud Map registration hooks with a docker mode test

EcsServiceDiscoveryRegistrarTest drives the registrar directly, so removing
EcsService's calls to it left every ECS test green. The registration only runs
in docker mode, which the suite mocks out, so nothing covered the wiring.

The new test runs ECS unmocked under a profile, creates a service that declares
serviceRegistries, and drives one reconciler tick to launch a real container. It
asserts the Cloud Map name resolves to the task's ENI address while it runs, and
that stopping the task removes the instance and the answer. Commenting out
either hook fails it: the register hook on the resolve assertion, the deregister
hook on the instance one.

Security-group enforcement goes back to its shipped default of off for the
profile. The suite turns it on and its helper needs rootful Docker, which is a
requirement of security groups rather than of service discovery.

Also corrects the health status deviation note. An instance registered without
AWS_INIT_HEALTH_STATUS starts HEALTHY on AWS too, so the deviation is not the
initial status but that Floci never moves it: AWS registers an ECS task
UNHEALTHY and promotes it once the container health check passes, for a service
that declares HealthCheckCustomConfig.

* fix(cloudmap): retain DNS ownership and ECS registry targets

* fix(cloudmap): keep namespace apex queries authoritative

* style(dns): remove em dash from test heading
2026-09-25 11:11:28 -04:00
Hector Ventura 446697ec71 docs: add AWS Cloud Map service docs, fix service count, add analytics (#1221)
Document AWS Cloud Map (servicediscovery), which was implemented but never
documented, and reconcile related documentation drift:

- Add docs/services/cloudmap.md covering all 22 operations, config, examples
- Bump headline service count from 52 to 53 across README and docs
- Add Cloud Map to the canonical service matrix, README tables, and docs index
- Backfill mkdocs nav with Cloud Map and 7 existing-but-unlisted service docs
- Backfill condensed tables with services missing from them (Transcribe,
  Resource Groups Tagging, Neptune, EventBridge Pipes, CloudFront)
- Add Umami analytics tracking via a Material theme override (overrides/main.html)
2026-06-07 10:44:37 -05:00