Files
floci/docs/services/appconfig.md
T
Goooooooooody 2316b2fc28 feat(appconfig): serve feature flag variants to the AppConfig Agent as Amazon Ion (#4674)
* feat(appconfig): serve feature flag variants to the AppConfig Agent as Amazon Ion

The AWS AppConfig Agent evaluates multi-variant feature flags itself: it asks
AppConfigData for application/ion;type=AWS.AppConfig.FeatureFlags and gets each flag's
variants and rules back as Ion. Floci returned the stored JSON document unchanged, which
the agent cannot read, so every variant flag failed with NoSuchFlag.

A caller that accepts that type now gets the Ion stream AWS sends: a symbol table
importing AWS's ops and anns tables, then a list per flag holding its variants (name,
rule, attributes) and its default. Rules of the form (eq $attribute "value") are encoded;
any other is left to the existing JSON path with a warning. The encoding reproduces a
captured AWS response for a real 22-flag profile byte for byte.

* fix(appconfig): honour q=0 for Ion, label the stored content type, read the stream back in tests

An Accept of application/ion;type=AWS.AppConfig.FeatureFlags;q=0.0000 was treated as
acceptable; any run of zeros now means the caller rejects it.

The content type of a response was inferred from its first bytes. It now comes from the path
that produced them, so a profile that is not a feature flag profile keeps its stored type
even if it holds Ion and the caller accepts the feature flag type.

The tests decode the stream with Amazon's ion-java (test scope), with the ops and anns
shared tables registered, instead of checking the encoder against itself.

* fix(appconfig): encode a basic flag in an Ion profile as an annotated string

AWS sends a flag without variants in the Ion format as its retrieval-time JSON, annotated with
its key, not as a list holding a default variant. The encoder now does the same, reusing the
JSON path's per-flag conversion, so a profile that mixes variant and basic flags reads as AWS's.

The encoder and docs cite the layout AWS documents for the agent's local development
mode rather than the captured responses.
2026-10-01 19:30:18 -04:00

4.2 KiB

AppConfig

Floci supports AWS AppConfig and AppConfigData for local configuration management.

Management Plane (AppConfig)

The management plane allows you to create and manage applications, environments, configuration profiles, and hosted configuration versions.

Supported Operations

  • CreateApplication
  • GetApplication
  • ListApplications
  • DeleteApplication
  • CreateEnvironment
  • GetEnvironment
  • ListEnvironments
  • CreateConfigurationProfile
  • GetConfigurationProfile
  • ListConfigurationProfiles
  • DeleteConfigurationProfile
  • CreateHostedConfigurationVersion
  • GetHostedConfigurationVersion
  • DeleteHostedConfigurationVersion
  • CreateDeploymentStrategy
  • GetDeploymentStrategy
  • ListDeploymentStrategies
  • DeleteDeploymentStrategy
  • StartDeployment
  • GetDeployment
  • ListDeployments (GET /applications/{ApplicationId}/environments/{EnvironmentId}/deployments)

Data Plane (AppConfigData)

The data plane is used by applications to retrieve the active configuration for an environment and profile.

Supported Operations

  • StartConfigurationSession
  • GetLatestConfiguration

Basic AWS.AppConfig.FeatureFlags profiles are returned in AWS retrieval-time JSON format.

Feature flags with variants are returned, as AWS does, in Amazon Ion (application/ion; type=AWS.AppConfig.FeatureFlags) to a caller whose Accept header asks for it, as the AWS AppConfig Agent's does: the caller evaluates the variants' rules against its own context (?flag=name&context=key=value). The layout is the one AWS documents for the agent's local development mode: each flag with variants is a list of its variants, and each basic flag in the same profile is its retrieval-time JSON as a string. Rules of the form (eq $attribute "value") are encoded; a profile with any other rule is returned unchanged, as JSON, and Floci logs a warning, as it does for a caller that does not accept Ion.

Configuration

Variable Default Description
FLOCI_SERVICES_APPCONFIG_ENABLED true Enable or disable the AppConfig management plane
FLOCI_SERVICES_APPCONFIGDATA_ENABLED true Enable or disable the AppConfigData retrieval plane

Example Usage

1. Create an Application and Environment

# Create application
aws appconfig create-application --name my-app --endpoint-url http://localhost:4566

# Create environment
aws appconfig create-environment --application-id <app-id> --name dev --endpoint-url http://localhost:4566

2. Create a Hosted Configuration

# Create configuration profile
aws appconfig create-configuration-profile \
  --application-id <app-id> \
  --name my-profile \
  --location-uri hosted \
  --type AWS.Freeform \
  --endpoint-url http://localhost:4566

# Create hosted configuration version
aws appconfig create-hosted-configuration-version \
  --application-id <app-id> \
  --configuration-profile-id <profile-id> \
  --content "{\"foo\": \"bar\"}" \
  --content-type application/json \
  --endpoint-url http://localhost:4566

3. Deploy the Configuration

# Create immediate deployment strategy
aws appconfig create-deployment-strategy \
  --name immediate \
  --deployment-duration-in-minutes 0 \
  --growth-factor 100 \
  --final-bake-time-in-minutes 0 \
  --endpoint-url http://localhost:4566

# Start deployment
aws appconfig start-deployment \
  --application-id <app-id> \
  --environment-id <env-id> \
  --configuration-profile-id <profile-id> \
  --configuration-version 1 \
  --deployment-strategy-id <strategy-id> \
  --endpoint-url http://localhost:4566

4. Retrieve Configuration via Data Plane

# Start configuration session
TOKEN=$(aws appconfigdata start-configuration-session \
  --application-identifier <app-id> \
  --environment-identifier <env-id> \
  --configuration-profile-identifier <profile-id> \
  --query "InitialConfigurationToken" --output text \
  --endpoint-url http://localhost:4566)

# Get latest configuration
aws appconfigdata get-latest-configuration \
  --configuration-token $TOKEN \
  --endpoint-url http://localhost:4566