Files
floci/docs/configuration/advanced/application-yml.md
T
Sam Fakhreddine f912c3b717 feat(servicequotas,ram): add Service Quotas and AWS RAM resource sharing (#2579)
* feat(servicequotas,ram): add Service Quotas and RAM sharing stub

Two Landing Zone Accelerator pipeline prerequisites:
- servicequotas: ListServiceQuotas/GetServiceQuota (+ AWS-default
  variants) over JSON 1.1 with curated real quota codes for codebuild
  and lambda, deterministic generated quotas for other services, and
  offset-token pagination
- ram: EnableSharingWithAwsOrganization returning {returnValue: true}

* feat(ram): model resource shares with the reads LZA's TGW share flow needs

RamController previously registered only /enablesharingwithawsorganization;
every other restJson1 RAM path fell through to S3's /{bucket} template route
and returned an XML error the LZA Lambdas' JSON parser choked on
(SyntaxError: Unexpected token '<'). Adds CreateResourceShare,
GetResourceShares (SELF vs OTHER-ACCOUNTS visibility incl. org/OU
principals), GetResourceShareInvitations (always empty — organization
sharing auto-accepts, matching real AWS), and ListResources with RAM
resource-type derivation.

* fix(ram): show every non-owned share to OTHER-ACCOUNTS callers

Launched-container credentials resolve to the emulator default account,
so LZA's Custom::GetResourceShare Lambda never matches an account-ID
principal check for the account it actually runs in. Principal-based
visibility hid IPAM pool shares from the accepting NetworkVpcStack while
org-ARN shares (TGW) passed, failing Network_VPCs. The Lambda filters
client-side by owningAccountId + name, so returning all non-owned shares
is safe.

* feat(servicequotas): add RequestServiceQuotaIncrease

Persists the requested increase and returns a RequestedServiceQuotaChange
the subsequent Get/List operations can read back. Limitations documented in
docs/services/servicequotas.md.

* fix(config): restore EmrServerless config body lost in rebase

The rebase onto upstream/main collided where both upstream and this branch
declare a new service config interface sharing a trailing body; the
EmrServerless interface was left open, so the file did not parse.

* fix(ram): persist resource shares

* feat(ram): add principal associations and resource-share lifecycle

* fix(test): conform RAM storage test doubles to upstream StorageFactory API

e9826026 introduced SharedStorageFactory overriding StorageFactory.create with
the pre-upstream return type StorageBackend<String,V>; upstream now returns
AccountAwareStorageBackend<V>. Matches the template used by upstream's own
CodeBuildServicePersistenceTest.

* fix(ram): restrict resource-share mutations to the owning account

Every mutating RAM operation resolved the share ARN with a global
all-accounts scan, so any caller holding an ARN could rename, retag,
associate resources into, or delete another account's resource share.
Thread the caller's account into the mutation paths and resolve the
share only within it; a non-owner now gets the same
UnknownResourceException an unknown ARN gets, matching AWS, which
resolves share ARNs inside the caller's account. Read visibility under
OTHER-ACCOUNTS is unchanged.

* fix(ram): return 400 SerializationException for a malformed request body

An unparseable body left readTree throwing UncheckedIOException, which
escaped the controller and surfaced as a 500 InternalFailure. Reject it
with the modeled restJson1 client error instead.

* fix(config): restore the bedrock-agent-core-control enabled flag

A rebase left the key with a null body in both the main and test
application.yml, silently dropping the service's enabled flag.

* docs(servicequotas): fix the docs path in the consumer test javadoc

* docs: correct the service count and the Service Quotas and RAM matrix rows

docs/index.md still claimed 75 services and listed RAM under JSON 1.1;
the canonical count in docs/services/index.md is 78 and RAM speaks
restJson1. Bring the Service Quotas row up to its five handled actions
and the RAM row up to its twelve REST operations.

* docs(tooling): acknowledge the RAM controller in the docs registry

RAM's action table is hand-written and carries a method-and-path column
the generator does not emit, so register it as a deferred handler rather
than a rest-mode source.

* test(ram): cover owner mutation over HTTP and pin the non-owner error message

The ownership checks were asserted only against the service; nothing
exercised the caller account the controller now threads through, so a
mismatch between the identity stamped at create time and the one
resolved at delete time would have gone unnoticed. Select the existing
SELF assertion by share name, since the store is shared across the
class.

* docs(ram): generate the action table from the controller

The RAM table was hand-written and only acknowledged in the docs
registry, so the drift sentinel could never fire on it. Fold the method
and path into each description the way the FIS REST controller's doc
does, add the generator markers, and register the controller as a
rest-mode source. Also record that mutations are owner-only.

* fix(ram): enforce the modeled resourceOwner enum on the share read paths

GetResourceShares, ListPrincipals and ListResources all read resourceOwner and
fed it to a two-way visibility fork: "SELF" meant owned shares, and literally
anything else meant OTHER-ACCOUNTS. The model enumerates exactly SELF and
OTHER-ACCOUNTS, so a caller who sent "self" or "OTHER_ACCOUNTS" was silently
handed the inverse of what they asked for rather than the InvalidParameterException
AWS returns — an error all three operations list.

Validated at the three entry points rather than inside the per-share visibility
check, so the rejection does not depend on the store being non-empty.

* test(ram): cover the resourceOwner enum rejection on the HTTP path

The service-level test proved the check; this pins the wire behaviour LZA
actually exercises. RamController substitutes "SELF" via asText("SELF") only for
an absent or null resourceOwner, so a present-but-unmodelled value — including a
non-string that Jackson coerces — must still reach the service and surface as a
400 InvalidParameterException on all three read routes. The absent case is
asserted to still return 200, so the default is not silently changed.

* fix(ram): stop exposing the contents of a deleted resource share

ListResources and ListPrincipals reported a deleted share's resources
as AVAILABLE to non-owning consumers. Both now skip DELETED shares,
while GetResourceShares keeps returning the share with DELETED status,
matching the retention window real RAM applies.

* fix(ram): reject a malformed GetResourceShareInvitations body

The endpoint ignores its body semantically, but malformed JSON is a
client error: it now goes through readTree and answers the modeled 400
SerializationException instead of 200 with an empty list.

* fix(ram): reject mutations on DELETED resource shares

A deleted share stays readable via GetResourceShares for the retention
window, but real RAM treats it as terminal: update, associate,
disassociate, tag, untag, and a second delete all raise
UnknownResourceException. findOwnedShare now filters DELETED so every
mutation path resolves a deleted share the same as an unknown ARN.

* fix(ram): apply the GetResourceShares filters and advance lastUpdatedTime

Four response-fidelity gaps from the maintainer review, interleaved in
the same two files:

GetResourceShares read only resourceOwner, so name, resourceShareArns
and resourceShareStatus were silently dropped and a caller narrowing by
share name got every visible share back. All three are applied now, and
an unmodelled resourceShareStatus is rejected with
InvalidParameterException the way resourceOwner already is.

lastUpdatedTime never advanced: ResourceShare had no such field and
creationTime was echoed in its place, on the share node, on the
association rows, and on ListPrincipals. The field now exists and is
stamped in putForOwner, the single seam every create and mutation
already passes through. State written before the field existed reads
back with creationTime, which is correct for a share never mutated
since.

Shares also report the modeled featureSet (STANDARD — floci has no path
to produce a policy-derived share), and DeleteResourceShare echoes the
clientToken the caller sent, both of which the model carries.

* docs(ram): record the filter support and the unrouted-operation behavior

* fix(ram): require resourceOwner on the share read paths

GetResourceShares, ListPrincipals and ListResources all substituted
SELF for a missing resourceOwner, which the model marks required. That
answered a question the caller never asked, and answered it with the
caller's own shares rather than an error. All three now pass a missing
or null value to the validator that already rejected unmodelled ones,
so it surfaces as InvalidParameterException.

* docs(ram): name GetResourceShareAssociations in the fall-through note

Per review, the unrouted-operation note is more useful if it names the
operation Terraform's association resources read on every refresh, and
says the symptom is an S3 NoSuchBucket XML body rather than a
credentials problem.

* fix(ram): reject trailing tokens after a valid JSON body

Jackson's default readTree stops at the first complete value, so a body
like "{} not-json" parsed as an empty object and the request executed
instead of returning the modeled 400 SerializationException. Read with
FAIL_ON_TRAILING_TOKENS, the convention the JSON 1.0/1.1 controllers,
FIS, Signin and EventBridge already follow.

* fix(servicequotas): validate the ServiceCode shape

ServiceCode was only checked for emptiness. Because an unknown code
deliberately generates a quota catalog, that meant a caller typoing
"!!!" got three invented quotas back instead of an error. Validate
against the modeled [a-zA-Z][a-zA-Z0-9-]{1,63} and 63-character cap;
unknown-but-well-formed codes keep generating as before.
2026-08-26 21:04:30 -04:00

17 KiB

application.yml Reference

!!! note "Source builds only" This page is for users who build Floci from source or mount a custom application.yml into the container. If you run the published Docker image, you don't need this file — all settings are configured through FLOCI_* environment variables. See the Environment Variables Reference for the complete list.

All settings can be provided as YAML (in src/main/resources/application.yml or mounted as a config file) or overridden via environment variables using the FLOCI_ prefix with dots and dashes replaced by underscores.

URL configuration

Floci generates absolute URLs for certain response fields (SQS queue URLs, SNS subscription endpoints, pre-signed S3 URLs). Two settings control the hostname embedded in those URLs:

Setting Env variable Default Description
floci.base-url FLOCI_BASE_URL http://localhost:4566 Full base URL used to build response URLs. Change the scheme, host, and port together.
floci.hostname FLOCI_HOSTNAME (none) Override only the hostname in base-url. Useful in Docker Compose where localhost is unreachable from other containers.

When floci.hostname is set it replaces just the host portion of base-url, leaving the scheme and port unchanged. Setting FLOCI_HOSTNAME: floci is equivalent to changing base-url from http://localhost:4566 to http://floci:4566.

Example — Docker Compose multi-container setup:

environment:
  FLOCI_HOSTNAME: floci   # matches the compose service name

See Docker Compose — Multi-container networking for a full example.

Full Reference

The block below mirrors src/main/resources/application.yml, it's the effective set of keys Floci ships with. Some supported keys are omitted here (for example floci.init-hooks.*) but can still be provided via YAML or environment variables.

floci:
  max-request-size: 2048             # Max HTTP request body size in MB
  base-url: "http://localhost:4566"  # Used to build response URLs (SQS QueueUrl, SNS endpoints, etc.)
  # hostname: ""                     # When set, overrides the host in base-url for multi-container Docker
  default-region: us-east-1
  default-account-id: "000000000000"

  storage:
    mode: memory                      # memory | persistent | hybrid | wal
    persistent-path: ./data
    # EFS access-point emulation for the shared local Docker volumes that back ECS
    # efsVolumeConfiguration mounts. All opt-in; with no overrides a shared volume is a plain
    # named volume (root:root 0755), so existing behaviour is unchanged. See docs/services/ecs.md.
    efs:
      # owner-uid: 1001            # CreationInfo.OwnerUid (set together with owner-gid)
      # owner-gid: 1001            # CreationInfo.OwnerGid (set together with owner-uid)
      # root-permissions: "2775"   # CreationInfo.Permissions; 3-4 octal digits (4-digit carries setgid/sticky)
      init-image: busybox:stable   # image for the one-off chown/chmod of the volume root
      # mount-user: "1001:1001"    # PosixUser: run mounting containers as uid[:gid]
      # mount-group-add: 2000      # supplementary gid added to mounting containers
    wal:
      compaction-interval-ms: 30000
    services:
      ssm:
        flush-interval-ms: 5000
      dynamodb:
        flush-interval-ms: 5000
      sns:
        flush-interval-ms: 5000
      lambda:
        flush-interval-ms: 5000
      cloudwatchlogs:
        flush-interval-ms: 5000
      cloudwatchmetrics:
        flush-interval-ms: 5000
      secretsmanager:
        flush-interval-ms: 5000
      acm:
        flush-interval-ms: 5000
      opensearch:
        flush-interval-ms: 5000
      fis:
        flush-interval-ms: 5000

  dns:
    # Extra hostname suffixes resolved to Floci's container IP by the embedded DNS server.
    # The primary suffix (floci.hostname or derived from base-url) is always included.
    # Useful when migrating from LocalStack — Lambda functions that hardcode
    # localhost.localstack.cloud as their endpoint work without code changes.
    # Via env var (comma-separated): FLOCI_DNS_EXTRA_SUFFIXES=localhost.localstack.cloud,other.internal
    # extra-suffixes:
    #   - localhost.localstack.cloud

  auth:
    validate-signatures: false               # Set to true to verify S3 presigned URL signatures
    presign-secret: local-emulator-secret    # HMAC secret for S3 pre-signed URL verification

  tls:
    enabled: false                           # FLOCI_TLS_ENABLED — enable HTTPS on all endpoints
    # cert-path: ""                          # FLOCI_TLS_CERT_PATH — PEM certificate file path
    # key-path: ""                           # FLOCI_TLS_KEY_PATH — PEM private key file path
    self-signed: true                        # FLOCI_TLS_SELF_SIGNED — auto-generate cert when no paths provided

  docker:
    log-max-size: "10m"                      # Max size per container log file before rotation
    log-max-file: "3"                        # Number of rotated log files to retain
    docker-host: unix:///var/run/docker.sock # Docker daemon socket (shared by Lambda, RDS, ElastiCache)
    docker-config-path: ""                   # Path to dir containing Docker's config.json (e.g. /root/.docker)
    registry-credentials: []                 # Per-registry explicit credentials for private registries

  services:
    ssm:
      enabled: true
      max-parameter-history: 5               # Max versions kept per parameter

    sqs:
      enabled: true
      default-visibility-timeout: 30         # Seconds
      max-message-size: 1048576              # Bytes (1 MB)
      clear-fifo-deduplication-cache-on-purge: false  # When true, PurgeQueue clears SQS FIFO dedup and SNS FIFO topic dedup for topics subscribed to that queue

    s3:
      enabled: true
      default-presign-expiry-seconds: 3600

    dynamodb:
      enabled: true

    sns:
      enabled: true

    lambda:
      enabled: true
      ephemeral: false                        # true = remove container after each invocation
      default-memory-mb: 128
      default-timeout-seconds: 3
      runtime-api-base-port: 9200             # Port range for Lambda Runtime API
      runtime-api-max-port: 9299
      code-path: ./data/lambda-code           # Where ZIP archives are stored
      poll-interval-ms: 1000
      container-idle-timeout-seconds: 300     # Remove idle containers after this
      region-concurrency-limit: 1000          # Concurrent executions ceiling per region
      unreserved-concurrency-min: 100         # Minimum unreserved capacity PutFunctionConcurrency must leave
      hot-reload:
        enabled: false                        # true = enable bind-mount hot-reload via S3Bucket=hot-reload
        # allowed-paths:                      # Optional allowlist of host paths that may be bind-mounted
        #   - /home/user/projects
        #   - /tmp

    apigateway:
      enabled: true

    apigatewayv2:
      enabled: true

    iam:
      enabled: true
      enforcement-enabled: false        # Set to true to enforce IAM policies on all requests
      seed-deployer-principal: false    # Set to true to create a local floci-deployer admin principal

    servicequotas:
      enabled: true

    ram:
      enabled: true


    elasticache:
      enabled: true
      proxy-base-port: 6379
      proxy-max-port: 6399
      default-image: "valkey/valkey:8"

    rds:
      enabled: true
      mock: false                             # true = clusters/instances created without Docker (useful for CI)
      proxy-base-port: 7001
      proxy-max-port: 7099
      # endpoint-host: localhost              # Hostname clients use; enables published-port translation in Docker
      # Omit image overrides to adapt Floci's built-in images to EngineVersion.
      # Uncomment an override to pin that engine to an exact image.
      # default-postgres-image: "registry.example.com/postgres:16-alpine"
      # default-mysql-image: "registry.example.com/mysql:8.0"
      # default-mariadb-image: "registry.example.com/mariadb:11"

    rds-data:
      enabled: true
      transaction-ttl-seconds: 180

    eventbridge:
      enabled: true

    scheduler:
      enabled: true

    cloudwatchlogs:
      enabled: true
      max-events-per-query: 10000

    cloudwatchmetrics:
      enabled: true

    secretsmanager:
      enabled: true
      default-recovery-window-days: 30

    kinesis:
      enabled: true

    kms:
      enabled: true

    cognito:
      enabled: true

    stepfunctions:
      enabled: true

    cloudformation:
      enabled: true

    acm:
      enabled: true
      validation-wait-seconds: 0              # Seconds before transitioning PENDING_VALIDATION → ISSUED

    ses:
      enabled: true
      # smtp-host: mailpit                       # SMTP server for email relay (empty = store only)
      # smtp-port: 1025
      # smtp-user: ""
      # smtp-pass: ""
      # smtp-starttls: DISABLED                  # DISABLED, OPTIONAL, or REQUIRED

    opensearch:
      enabled: true
      mock: false                             # true = metadata only, no Docker (useful for CI)
      default-image: "opensearchproject/opensearch:2"
      proxy-base-port: 9400
      proxy-max-port: 9499
      keep-running-on-shutdown: false         # leave containers running after Floci stops
      # docker network is inherited from floci.services.docker-network

    ec2:
      enabled: true

    efs:
      enabled: true

    ecs:
      enabled: true
      mock: false                             # true = tasks go to RUNNING without Docker (useful for CI)

    appsync:
      enabled: true

    appconfig:
      enabled: true

    appconfigdata:
      enabled: true

    fis:
      enabled: true

    ecr:
      enabled: true
      registry-image: "registry:2"
      registry-container-name: floci-ecr-registry
      registry-base-port: 5100
      registry-max-port: 5199
      data-path: ./data/ecr
      tls-enabled: false
      keep-running-on-shutdown: true
      uri-style: hostname                     # hostname | path

Initialization hooks

floci.init-hooks.* is accepted as an override but is not declared in the shipped application.yml. See Initialization Hooks for the full list of keys (shell-executable, timeout-seconds, shutdown-grace-period-seconds) and their defaults.

Service Limits

All keys in this table are declared on EmulatorConfig and accept environment variable overrides via the FLOCI_ prefix.

Variable Default Description
FLOCI_MAX_REQUEST_SIZE 512 Max HTTP request body size in MB
FLOCI_DEFAULT_REGION us-east-1 Default AWS region used in ARNs and response URLs
FLOCI_DEFAULT_AVAILABILITY_ZONE us-east-1a Default AZ reported by EC2, RDS, and other AZ-aware services
FLOCI_DEFAULT_ACCOUNT_ID 000000000000 Default AWS account ID used in ARNs
FLOCI_ECR_BASE_URI public.ecr.aws Base URI used when pulling container images (e.g. Lambda)
FLOCI_DNS_EXTRA_SUFFIXES (unset) Comma-separated extra hostname suffixes the embedded DNS server resolves to Floci's container IP. E.g. localhost.localstack.cloud,localhost.example.internal
FLOCI_SERVICES_SSM_MAX_PARAMETER_HISTORY 5 Max parameter versions kept
FLOCI_SERVICES_SQS_DEFAULT_VISIBILITY_TIMEOUT 30 Default visibility timeout (seconds)
FLOCI_SERVICES_SQS_MAX_MESSAGE_SIZE 1048576 Max message size (bytes)
FLOCI_SERVICES_SQS_CLEAR_FIFO_DEDUPLICATION_CACHE_ON_PURGE false When true, PurgeQueue clears the FIFO 5-minute deduplication cache for the target queue and matching SNS FIFO topic dedup entries
FLOCI_SERVICES_S3_DEFAULT_PRESIGN_EXPIRY_SECONDS 3600 Pre-signed URL expiry
FLOCI_SERVICES_DOCKER_NETWORK (unset) Shared Docker network for Lambda, RDS, ElastiCache containers
FLOCI_SERVICES_RDS_DATA_ENABLED true Enable the RDS Data API service
FLOCI_SERVICES_RDS_DATA_TRANSACTION_TTL_SECONDS 180 Idle timeout, in seconds, before leaked RDS Data API transactions expire
FLOCI_SERVICES_ECS_MOCK false Skip Docker; tasks go straight to RUNNING (useful for CI)
FLOCI_SERVICES_ECS_DOCKER_NETWORK (unset) Docker network for ECS task containers
FLOCI_SERVICES_ECS_DEFAULT_MEMORY_MB 512 Default memory (MB) when task definition omits it
FLOCI_SERVICES_ECS_DEFAULT_CPU_UNITS 256 Default CPU units when task definition omits it
FLOCI_SERVICES_IAM_ENFORCEMENT_ENABLED false Enforce IAM identity-based policies on every request when true
FLOCI_SERVICES_OPENSEARCH_MOCK false Skip Docker; domains appear active immediately (useful for CI)
FLOCI_SERVICES_OPENSEARCH_KEEP_RUNNING_ON_SHUTDOWN false Leave OpenSearch containers running after Floci stops
FLOCI_SERVICES_SES_SMTP_HOST (unset) SMTP server host for SES email relay (empty = store only)
FLOCI_SERVICES_SES_SMTP_PORT 25 SMTP server port
FLOCI_SERVICES_SES_SMTP_USER (unset) SMTP authentication username
FLOCI_SERVICES_SES_SMTP_PASS (unset) SMTP authentication password
FLOCI_SERVICES_SES_SMTP_STARTTLS DISABLED STARTTLS mode: DISABLED, OPTIONAL, or REQUIRED
FLOCI_SERVICES_LAMBDA_HOT_RELOAD_ENABLED false Enable bind-mount hot-reload mode (S3Bucket=hot-reload)
FLOCI_SERVICES_LAMBDA_HOT_RELOAD_ALLOWED_PATHS (unset) Comma-separated list of host paths allowed as bind-mount roots; unset = any absolute path

Per-queue SQS redrive policy (maxReceiveCount) is configured at queue creation time via SetQueueAttributes / CreateQueue, not as a global default.

FLOCI_DEFAULT_AVAILABILITY_ZONE and FLOCI_ECR_BASE_URI are declared in EmulatorConfig but not in the shipped application.yml, so they fall through to the @WithDefault values above when unset.

Disabling Services

Set enabled: false for any service you don't need. Disabled services return a ServiceUnavailableException rather than silently ignoring calls.

floci:
  services:
    cloudformation:
      enabled: false
    stepfunctions:
      enabled: false

Via environment variable — set to false for any FLOCI_SERVICES_<SERVICE>_ENABLED key. See Environment Variables Reference for the full list.

Logging

Floci uses standard Quarkus logging. The default effective level is INFO. Each service logs operation-level events at DEBUG (IDs and target resources) and full request/response payloads at TRACE — useful when diagnosing TestContainers-based test failures.

Floci ships with quarkus.log.min-level: TRACE, so raising a single category to TRACE is enough; you don't need to change the min-level yourself.

Enable TRACE for a service via environment variables:

# SQS: log SendMessage/ReceiveMessage/DeleteMessage bodies and attributes
QUARKUS_LOG_CATEGORY__IO_GITHUB_HECTORVENT_FLOCI_SERVICES_SQS__LEVEL=TRACE

# DynamoDB: log PutItem/GetItem/UpdateItem/DeleteItem items, Query/Scan counts
QUARKUS_LOG_CATEGORY__IO_GITHUB_HECTORVENT_FLOCI_SERVICES_DYNAMODB__LEVEL=TRACE

Or in application.yml:

quarkus:
  log:
    category:
      "io.github.hectorvent.floci.services.sqs":
        level: TRACE
      "io.github.hectorvent.floci.services.dynamodb":
        level: TRACE

TestContainers example:

new GenericContainer<>("floci/floci:latest")
    .withExposedPorts(4566)
    .withEnv("QUARKUS_LOG_CATEGORY__IO_GITHUB_HECTORVENT_FLOCI_SERVICES_SQS__LEVEL", "TRACE");

TRACE output includes the payload alongside the existing DEBUG line:

DEBUG [SqsService] Sent message aa7b93e7-... to queue .../events
TRACE [SqsService] Sent message aa7b93e7-... to queue .../events body={"eventType":"..."} attributes={source=okta}