* build: add graphql-java dependency
* feat(appsync): add and extend data models for Phase 2
- Add AdditionalAuthenticationProvider, DomainName, ChannelNamespace, ApiAssociation models
- Add 14 fields to GraphqlApi (apiType, visibility, owner, etc.)
- Change additionalAuthenticationProviders from raw maps to typed list
- Add 6 fields to Resolver (resolverArn, cachingConfig, maxBatchSize, etc.)
- Add dataSourceArn to DataSource
- Rename FunctionConfiguration.arn to functionArn
* feat(appsync): add service and controller changes for Phase 2
* feat(appsync): add service and controller changes for Phase 2
* test(appsync): add Phase 2 integration tests
Add ~60 new tests for:
- Model completeness (new fields, ARNs, functionArn rename)
- Domain names CRUDL + associate/disassociate
- Channel namespaces CRUDL + update
- Merged API associations CRUDL
- Enhanced metrics
- Schema registry parsing with AWS scalars and extensions
- Directive registration (aws_api_key, aws_subscribe, deprecated, unknown)
- Edge cases (null auth providers, maxBatchSize 0, cleanup on delete)
* test(appsync): add AWS scalar unit tests
Test all 17 AWS scalars:
- All registered in AppSyncScalarRegistry
- AWSDateTime, AWSJSON, AWSEmail parse valid/invalid values
- AWSTimestamp and AWSShort range validation
- AWSURL and AWSPhone format validation
* test(appsync): add SDK compatibility tests for Phase 2
Validate that the AWS SDK Java v2 can read:
- dataSourceArn() on CreateDataSource response
- resolverArn() on CreateResolver response
- functionArn() on CreateFunction response
- BadRequestException on invalid schema creation
* docs(appsync): add Phase 2 operations, schema registry, and AWS scalars documentation
- Add Domain Names, Channel Namespaces, Merged API Associations, Enhanced Metrics
- Document AWS scalar types (17 scalars with validation rules)
- Document AppSync directives (8 directives with locations)
- Update Not Implemented section with future phase references
- Add CLI examples for domain names and channel namespaces
- Update cascade delete to include channel namespaces and domain associations
* docs: add AppSync to service tables, env vars, storage config, and SDK README
- README.md: add AppSync to category table, detailed notes, and architecture diagram
- docs/index.md: add AppSync to supported services table, fix count to 52
- docs/configuration/environment-variables.md: add FLOCI_SERVICES_APPSYNC_ENABLED
- docs/configuration/advanced/application-yml.md: add appsync config block
- docs/configuration/storage.md: add AppSync per-service storage override
- compatibility-tests/sdk-test-java/README.md: add AppSyncTest to services table
* fix(appsync): reuse ObjectMapper and fix AWSJSON serialize for non-string values
AWSJSON scalar was creating a new ObjectMapper on every parseValue() call. serialize() used toString() which produces invalid JSON for Map/JsonNode results.
* fix(appsync): strip string literals and comments before unknown directive validation
The regex @(\w+) incorrectly flagged @ mentions inside GraphQL string literals and comments as unknown directives.
* fix(appsync): prevent silent overwrite on creates, validate required fields and input values
- Add existence checks on createDataSource, createResolver, createType,
createChannelNamespace, createMergedApiAssociation (→ ConflictException 409)
- Validate authenticationType is required on createGraphqlApi
- Validate typeName is required on createResolver
- Validate dataSourceName exists on createResolver and createFunction
- Prevent associateApi from silently overwriting existing association
- Enforce API key limit (max 2 per API)
- Fix expires parsing to accept ISO 8601 strings, throw on invalid values
- Fix castInt overflow detection
- Fix updateApiKey expires validation (was silently swallowing errors)
- Change InvalidNextTokenException to BadRequestException (AWS standard)
- Fix maxResults=0 to return empty page
- Fix getIntrospectionSchema to throw 404 instead of returning null
- Fix tags with null values (was producing literal string "null")
* test(appsync): fix cascade delete test to create data source before function, align with new validation
* refactor(appsync): remove dead code and unused hasSchema()
- Delete AppSyncDirectiveRegistry.java (100 lines, never used)
- Delete DirectiveValidator.java (45 lines, never called)
- Remove hasSchema() from SchemaRegistry (never called)
* fix(appsync): scalar null-safety, type validation, and DNS resolution
- Add null checks to 5 serialize() methods (AWS_TIMESTAMP, AWS_LONG,
AWS_INTEGER, AWS_BOOLEAN, AWS_FLOAT) to prevent NPE
- Fix AWS_TIMESTAMP parseValue() ClassCastException on String input
- Replace InetAddress.getByName() with regex in AWS IPAddress to
prevent DNS resolution (SSRF concern)
- AWSBoolean now rejects non-boolean values (matches AppSync behavior)
* refactor(appsync): centralize directive definitions in AppSyncDirective enum
- Add AppSyncDirective enum as single source of truth for directive
names and SDL definitions
- Update AppSyncSchemaParser to use enum instead of duplicated strings
- Eliminates 3 sources of truth (validateNoUnknownDirectives Set,
injectDirectiveDefinitions SDL, and formerly AppSyncDirectiveRegistry)
* perf(appsync): cache scalarMap in AppSyncScalarRegistry
- Initialize scalarMap once in constructor as unmodifiableMap
- Avoids recreating HashMap on every call (was called twice per
schema parse)
* test(appsync): add tests for scalar fixes and behavior changes
- Add tests for null-safety in serialize() (5 scalars)
- Add test for AWSTimestamp parseValue with String input
- Add tests for AWSIPAddress regex validation (IPv4, IPv6, invalid)
- Add tests for AWSBoolean rejecting non-boolean values
- Add test for scalarMap caching
* test(sdk): add AWS scalars schema creation test
Verifies that schemas with AWS scalar types (AWSDateTime, AWSJSON,
AWSIPAddress, AWSBoolean) parse correctly via the SDK.
* fix(appsync): correct API paths to match AWS documentation
- Channel namespaces: /v1/ → /v2/, channelnamespaces → channelNamespaces
- Domain association: /apis → /apiassociation
- Remove ListApiAssociations (not a real AppSync operation)
- Remove GetEnhancedMetricsConfig (not a real AppSync operation)
- Rename Merged API Association to Source API Association with correct paths:
- AssociateSourceGraphqlApi: POST /v1/mergedApis/{id}/sourceApiAssociations
- GetSourceApiAssociation: GET /v1/mergedApis/{id}/sourceApiAssociations/{id}
- ListSourceApiAssociations: GET /v1/apis/{apiId}/sourceApiAssociations
- DisassociateSourceGraphqlApi: DELETE /v1/mergedApis/{id}/sourceApiAssociations/{id}
* feat(appsync): add SourceApiAssociation models
Add SourceApiAssociation, SourceApiAssociationConfig, and
SourceApiAssociationSummary models to support merged/source API
association operations per AWS AppSync API Reference.
* feat(appsync): add ChannelNamespace support models
Add AuthMode, HandlerConfig, HandlerConfigs, Integration, and
LambdaConfig models for ChannelNamespace handler configuration
per AWS AppSync API Reference.
* fix(appsync): fix ApiAssociation and ChannelNamespace models
ApiAssociation: remove source/merged API fields, keep only domain
association fields (apiId, associationStatus, deploymentDetail,
domainName) per AWS AppSync API Reference.
ChannelNamespace: add missing fields (channelNamespaceArn,
codeHandlers, created, handlerConfigs, lastModified,
publishAuthModes, subscribeAuthModes, tags) per AWS docs.
* feat(appsync): add missing service methods and fix response models
- associateApi now returns full ApiAssociation object
- createMergedApiAssociation returns SourceApiAssociation
- createSourceApiAssociation returns SourceApiAssociation
- getSourceApiAssociation validates mergedApiId
- listSourceApiAssociations returns SourceApiAssociationSummary
- Add updateSourceApiAssociation method
- Add deleteMergedApiAssociation method
- ChannelNamespace: populate arn, timestamps on create/update
* feat(appsync): fix response formats and add missing endpoints
- associateMergedGraphqlApi: response key apiAssociation → sourceApiAssociation
- disassociateSourceGraphqlApi: returns 200 + body (not 204)
- associateApi: returns full ApiAssociation from service
- Add POST /v1/mergedApis/{id}/sourceApiAssociations/{assocId} (UpdateSourceApiAssociation)
- Add DELETE /v1/sourceApis/{id}/mergedApiAssociations/{assocId} (DisassociateMergedGraphqlApi)
* test(appsync): fix and add integration tests for new endpoints
- Fix associateSourceGraphqlApi: use mergedApiId and sourceApiAssociationStatus
- Fix deleteSourceApiAssociation: expect 200 with body (not 204)
- Add updateDomainName test
- Add associateMergedGraphqlApi test
- Add updateSourceApiAssociation test
- Add disassociateMergedGraphqlApi test
* test(appsync): add SDK tests for missing operations
- Add updateDomainName test
- Add associateMergedGraphqlApi test
- Add updateSourceApiAssociation test
- Add disassociateMergedGraphqlApi test
- Fix test ordering for new domain tests
DescribeLogStreams, PutLogEvents, GetLogEvents, and FilterLogEvents now
accept either logGroupName or logGroupIdentifier. When an ARN is provided,
the log-group name is extracted from the :log-group: segment (with
trailing :* tolerated). Log-stream identifiers are similarly stripped of
the :log-stream: prefix so SDK responses can round-trip cleanly.
DescribeLogStreams responses also include a per-stream arn field.
Closes#1164
* fix(ecs): retain inactive services for terraform draining and recreation with correct idempotency
* fix(ecs): enforce strict aws compliance for service lifecycles and idempotency
- retain inactive services
- added status filters to listServices and listServicesByNamespace
- wrote a shared extractServiceName helper
* feat(ecs): honour task-def volumes + container mountPoints
Implements EC2-launch-type ECS host-bind semantics: a task definition may
declare task-level volumes ({name, host.sourcePath}) and each container
definition may reference them via mountPoints ({sourceVolume, containerPath,
readOnly}). At RunTask launch, each mountPoint resolves its source volume to
the host source path and bind-mounts it into the container (read-only via
withReadOnlyBind, read-write via withBind); unresolved volume references are
skipped with a warning.
This lets stock images be launched with per-task config bind-mounted at a
fixed container path, instead of baking config into per-image wrappers.
- model: Volume, MountPoint records; volumes on TaskDefinition, mountPoints on
ContainerDefinition
- EcsJsonHandler: parse + serialize round-trip for both
- EcsContainerManager.startTask: resolve volumes and wire binds
- tests: JSON wire-path round-trip + bind-by-access-mode (Docker-free)
* fix(ecs): fail loudly when a task definition resolves zero container definitions
RunTask/StartTask on a task definition with no container definitions used to
launch zero containers silently: the per-container loop was a no-op, the task
still transitioned through PENDING towards RUNNING, and callers polling
DescribeTasks waited forever on a task with nothing behind it.
Validate up front in launchTasks (covers RunTask and StartTask, docker and
mock mode alike): WARN and throw a ClientException (HTTP 400) before any task
is created, consistent with how unresolved task definitions fail.
* fix(cloudwatch): tag rpc-v2-cbor timestamp lists so GetMetricData decodes
GetMetricData responses encode MetricDataResults[].Timestamps as a list, but
the rpc-v2-cbor serializer only tagged scalar fields named "Timestamp". The
untagged list elements caused aws-sdk-go-v2 (and the OpenTelemetry Collector
awscloudwatch metrics receiver) to fail decoding with "unexpected value type
cbor.Uint".
Carry timestamp context into array elements and match timestamp members by
their "Timestamp"/"Timestamps" suffix, so every element of a timestamp list is
emitted as a CBOR tag(1) value (epoch seconds, RFC 8949 3.4.2) with integer-ness
preserved. Scalar timestamp handling is unchanged.
Tests:
- AwsJsonCborSerializerTest: asserts tag(1) bytes for scalar and list timestamps,
integer preservation, and that non-timestamp numbers stay untagged.
- Go SDK compatibility suite: a GetMetricData case that exercises the real
aws-sdk-go-v2 CBOR client end to end.
* apply copilot suggestions to tests
Add UpdateConfigurationSetSendingEnabled (SES v1 Query) and
PutConfigurationSetSendingOptions (SES v2 REST, PUT
/v2/email/configuration-sets/{name}/sending) to toggle email sending
on a single configuration set, complementing the existing
account-level UpdateAccountSendingEnabled / PutAccountSendingAttributes
toggle. The two APIs share state: both write
`ConfigurationSet.sendingEnabled` (Boolean, null/true = enabled).
Enforcement is centralized in SesService.validateConfigurationSet,
which is called by SendEmail, SendRawEmail, and SendBulkTemplatedEmail
(v1 and v2 paths). When the CS's sendingEnabled is false, the send is
rejected with SendingPausedException + "Sending is paused for
configuration set <name>" — matching the exact wire shape AWS returns
in production (verified via `aws sesv2 send-email` against an AWS
account with a disabled CS; both ErrorCode and Message reproduce as-is).
Read-back paths:
- v2 GetConfigurationSet returns SendingOptions: {SendingEnabled}
- v1 DescribeConfigurationSet with `reputationOptions` attribute
returns ReputationOptions/SendingEnabled (matches the AWS v1 wire
contract where SendingEnabled lives under ReputationOptions)
The v1 action is also added to AwsQueryController.SES_ACTIONS so that
action-name-based service routing recognizes it.
Tests
- SesConfigurationSetSendingOptionsV2IntegrationTest (13 cases): toggle
via both APIs, cross-API state sharing, SendEmail rejection with
SendingPausedException when disabled, read-back via Get/Describe,
bad-request validation, unknown CS returns 404 via v2.
- SesConfigurationSetSendingTest (SDK compat, 9 cases): AWS Java SDK
v2 marshalling of both APIs, with sendEmail rejection asserted as
`SendingPausedException` (the AWS SDK class corresponding to the
matched server-side error code).
Docs
- docs/services/ses.md: list both APIs in their respective tables.
RunTask accepts overrides.containerOverrides[] in the AWS ECS API, but floci
parsed RunTask without reading them, so a caller's per-container command and
environment overrides were silently dropped — the launched container always ran
the task-definition's command/env.
Thread containerOverrides from EcsJsonHandler.runTask through
EcsService.runTask/launchTasks into EcsContainerManager.startTask, matched to a
container definition by name:
- command (if present and non-empty) replaces the task-def command
- environment is merged over the task-def environment (override wins on key)
StartTask and the service reconciler pass null (no overrides), unchanged.
Adds model/ContainerOverride (name, command, environment), @RegisterForReflection
for native builds.
Lambda/CodeBuild containers get Floci's IP as their only DNS, so all
public-name resolution flows through Floci's embedded UDP/53 forwarder.
The forwarder read responses into a hardcoded 512-byte buffer, silently
truncating larger EDNS0 responses (e.g. CDN-backed hosts), so public
lookups failed inside Lambda with ENOTFOUND/EBUSY.
- Enlarge the forwarder receive buffer to 4096 bytes (EDNS0).
- Forward across an ordered upstream list (resolv.conf + configurable
public fallbacks), returning the first valid response; warn when all
upstreams fail instead of dropping the response silently.
- Append configurable fallback resolvers (default 8.8.8.8, 8.8.4.4)
after Floci's IP on spawned containers' HostConfig.Dns, controllable
via floci.dns.container-fallback-* / FLOCI_DNS_CONTAINER_FALLBACK_*.
Closes#1110
In real mode `aws eks create-cluster` brought up a k3s container that was
unreachable from the host and rejected every request with 401. This makes the
native AWS workflow work end to end (`aws eks update-kubeconfig` + `kubectl`).
- describe-cluster returns a host-reachable endpoint (https://localhost:<hostPort>),
configurable via endpoint-mode (host|network), default host
- token-authentication webhook (POST /_floci/eks/token-webhook) validates the
`aws eks get-token` bearer token and maps it to system:masters; pins the
apiserver to the v1 TokenReview API and echoes the request apiVersion
- webhook kubeconfig is injected into k3s via the Docker API (create -> copy ->
start), so it works in native and Docker-in-Docker with no host-path config
- k3s network falls back to the global docker-network, then auto-detected
Closes#1118
* fix(eventbridge): propagate PutEvents call region and account through pattern matching and delivered envelope
EventBridgeService.putEvents previously had two related defects in how
the call's region and account flowed through to rule matching and the
delivered EventBridge envelope:
1. buildEventEnvelope hardcoded the envelope's "region" and "account"
fields to RegionResolver.getDefaultRegion() /
RegionResolver.getAccountId(), regardless of which region/account
the PutEvents call was made against. A rule scoped to eu-west-1
would fire correctly for an eu-west-1 PutEvents call (rules are
stored per (region, bus)), but the envelope delivered to its
target would report region=us-east-1. Downstream consumers /
re-routing rules that filter on the envelope region saw an
incorrect value.
2. matchesPattern read entry.Region / entry.Account with a fallback
to the RegionResolver defaults. For a PutEvents entry without
explicit Region (the common case — the AWS SDK doesn't model
per-entry region), the pattern's region/account filter saw the
resolver default while the envelope (after fix#1) saw the
actual call region. Same kind of inconsistency, one step earlier.
- putEvents() now defensively copies each entry into a mutable
HashMap and fills missing/blank Region / Account from the call
context (region argument; accountId if non-null else
regionResolver.getAccountId()) at the top of the per-entry loop.
matchesPattern, buildEventEnvelope, and captureToArchives all
subsequently see the same normalized entry, so a pattern's
region/account filter agrees with the delivered envelope.
- buildEventEnvelope now takes the PutEvents call's region and
accountId and resolves region/account with the same precedence:
entry-supplied value wins (cross-region producers, archive
replay), then the call's region/accountId, finally the resolver
default. For the putEvents path the entry is already normalized,
so this is defense-in-depth for any other callers.
- A small isBlank(Object) helper centralizes the null + blank-string
predicate used in both the entry normalization and the envelope
fallback.
Tests
- Five new EventBridgeServiceTest cases pin the new behavior:
* envelope.region equals the PutEvents call's region for a
non-default-region rule+target+entry triple (eu-west-1).
* entry.Region / entry.Account win when set explicitly (mirrors
the archive-replay scenario where the originating envelope's
region/account are stamped back onto the re-emitted entry).
* default-region call still stamps the resolver default —
regression pin so the pre-fix behavior isn't silently restored.
* a region-filtered rule for the call region fires on a
PutEvents call to that region with no explicit entry.Region
(matchesPattern + envelope agree).
* a region-filtered rule for the resolver default does NOT fire
under a non-default-region PutEvents call — pre-fix this
accidentally matched via the resolver default.
- All 173 EventBridge tests pass.
* fix(eventbridge): default to RegionResolver when normalizing a missing PutEvents region
Address okinaka's review on the envelope-region fix: the Region branch
of the entry normalization passed the raw `region` argument straight
through, so a null/blank `region` would stamp `entry.Region = null`.
The matching Account branch already fell back to
`regionResolver.getAccountId()` when accountId was null, so the two
branches were asymmetric. Apply the same fallback chain to Region —
`entry.Region = isBlank(region) ? regionResolver.getDefaultRegion() :
region` — and tighten Account's null check to `isBlank(accountId)` for
symmetry.
No new test: every real caller of EventBridgeService.putEvents
(EventBridgeHandler, ScheduleInvoker, PipesTargetInvoker, S3Service)
passes a non-null region, and the surrounding bus/rule-prefix lookups
also use the raw `region` argument, so a null `region` would short-
circuit at the bus lookup before the normalization invariant matters.
This is a consistency fix for the in-loop normalization itself; the
"normalize once at the top, downstream sees a stable value" invariant
Copilot's review established now holds for Region the same way it
holds for Account.
* style(eventbridge): keep envelope region/account fallback ternaries on one line
Match the formatting of the new entry-normalization fallbacks
(entry.put("Region", isBlank(region) ? ... : region) — single line) by
joining the envelope ternaries that the previous commits left wrapped
at the question mark. Same code, just consistent layout.
When SendEmail / SendRawEmail is called with a recipient on the
account-level suppression list whose reason matches the effective
SuppressedReasons (the configuration set's SuppressionOptions
override if present, else the account-level reasons), Floci now:
1. Emits a synthetic Bounce or Complaint event (per the suppression
reason) through the configured event destinations alongside the
always-emitted Send event.
2. Drops the suppressed recipient from the SMTP relay step, while
still delivering the message to non-suppressed recipients on the
same send.
The SendEmail API response (200 + MessageId), the stored SentEmail
(used by the LocalStack-compatible /_aws/ses inspection endpoint),
and the published event's mail.destination all continue to reflect
the original recipient list — matching how AWS reports the message
at the API and event layers.
This PR bundles two related pieces:
- The per-configuration-set SuppressionOptions block (Put endpoint +
GetConfigurationSet response shape + getEffectiveSuppressedReasons
helper). Mirrors AWS V2 PutConfigurationSetSuppressionOptions:
empty list = explicit "no suppression filtering" for this CS,
unset block = fall back to account-level reasons. The validation
message for the new endpoint matches the AWS V2 natural-language
form ("Reason <X> is invalid, must be one of [BOUNCE, COMPLAINT].")
which is distinct from the V1-style nested message returned by the
three older suppression endpoints; both forms were verified
against live AWS on 2026-06-03.
- The send-time filter + synthetic-event partitioning, plumbed
through getEffectiveSuppressedReasons so the override takes effect
per-send. collectSuppressedReasons and resolveSuppressionReason
now both take configurationSetName, hitting the per-CS override
when present and falling back to the account-level reasons
otherwise.
Per-recipient: when only some recipients are suppressed, the
non-suppressed ones still reach smtpRelay.relay() / relayRaw().
The relay is skipped entirely only when every recipient is
suppressed.
- Recipient suppressed with reason BOUNCE (and BOUNCE in the
effective reasons) -> synthetic Bounce event; not relayed.
- Recipient suppressed with reason COMPLAINT (and COMPLAINT in the
effective reasons) -> synthetic Complaint event; not relayed.
- Reason mismatch or address not on the list -> Send only; relayed
normally.
- Simulator-address recipients and suppression-listed recipients
are unioned into the same event's recipient list, deduplicated.
Tests
- SesConfigurationSetSuppressionOptionsV2IntegrationTest (16 cases)
for the CRUD + helper.
- SesConfigurationSetTest SDK compat (6 V2 cases) using
SesV2Client.PutConfigurationSetSuppressionOptions and the typed
SuppressionListReason enum (+ the WithStrings escape hatch for
the server-side validation path).
- SesServiceSmtpTest grows four cases pinning the send-time
override behaviour: empty list on the CS disables filtering and
the relay receives the address; BOUNCE-only override leaves
COMPLAINT-suppressed addresses unfiltered; a CS without an
override falls back to account-level (parity with no-CS sends);
raw-send mirrors the JSON-send path.
- SesEventPayload / SesEventPublishingV2IntegrationTest / further
send-path coverage from the original suppression PR is preserved.
- All 452 SES tests pass.
A resource that failed to provision was silently ignored — the stack still reached
CREATE_COMPLETE, leaving a half-built stack behind. The execution now stops on the
first CREATE_FAILED/UPDATE_FAILED resource and, on a create, deletes the resources
already created in that execution so the stack ends ROLLBACK_COMPLETE on a clean
slate and a corrected re-deploy can succeed. Updates mark UPDATE_ROLLBACK_COMPLETE
and keep prior physical ids (full prior-template restoration is out of scope). The
rolled-back terminal state is persisted so it survives a restart.
Tests cover rollback + successful retry and the single-failed-resource case.
Refs #924
provisionApiGatewayV2 {Api,Route,Integration,Stage} re-created resources on every
stack update, duplicating routes/integrations on redeploy. They now patch in place
via the service's updateX when the resource already has a physical id. Deployments
are immutable so a redeploy reuses the existing one, and Stage now carries
StageVariables.
Test covers update-in-place (stable physical ids, no duplication) and an
idempotent no-op redeploy.
Refs #924
Provision AWS::ElasticLoadBalancingV2 LoadBalancer, TargetGroup, Listener, and
ListenerRule through CloudFormation instead of the synthetic stub branch.
- Full Ref/GetAtt parity (all Ref=ARN; LB DNSName/CanonicalHostedZoneID/
LoadBalancerFullName, TG TargetGroupFullName, etc.), verified against the CFN
Template Reference.
- Listener and ListenerRule support the update (modify) path on redeploy.
- Parses forward/redirect/fixed-response actions and the full rule-condition set.
- Teardown leaves no orphans: deleting a listener/rule now unlinks the target
group from its load balancer.
Tests cover create (LB+TG+Listener+Rule wired together), update (listener port),
and delete-no-orphans.
Refs #924
Stacks lived only in memory, so after a Floci restart CloudFormation forgot every
stack and cdk deploy/destroy could no longer find them, orphaning the underlying
resources. Back the stacks and exports registries with StorageFactory
(cloudformation-stacks.json / cloudformation-exports.json): the in-memory maps stay
the live working copy with write-through at each lifecycle checkpoint and a load on
startup. Everything is stored under one fixed account namespace (CloudFormation is
account-blind), which stays consistent across request and background executor
threads. Stack/StackResource/ChangeSet/StackEvent are now reflection- and
unknown-field-tolerant for storage. Follows the configured global storage mode.
Tests cover a full stack-graph round-trip across storage instances and an
end-to-end persistent-mode write to disk.
Refs #924
Provision AWS::ECS::Cluster, AWS::ECS::TaskDefinition, and AWS::ECS::Service
through CloudFormation instead of falling through to the synthetic stub branch.
- Ref/GetAtt parity with AWS: Cluster Ref=name + Arn; TaskDefinition Ref=ARN
(immutable, each update registers a new revision); Service Ref=ARN + Name/ServiceArn.
- Delete leaves no orphans (service parsed from its ARN via AwsArnUtils, tasks stopped).
- Fills the service gaps real CDK templates need: TaskDefinition taskRoleArn/
executionRoleArn, and Service NetworkConfiguration (awsvpc subnets/security groups/
assignPublicIp) via new NetworkConfiguration/AwsVpcConfiguration models, surfaced in
DescribeTaskDefinition/DescribeServices.
Tests cover create, update (new task-def revision + desiredCount), and delete-no-orphans.
Refs #924
ImageCacheService.ensureImageExists surfaced docker-java's pull
exceptions straight to its caller on the first failure. When the
underlying registry returned a transient 5xx — most notably ECR
Public's / Docker Hub's "toomanyrequests" rate limit — this caused
the surrounding operation to fail outright even though a retry a
moment later would succeed. In CodeBuild's case it manifested as
build status FAULT (CodeBuildRunner catches the exception and sets
status=FAULT + buildComplete=true), showing up as flakes in the
sdk-test-java CI job on PRs that don't touch CodeBuild at all.
- Add runWithRetry(imageUri, maxAttempts, initialBackoffMs, attempt)
static helper that retries transient pull failures up to
MAX_PULL_ATTEMPTS=3 times with exponential backoff starting at
INITIAL_BACKOFF_MS=500ms (500ms -> 1s -> 2s). The throwable is
passed to LOG.warnv(e, ...) so the cause survives in the log
stream, matching the Floci-wide pattern (SmtpRelay,
CognitoAuthFlowHandler, etc.).
- A failure is treated as transient when either:
(a) the docker daemon throws InternalServerErrorException directly
(HTTP 500, sync path), or
(b) PullImageResultCallback.awaitCompletion rewraps the same
daemon error as DockerClientException whose message starts
with "Could not pull image: " (async-callback path; same root
cause, different exception class). Both forms have been
observed against ECR Public and Docker Hub in CI.
- isTransientPullFailure(e) helper centralizes the classification.
Permanent failures (auth, missing image, malformed request, or
any other DockerClientException not coming from the pull wrapper)
keep surfacing their original docker-java exception subclass on
the first attempt and are not retried.
- Wire ensureImageExists's existing pull invocation through the
retry helper. The synchronized-once and isLocalImagePresent
fast-path semantics are unchanged.
- New ImageCacheServiceTest covers nine cases against the static
helper (no DockerClient mocking needed): first-attempt success,
retry-then-succeed (sync InternalServerErrorException),
max-attempts-exhausted-rethrows, no-retry-on-NotFoundException,
no-retry-on-UnauthorizedException, no-retry-on-generic-
DockerException, retry-then-succeed on the pull-wrapper
DockerClientException, no-retry on an unrelated
DockerClientException (container start failure), and
InterruptedException propagated as-is.
Out of scope: NeptuneContainerManager and other container managers
that call dockerClient.pullImageCmd directly (bypassing
ImageCacheService) still hit the same rate-limit path without
retries. Routing those through ImageCacheService is a separate
refactor.
* feat(appsync): add GraphQL API management service
Implement Phase 1 CRUDL management API for AWS AppSync.
Includes controller, service layer, and model classes for:
- GraphQL API lifecycle (create/get/update/delete/list)
- Schema creation and introspection
- Data Sources, Resolvers, Functions, Types, API Keys
- Tagging and Environment Variables
* chore(appsync): register service in config and catalog
Add AppSync service configuration (EmulatorConfig), service
descriptor (ResolvedServiceCatalog), YAML config entries, and
SDK test client fixture.
* test(appsync): add integration and SDK compatibility tests
AppSyncIntegrationTest: 44 tests covering CRUDL for all resources
GraphQL API, Schema, DataSources, Resolvers, Functions, Types,
API Keys, Tags, Environment Variables, and cascade delete.
AppSyncTest: AWS SDK v2 compatibility tests for management API
operations using the real AppSyncClient.
* feat(appsync): add typed enums for AWS API models
Add Java enums matching AWS AppSync API constants:
- AuthenticationType (API_KEY, AWS_IAM, COGNITO, OIDC, LAMBDA)
- DataSourceType (NONE, LAMBDA, DYNAMODB, HTTP, EVENTBRIDGE, ...)
- ResolverKind (UNIT, PIPELINE)
- ResolverRuntimeName (APPSYNC_JS, VTL)
- TypeFormat (SDL, JSON)
- SchemaCreationStatusType (PROCESSING, ACTIVE, FAILED, ...)
* refactor(appsync): align model types with AWS API reference
- DataSource.type: String → DataSourceType enum
- GraphqlApi.authenticationType: String → AuthenticationType enum
- GraphqlApi.logConfig: String → Map<String, Object> (structured)
- GraphqlApi.additionalAuthenticationProviders: Map → List<Map> (array)
- GraphqlApi.xrayEnabled: String → Boolean
- Resolver.kind: String → ResolverKind enum
- Resolver.ResolverRuntime.name: String → ResolverRuntimeName enum
- AppSyncType.format: String → TypeFormat enum
- SchemaCreationStatus.status: String → SchemaCreationStatusType enum
- ApiKey.expires: String → Long (epoch seconds)
* fix(appsync): correct ARN format, add enum validation, fix field types
- Function ARN: add missing region parameter
- Add parseEnum() helper for type-safe enum deserialization
- Reject invalid enum values with BadRequestException (400)
- Handle String/Boolean/Number coercion for xrayEnabled, expires
- Remove extra 'details' from StartSchemaCreation response
- Pass region to createFunction from controller
* fix(appsync): validate required fields on resource creation
Reject requests missing required fields with BadRequestException (400):
- CreateGraphqlApi: name required
- CreateDataSource: name and type required
- CreateResolver: fieldName and dataSourceName required
- CreateFunction: name required
- CreateType: name required
* test(appsync): add error handling, delete standalone, and cascade tests
Add 22 new integration tests (44 → 66 total):
- Error handling: missing name, blank name, invalid enum, missing required
fields for API/DataSources/Resolvers/Functions/Types (11 tests)
- Non-existent resource 404 tests for API, DataSource, Type (3 tests)
- Delete standalone: verify CRUD delete for Resolver, DataSource,
Function, Type, ApiKey with post-delete 404 confirmation (5 tests)
- Cascade verification: API delete cascades to DataSources and Functions;
Function delete does not affect resolvers (3 tests)
* feat(appsync): add pagination support for list endpoints
Add maxResults and nextToken query params to all list endpoints:
- ListGraphqlApis, ListDataSources, ListResolvers, ListResolversByFunction
- ListFunctions, ListTypes, ListApiKeys
Uses offset-based pagination with Base64-encoded tokens, following
the Pricing service pattern. Returns nextToken when more results
are available, null when all results have been returned.
* test(appsync): add pagination integration tests
Add 9 pagination tests (66 → 75 total):
- ListApis with maxResults returns subset and nextToken
- ListApis with nextToken returns second page
- ListApis without pagination returns all items
- ListDataSources, ListTypes, ListFunctions, ListApiKeys,
ListResolvers with maxResults
- Invalid nextToken returns 400
* fix(appsync): align SDK test with AWS SDK v2 model, extract type name from SDL
- Fix SDK test: use typeAsString() for enum comparison, remove apiKey()
field assertion, use functions() instead of functionConfigurationList()
- Extract type name from SDL definition when name is not provided
(matches real AWS CreateType behavior)
- Update integration test for type creation without explicit name
* fix(appsync): use extracted type name when definition-based extraction succeeds
The type name extracted from SDL definition was stored in a local
variable but not set on the AppSyncType object, causing createType
to return a type without name and making subsequent get/delete fail.
* refactor(appsync): inject RegionResolver instead of passing region as string
Follow the established pattern used by BackupService and PipesService.
Replace manual ARN string concatenation with regionResolver.buildArn()
and remove the hardcoded accountId field.
* fix(appsync): add functionId to Resolver model and fix listResolversByFunction filtering
The listResolversByFunction endpoint was incorrectly comparing
function.getName() with resolver.getDataSourceName(), which is not
the correct AWS AppSync relationship. Resolvers reference functions
via a functionId field, not by data source name matching.
- Add functionId field to Resolver model
- Handle functionId in createResolver and updateResolver
- Fix listResolversByFunction to filter by functionId
- Add listResolversByType method for per-type filtering
* feat(appsync): add global listResolvers endpoint
Add GET /v1/apis/{apiId}/resolvers to list all resolvers across all
types, matching the AWS AppSync API. The per-type endpoint
(GET /v1/apis/{apiId}/types/{typeName}/resolvers) is preserved.
- Add global listResolvers to controller
- Rename per-type endpoint to listResolversByType for clarity
- Add integration test for global listResolvers
- Update listResolversByFunction test to verify functionId-based filtering
* test(appsync): complete SDK compatibility tests for Phase 1
Add missing SDK v2 compatibility tests to match all Phase 1 operations:
- API Keys: updateApiKey, deleteApiKey
- Resolvers: updateResolver
- Types: createType, getType, listTypes, updateType
- Error handling: getNonExistentApi, getNonExistentDataSource,
getNonExistentType throw AppSyncException
Total SDK tests: 24 → 35. All operations in Phase 1 are now covered.
V2 SES already exposes ConfigurationSet event-destination CRUD via
REST JSON; this PR adds the matching V1 Query actions
(CreateConfigurationSetEventDestination /
UpdateConfigurationSetEventDestination /
DeleteConfigurationSetEventDestination) and extends
DescribeConfigurationSet so V1 callers can round-trip their stored
destinations. The service layer (`SesService.createConfigurationSetEventDestination`
etc.) already had the persistence and validation logic, so most of the
work is wire-format: parse V1 Query parameter shapes, render V1 XML
responses, and route the new action names.
- SesQueryHandler: three new Query actions plus
`readEventDestination(params, prefix)` and `writeEventDestination`
helpers. V1 wire field names use uppercase `ARN` / `NS` suffix
variants (`SNSDestination.TopicARN`,
`KinesisFirehoseDestination.IAMRoleARN` / `DeliveryStreamARN`,
`CloudWatchDestination.DimensionConfigurations.member.N`) which are
mapped onto the existing model classes; the `EventDestination.Enabled`
default mirrors the V2 primitive-boolean default of `false` when
omitted.
- V1 event-type wire forms are lowercase camelCase (`send`,
`complaint`, `renderingFailure`) while floci stores the V2 canonical
form (SCREAMING_SNAKE). New `V1_EVENT_TYPE_TO_INTERNAL` /
`INTERNAL_EVENT_TYPE_TO_V1` maps translate in both directions; unknown
values pass through so the existing validate-against-VALID_EVENT_TYPES
check still catches typos.
- `handleDescribeConfigurationSet`: when
`ConfigurationSetAttributeNames.member.N=eventDestinations` is
requested, render the stored event destinations as a V1 XML block.
Treat a null `ConfigurationSet.eventDestinations` list as empty when
rendering, so a corrupted persisted JSON with `"EventDestinations": null`
still produces an empty `<EventDestinations/>` container rather than
NPE-ing. Other ConfigurationSet attribute names (trackingOptions,
deliveryOptions, reputationOptions) remain unsupported and are
silently ignored — they will land with their respective Put*Options
PRs. The container is emitted even when the destination list is
empty so the response depends only on the requested attributes.
- `writeEventDestination`: skip destination blocks when required fields
are blank (defensive belt-and-suspenders for any legacy state) and
filter incomplete CloudWatch dimension members so partial members
don't leak into the XML.
- `SesService.validateEventDestination`: centralize required-field
validation for SNS / Firehose / CloudWatch dimensions, so both V1
and V2 reject partial destinations at create/update time. Members
with missing required fields now fail with a 400
`InvalidParameterValue` carrying the offending member index.
- `AwsQueryController.SES_ACTIONS`: include the three new actions in
the action-name → "email" service routing fallback so SigV4 requests
whose credential scope doesn't pin the service still reach SES.
Tests
- `SesConfigurationSetEventDestinationV1IntegrationTest`: 15 cases
covering create / describe-with-attribute / describe-without-attribute
/ describe-empty-attribute / duplicate / update / update-unknown /
delete / delete-unknown / partial Firehose / partial CloudWatch dim
/ blank SNS TopicARN / action-name routing fallback when the
Authorization header is absent.
- `SesServiceEventDestinationTest`: 8 new unit cases for the
centralized SNS / Firehose / CloudWatch dim validation, exercising
validateEventDestination directly.
- `compatibility-tests/sdk-test-java SesConfigurationSetEventDestinationTest`:
extended to drive both V1 (SesClient) and V2 (SesV2Client) against a
live Floci. Each protocol gets its own config set; nine new V1 tests
mirror the V2 lifecycle plus partial-Firehose rejection.
* feat(ses): publish SES events to SNS configuration set destinations
Add SES V2 event publishing to SnsDestination targets configured on a
ConfigurationSet. When SendEmail / SendRawEmail / SendTemplatedEmail /
SendBulkEmail is invoked with a ConfigurationSetName, Floci builds the
matching AWS-format event payload (a `mail` block plus an event-type-
specific block) and publishes it to each enabled SNS destination whose
MatchingEventTypes includes that event.
Events emitted
- SEND on every successful send.
- DELIVERY / BOUNCE / COMPLAINT / REJECT when a recipient matches the
corresponding AWS mailbox simulator address (success@ / bounce@ /
complaint@ / suppressionlist@simulator.amazonses.com).
- Per-event-type recipient lists (delivery.recipients,
bounce.bouncedRecipients, complaint.complainedRecipients) are
filtered to only the simulator address that triggered the event and
emitted in their canonical trimmed form; mail.destination carries
the full envelope.
Wire-level fidelity
- Event payload mirrors the AWS SES SNS notification format documented
at https://docs.aws.amazon.com/ses/latest/dg/event-publishing-retrieving-sns-examples.html.
- mail.tags includes user-supplied EmailTags / DefaultEmailTags /
ReplacementTags (V2) and Tags.member.N / DefaultTags.member.N /
Destinations.member.N.ReplacementTags (V1 Query). Each tag emits as
{Name: [Value]}.
- mail.headers[] appends user-supplied Content.Simple.Headers and
Content.Template.Headers after the auto-emitted From/To/Cc/Subject;
null/blank Names are rejected with "The header name must be
specified." (BadRequestException 400).
- V2 SendBulkEmail BulkEmailEntries accept ReplacementTags (merged by
Name onto DefaultEmailTags) and ReplacementHeaders (merged
case-insensitively per RFC 5322 onto DefaultContent.Template.Headers).
- mail.sendingAccountId resolves from EmulatorConfig.defaultAccountId().
- ConfigurationSet existence is validated up-front on sendEmail /
sendRawEmail / sendBulkTemplatedEmail — an unknown name fails fast
with ConfigurationSetDoesNotExist (V2 controller remaps to
NotFoundException 404, V1 returns 400) before any message is stored
or relayed.
Validation errors aligned with live AWS
- EmailTags blank Name: BadRequestException 400 "The tag name must be
specified." (V2) / InvalidParameterValue 400 same message (V1).
- ConfigurationSetName not found: same error code, status, and message
as AWS.
Raw email handling
- For V2 SendEmail with Raw content (and V1 SendRawEmail), when the
caller did not provide Destinations, Floci falls back to To/Cc/Bcc
parsed from the raw MIME via SmtpRelay.parseRawHeaders (extracted
from the existing relay logic). MIME parsing is only invoked when
needed (no explicit Destinations or event publishing active).
Internal shape
- New records: model/MessageTag (Name, Value, for EmailTags) and
model/MessageHeader (Name, Value, for Content.Headers) — kept
distinct from the resource-tag Tag (Key, Value).
- SesEventPublisher dispatches to SnsService; non-SNS destination
types log a warning and are skipped (Firehose / EventBridge /
CloudWatch / Pinpoint), and missing SnsDestination.TopicArn likewise
warns instead of silently dropping. Failures preserve the throwable
in the warn log.
Tests
- SesEventPayloadTest covers mail/commonHeaders/headers/tags shape,
per-event filtering, and the headers/tags propagation paths.
- SesServiceMergeEmailTagsTest / SesServiceMergeHeadersTest pin Bulk
Default vs per-entry merge semantics (tags by Name case-sensitive,
headers by Name case-insensitive per RFC 5322).
- SesEventPublishingV2IntegrationTest exercises Send / Delivery /
Bounce / SendOnly / mixed-recipient / disabled-destination /
V1-MIME-fallback / EmailTags / V1-Tags / Simple.Headers paths
end-to-end through SES -> SNS -> SQS.
- compatibility-tests/sdk-test-java/SesEventPublishingTest validates
SendEmail with EmailTags/Headers and SendBulkEmail with per-entry
ReplacementHeaders override using AWS Java SDK V2 clients.
* fix(ses): address Copilot review on upstream PR #1106
- SesService.validateConfigurationSet: clarify the Javadoc — the
helper always throws with httpStatus = 400, and the V2 controller's
remapV1Exception is what turns ConfigurationSetDoesNotExist into
NotFoundException 404. The previous "(404 in V2, 400 in V1)" hint
read as if the helper itself picked the status, which is misleading.
- SesController.parseEmailTagsArray: reject non-object entries with
"<fieldName> entries must be JSON objects.", mirroring the existing
parseHeadersArray check. Previously a string/number element would
hit the blank-Name path and report a less specific message.
- SesService.mergeHeaders / mergeEmailTags: also skip entries whose
name is the empty string, not just null. Both parsers reject blank
names at the boundary, but defending the merge helpers keeps them
safe for direct callers (e.g., future tests) and matches the intent
of the boundary validation.
* fix(ec2): add Volume throughput, DescribeAddressesAttribute, and IAM instance profile parity
Three EC2 read-path gaps broke Terraform/OpenTofu apply cycles:
throughput to the Volume model, parsed it in CreateVolume, and emitted it
in CreateVolume/DescribeVolumes. gp3 defaults to 125 MiB/s (matching AWS);
other volume types leave it null.
the VPC module's aws_eip read cycle. Implemented the operation (returns
allocationId + publicIp per AddressAttribute) and added it to the EC2
action allowlist.
instance was launched with one, and DescribeIamInstanceProfileAssociations
returned UnsupportedOperation — causing perpetual Terraform drift then a
hard failure. instanceXml now emits <iamInstanceProfile> (arn + id), and
DescribeIamInstanceProfileAssociations is implemented with instance-id
filter and AssociationId lookup. Profile and association ids are derived
deterministically from the instance id so repeated describes are stable.
Verified against AWS SDK v2 shapes (Volume.Throughput,
AddressAttribute, IamInstanceProfileAssociation).
* fix: incorrect exception throw
JBoss Logging's *v methods (infov/warnv/errorv/debugv) format arguments
with java.text.MessageFormat, which applies locale grouping to integer
placeholders — so an int port 7001 was logged as "7,001". This produced
misleading startup/proxy logs like "on port 7,001 → 172.18.0.5:5,432".
Wrap every int port argument passed to a *v log call in String.valueOf()
so MessageFormat treats it as a plain string and emits it verbatim.
Covers RDS, ElastiCache, Neptune, Lambda runtime, OpenSearch, EKS, ECR,
ELBv2, EC2, SES, TLS proxy, and the core PortAllocator /
ContainerLifecycleManager. printf-style logf calls and already-string
args were unaffected and left unchanged.
tagResource, untagResource, and listTagsForResource detected the resource
type with resourceArn.contains("event-bus/"). A rule ARN on a custom bus —
rule/my-event-bus/test-rule — also contains "event-bus/", so it matched the
bus branch instead of the rule branch and failed with ResourceNotFoundException.
Parse the ARN with AwsArnUtils.parse(arn).resource() and dispatch on
resource.startsWith(...) against the resource segment only, so a bus name
substring can no longer trigger a false branch match. The duplicated
rule-name/bus-name split logic is extracted into a parseRuleResource helper
returning a RuleRef record.
Closes#963
When multiple ProjectionExpression paths share the same parent map
(e.g. data.title, data.answer, data.sources), copyPath() created a
fresh ObjectNode for each path and overwrote the previous projection.
Only the last sibling path was returned.
Fix: reuse the existing destination node when the parent key has already
been projected, so all sibling paths accumulate into the same node.
Applied to both the {"M": ...} DynamoDB-typed branch and the isObject()
plain-object fallback.
Additional fixes applied during review:
- List index [n] branch: same overwrite guard added (was also
unconditionally overwriting dest[seg] on repeated access)
- Leaf deep-copy: dest.set(seg, child.deepCopy()) prevents placing a
live source reference into the destination, which a subsequent sibling
path could have mutated via the isObject() reuse logic
- Test cleanup: replaced @Order(100) teardown with @AfterAll so the
table is always deleted even when a test fails
- Added direct ProjectionEvaluator unit test for the isObject() branch
Closes#852
* fix(s3): reject response-* overrides on unsigned requests
AWS S3 requires a signed request (Authorization header or presigned URL)
when any of the six response-* query parameters are present. Unsigned
requests with these parameters were silently honoured, diverging from
real S3 behaviour in a way that would only surface in production.
Confirmed against real S3: HTTP 400, Code=InvalidRequest,
"Request specific response headers cannot be used for anonymous GET requests."
Adds hasAny() to ResponseHeaderOverrides and an isSigned() check
(Authorization header or X-Amz-Algorithm query param) applied to both
GetObject and HeadObject before the overrides are applied.
Closes#918
* fix(s3): sign response-* override tests to match AWS requirement
PreSignedUrlIntegrationTest orders 11, 12, 14, and 16 made anonymous
requests with response-* query params and expected 200. These tests now
correctly reflect the AWS requirement that response-* overrides must be
on a signed request — anonymous requests must be rejected (closes#918).