Files
floci/docker/localstack-parity.sh
T
Hector Ventura 265344e304 feat(docs): add a service inventory reconciler and fix what it found (#3656)
* feat(docs): add a service inventory reconciler and fix what it found

"How many AWS services does Floci support?" had no answer anyone could defend.
Every source in the repo gave a different number, and two of them were written
down and contradicted each other: docker/localstack-parity.sh said Floci starts
"all 41 services" while migrate-from-localstack.md said "all 58". Neither is
close: the catalog registers 124 descriptors today.

tools/docs/service_inventory.py reconciles the five keyspaces that each answer a
slightly different question, and explains every delta rather than picking a
number: catalog descriptors, the config plane (EmulatorConfig accessors against
application.yml keys), Java packages under services/, the docs pages, and the
service matrix. It reports 119 documented services, 127 distinct API surfaces and
124 signing endpoints, and says which to quote for which question. 27 tests cover
the normalisation and the delta arithmetic.

It also enforces the rule that made this necessary: never write a count into
README.md or docs/, link to the Service Matrix instead. So the two stale counts
are removed rather than corrected, and the parity script and migration guide now
say "every service".

Three services the README's category table omitted are added: Lambda MicroVMs,
Cognito Identity and Bedrock AgentCore Control, each backed by a descriptor or a
docs page.

Two service-matrix corrections the reconciler surfaced:

- The sso alias pointed at iam, so the matrix resolved Identity Center's admin
  API to the IAM page's facet. ResolvedServiceCatalog registers
  descriptor("sso", "ssoadmin", ...) and docs/services/ssoadmin.md is its own
  page, so the alias now points there.
- Both bedrock-agentcore deferrals are retired. bedrock-agentcore.md exists now,
  so that entry has served its purpose; bedrock-agentcore-control has no page and
  never needed one, because the control plane owns the shared page, so it becomes
  an alias instead of a deferral that would expire and need renewing. The
  deferred list is now empty.

check_service_matrix.py --strict passes before and after, so the matrix changes
are tidy-up rather than a fix for a failing gate.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* docs: add the STS README row the inventory tool still reported

The tool's own output at the previous head listed STS as the one service
with a Service Matrix row but no README category-table entry, the same
gap this branch closed for Lambda MicroVMs, Cognito Identity and Bedrock
AgentCore Control. Add it next to IAM, so section 5 of the report now
shows zero missing rows.

Also drop the unused pathlib import from the inventory test.

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-09-15 20:36:53 -05:00

79 lines
3.7 KiB
Bash

#!/bin/sh
# Maps LocalStack Community environment variables to their Floci equivalents.
# Sourced by entrypoint.sh when LOCALSTACK_PARITY=true.
# Floci vars always win: every mapping uses ${FLOCI_VAR:-<derived>} so an
# explicitly-set Floci var is never overwritten.
# Storage mode — PERSISTENCE=1 / PERSIST_STATE=1 → persistent storage
if [ -n "${PERSISTENCE:-}" ] || [ -n "${PERSIST_STATE:-}" ]; then
_ls_persist="${PERSISTENCE:-${PERSIST_STATE:-}}"
if [ "${_ls_persist}" = "1" ] || [ "${_ls_persist}" = "true" ]; then
export FLOCI_STORAGE_MODE="${FLOCI_STORAGE_MODE:-persistent}"
fi
fi
# Bind port — EDGE_PORT → FLOCI_PORT
[ -n "${EDGE_PORT:-}" ] && export FLOCI_PORT="${FLOCI_PORT:-${EDGE_PORT}}"
# Hostname returned in response URLs — LOCALSTACK_HOST / LOCALSTACK_HOSTNAME → FLOCI_HOSTNAME
_ls_host="${LOCALSTACK_HOST:-${LOCALSTACK_HOSTNAME:-}}"
[ -n "${_ls_host}" ] && export FLOCI_HOSTNAME="${FLOCI_HOSTNAME:-${_ls_host}}"
# Bind address — GATEWAY_LISTEN → QUARKUS_HTTP_HOST
[ -n "${GATEWAY_LISTEN:-}" ] && export QUARKUS_HTTP_HOST="${QUARKUS_HTTP_HOST:-${GATEWAY_LISTEN}}"
# Log level — LS_LOG / DEBUG=1 → QUARKUS_LOG_LEVEL
if [ -n "${LS_LOG:-}" ]; then
export QUARKUS_LOG_LEVEL="${QUARKUS_LOG_LEVEL:-${LS_LOG}}"
elif [ "${DEBUG:-}" = "1" ]; then
export QUARKUS_LOG_LEVEL="${QUARKUS_LOG_LEVEL:-DEBUG}"
fi
# Lambda — LAMBDA_EXECUTOR is intentionally ignored; Floci always runs Lambda in Docker containers.
# Lambda Docker network
[ -n "${LAMBDA_DOCKER_NETWORK:-}" ] && \
export FLOCI_SERVICES_LAMBDA_DOCKER_NETWORK="${FLOCI_SERVICES_LAMBDA_DOCKER_NETWORK:-${LAMBDA_DOCKER_NETWORK}}"
# Lambda ephemeral containers
if [ "${LAMBDA_REMOVE_CONTAINERS:-}" = "1" ] || [ "${LAMBDA_REMOVE_CONTAINERS:-}" = "true" ]; then
export FLOCI_SERVICES_LAMBDA_EPHEMERAL="${FLOCI_SERVICES_LAMBDA_EPHEMERAL:-true}"
fi
# LAMBDA_REMOTE_DOCKER — not fully supported.
# Floci's hot-reload is per-function opt-in (S3Bucket=hot-reload), not a global bind-mount mode.
if [ -n "${LAMBDA_REMOTE_DOCKER:-}" ]; then
echo "[floci-parity] WARNING: LAMBDA_REMOTE_DOCKER is not fully supported by Floci." >&2
echo "[floci-parity] Use S3Bucket=hot-reload per function instead. See https://floci.io/docs/services/lambda" >&2
fi
# Docker host
[ -n "${DOCKER_HOST:-}" ] && export FLOCI_DOCKER_DOCKER_HOST="${FLOCI_DOCKER_DOCKER_HOST:-${DOCKER_HOST}}"
# Docker network — shared across all container-based services (Lambda, RDS, ElastiCache, MSK, OpenSearch, EKS).
# Per-service overrides (e.g. FLOCI_SERVICES_LAMBDA_DOCKER_NETWORK) take precedence when set.
[ -n "${DOCKER_NETWORK:-}" ] && export FLOCI_SERVICES_DOCKER_NETWORK="${FLOCI_SERVICES_DOCKER_NETWORK:-${DOCKER_NETWORK}}"
# DNS suffixes — register LocalStack and Floci hostname suffixes so that container-to-container
# hostname routing (Function URLs, presigned S3, SQS QueueUrl, etc.) works without manual config.
_parity_suffixes="localhost.localstack.cloud,localhost.floci.io"
if [ -n "${FLOCI_DNS_EXTRA_SUFFIXES:-}" ]; then
export FLOCI_DNS_EXTRA_SUFFIXES="${FLOCI_DNS_EXTRA_SUFFIXES},${_parity_suffixes}"
else
export FLOCI_DNS_EXTRA_SUFFIXES="${_parity_suffixes}"
fi
# TLS — USE_SSL=1 → FLOCI_TLS_ENABLED=true
if [ "${USE_SSL:-0}" = "1" ]; then
export FLOCI_TLS_ENABLED="${FLOCI_TLS_ENABLED:-true}"
fi
# TLS — CUSTOM_SSL_CERT_PATH → FLOCI_TLS_CERT_PATH + FLOCI_TLS_KEY_PATH
# LocalStack uses a single combined PEM (cert+key). Floci accepts it in both fields.
if [ -n "${CUSTOM_SSL_CERT_PATH:-}" ]; then
export FLOCI_TLS_CERT_PATH="${FLOCI_TLS_CERT_PATH:-${CUSTOM_SSL_CERT_PATH}}"
export FLOCI_TLS_KEY_PATH="${FLOCI_TLS_KEY_PATH:-${CUSTOM_SSL_CERT_PATH}}"
fi
# SERVICES: intentionally ignored; Floci starts every service in ~24ms.