* feat: Implement Cognito GlobalSignOut
* fix(cognito): validate user existence and jti in GlobalSignOut
Address PR #1701 review:
- Add adminGetUser existence check before revoking tokens so a crafted
token referencing a nonexistent pool/user returns UserNotFoundException/
ResourceNotFoundException instead of silently writing revocation records
and returning 200, matching AdminUserGlobalSignOut and getUser.
- Include jti in the invalid-token guard so legacy tokens without a jti
claim cannot be used as a sign-out credential, consistent with getUser.
- Cover the nonexistent-user path with an integration test.
* fix(cognito): error reporting
* fix: map ResourceNotFoundException -> NotAuthorizedException
* fix(s3): return default SSE-S3 from GetBucketEncryption instead of 404
Real S3 no longer 404s GetBucketEncryption for a bucket with no explicit
config: since 2023-01-05 every bucket has SSE-S3 (AES256) default encryption,
so GetBucketEncryption returns that config rather than
ServerSideEncryptionConfigurationNotFoundError.
https://docs.aws.amazon.com/AmazonS3/latest/userguide/default-bucket-encryption.html
"Amazon S3 now applies server-side encryption with Amazon S3 managed keys
(SSE-S3) as the base level of encryption for every bucket in Amazon S3.
Starting January 5, 2023, all new object uploads to Amazon S3 are
automatically encrypted."
Floci still emulated the pre-2023 404-when-unset behavior.
Some software relies on the new behavior, such as AWS's AWS Controllers for K8s
s3-controller: its Bucket read-back catches the NotFound code but does not
return, then dereferences ServerSideEncryptionConfiguration.Rules on a nil
response (nil-pointer panic that loops the controller). ACK code for reference:
https://github.com/aws-controllers-k8s/s3-controller/blob/v1.6.0/pkg/resource/bucket/hook.go
Return the AWS default SSE-S3 config when none is set; an explicit
PutBucketEncryption config is still echoed back, and a missing bucket still
404s NoSuchBucket. Mirrors GetBucketRequestPayment's existing default.
Closes#1836
* test(s3): cover GetBucketEncryption default after DeleteBucketEncryption
Greptile flagged the delete-then-get path was uncovered: after
DeleteBucketEncryption nulls the stored config, GetBucketEncryption must
fall back to the default SSE-S3 (AES256) rather than the prior KMS config
or a 404. Adds an ordered case exercising the ?encryption DELETE handler
plus the null-after-delete branch.
DELETE /{bucket}?replication fell through the sub-resource switch (which handled
tagging/website/policy/cors/lifecycle/encryption/publicAccessBlock/ownershipControls
but not replication) to the unqualified DeleteBucket, silently destroying the
entire bucket and returning 204.
Real S3 DeleteBucketReplication removes only the replication configuration and
returns 204; a sub-resource-qualified DELETE never deletes the bucket:
https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketReplication.html
Floci does not model replication, so DeleteBucketReplication is a no-op 204 --
handled explicitly so it cannot reach the bucket-delete fall-through.
Closes#1835
* feat(stepfunctions): support JSONata workflow variables (Assign)
Add support for execution-scoped workflow variables in JSONata state
machines. States may declare an `Assign` field whose values are
evaluated as JSONata and stored as variables that later states
reference as top-level `$name` bindings.
An execution-scoped `variables` object is threaded through every state
executor and mutated in place, so assignments persist across states.
Parallel branches and Map iterations each receive an isolated copy, so
assignments inside them do not leak back to the parent scope, matching
AWS.
Within a state, `Assign` is evaluated before `Output`, so a state's own
`Output` (and all later states) observe the newly assigned variables,
matching AWS evaluation order.
Assign is currently supported for JSONata states only; JSONPath-mode
Assign is left as a follow-up.
Closes#1507
Co-authored-by: Juri Duval <27741935+Mulgish@users.noreply.github.com>
* fix(stepfunctions): resolve JSONata Assign against the state-entry scope
Variable references in a state, including the state's own Output, must
resolve against the values the variables held on state entry. Assign and
Output are now both evaluated against the pre-assignment scope, and the
new values are committed afterwards, so they first become visible to the
next state.
Verified against a recorded AWS execution (localstack's AWS-validated
BASE_EVALUATION_ORDER_PASS_STATE snapshot): a state that assigns
answer="<omitted>" while reading $answer in its own output still emits
the state-entry value 42.
Workflow variables are also bound alongside $states rather than inside
it, since AWS reserves $states for input/result/errorOutput/context.
Tests:
- assignedVariablesAreNotVisibleUntilTheNextState replaces
assignedVariableVisibleToSameStateOutput, which asserted the inverse.
It follows the evaluation-order example from the AWS docs: from $x=3,
$a=6, the block {"x": "{% $a %}", "nextX": "{% $x %}"} ends with $x=6
and $nextX=3 while the assigning state's Output still emits 3.
- variablesAssignedInsideMapDoNotLeakToParentScope now uses a distinct
inner variable name, mirroring AWS's own BASE_SCOPE_MAP fixture; AWS
rejects an inner scope reusing an outer-scope variable name.
* feat(stepfunctions): apply JSONata Assign in Choice rules, Wait states and Catch blocks
Assign was only committed via applyJsonataOutput, which Choice and Wait never
call, so an Assign on either state was silently dropped and Catch blocks could
not assign at all. AWS supports Assign on Pass, Task, Map, Parallel, Choice and
Wait, plus inside Choice rules and Catch fields.
- Choice: a matched rule applies its own Assign and Output; the state-level ones
apply only on the Default path.
- Wait: applies Assign and Output.
- Catch: applies Assign and Output with $states.errorOutput bound, into the scope
the catching state lives in.
- Bind $states after the workflow variables so a variable named "states" cannot
clobber the reserved binding.
Assign, Choice-rule and Catch blocks all keep the AWS evaluation rule already in
place for states: every expression is evaluated against the values held on state
entry, and the new values are committed only afterwards.
---------
Co-authored-by: Juri Duval <27741935+Mulgish@users.noreply.github.com>
First slice of decomposing CloudFormationResourceProvisioner (the repo's largest
class: ~30 injected services and 75 resource types in two switches).
Introduce the scaffolding for per-service provisioners:
- CfnResourceProvisioner: a provision/delete interface for one service's types.
- ProvisionContext: the {engine, region, accountId, stackName} handlers draw from,
with resolveOptional/generatePhysicalName lifted verbatim from the monolith.
- CloudFormationResourceRegistry: a CDI-collected resource-type -> provisioner map,
with a public factory constructor for tests; duplicate registration throws.
CloudFormationResourceProvisioner now consults the registry before its switch and
falls through for unmigrated types, so the two coexist during the migration. SQS is
the first extraction: SqsCfnProvisioner (injects only SqsService) owns Queue and
QueuePolicy; its switch cases and provisionXxx methods are removed. The registry is
added to the constructor once so later slices do not reshuffle positional args.
SqsCfnProvisionerTest exercises the provisioner with a single mocked service, the
payoff versus the ~30 mocks the monolith requires. Behavior is unchanged: the full
CloudFormation integration suite (174 tests) stays green.
GetUser, ListAccessKeys and DeleteAccessKey treat UserName as optional: the
IAM model documents it as defaulting to the user making the request. Floci
ignored the caller and passed the missing name straight through, so GetUser
fell back to a "root" user that is never seeded and the access-key actions
passed null. Every one of them ended in NoSuchEntity.
Resolve UserName from the access key that signed the request, falling back to
NoSuchEntity (the model's code for these operations, 404, senderFault) when
the key maps to no stored user.
Those errors were also rendered wrong. Query handlers that catch AwsException
build their own error XML, but the ones that don't reach AwsExceptionMapper,
which emits JSON — a JSON error body on the XML wire, which SDK parsers fail
on before they can surface anything useful. AwsQueryController now renders
AwsException as the Query error contract, preserving the declared code and
status, and maps any other handler exception to InternalFailure rather than
letting Quarkus' JSON error page escape.
CloudWatch Metrics is the handler that renders no error XML of its own, so it
is the regression test for the pass-through: SetAlarmState on a missing alarm
must stay 404 ResourceNotFound and not collapse into a 500.
Closes#1753
EventSourceMapping.DestinationConfig and its nested OnFailure are reachable
from Lambda's persisted event-source-mapping storage but carried no
@RegisterForReflection (the annotation on the enclosing class does not cover
nested static classes). In native-image mode this breaks deserialization of a
mapping's failure destination on restart.
Annotate both nested classes with @RegisterForReflection, matching the existing
convention (IotPolicy.PolicyVersion, LambdaUrlConfig.Cors). Also add
@JsonIgnoreProperties(ignoreUnknown = true) — as the enclosing class already
has — so the nested wire shapes tolerate future AWS field additions rather than
failing deserialization. PersistedModelReflectionTest, the classpath-scan guard
that flagged this, now passes.
Refs #1629, #1781
Lambda containers reach Floci via host.docker.internal when Floci
runs on the host instead of in a container, but the cert never
included it as a SAN, failing TLS verification.
* feat(ses): implement Contact CRUD for SES v2
Add the SES v2 Contact APIs under /v2/email/contact-lists/{name}/contacts:
CreateContact, GetContact, ListContacts (POST .../contacts/list),
UpdateContact, DeleteContact. Contacts carry per-topic subscription
preferences, an unsubscribe-all flag, and free-form attributes;
TopicDefaultPreferences is derived at read time from the list's topics.
Behaviour is verified against real AWS: validation order (Smithy enum ->
EmailAddress format -> list existence -> topic existence), AlreadyExists /
NotFound / invalid-topic / invalid-email error shapes, and the UpdateContact
semantics (TopicPreferences merge by topic name; AttributesData and
UnsubscribeAll replaced). Covered by a RestAssured integration test and an
AWS Java SDK v2 compatibility test.
* refactor(ses): resolve contact list once for reads and delete under lock
Address review consistency findings on the Contact CRUD read/delete paths:
- getContact/listContacts returned only the contact(s), so the controller
fetched the ContactList a second time to render TopicDefaultPreferences.
Between the two calls a concurrent delete could turn a successful read into a
misleading "List not found". The service now returns the resolved list
alongside the contact(s) (ContactWithList / ContactsWithList), so the read is
a single, consistent lookup.
- deleteContact re-checked list existence before acquiring contactMutationLock,
unlike createContact/updateContact which re-check inside it. Move the
getContactList check inside the lock so a concurrent deleteContactList
surfaces "list not found" rather than "contact not found".
* fix(s3): omit checksum headers from GetObject/HeadObject unless x-amz-checksum-mode: ENABLED
Real AWS only returns x-amz-checksum-* headers on GetObject and HeadObject
responses when the client sends x-amz-checksum-mode: ENABLED. Without that
header, returning the checksum causes the PHP AWS SDK to attempt checksum
validation on a non-seekable streaming response body, throwing
"Stream is not seekable" and making fopen fail.
Closes#1632
* refactor(s3): drop dead appendObjectHeaders overloads, dedupe test @Order
Addresses Greptile review on PR #1633:
- Remove the now-unreachable 2-arg and 3-arg appendObjectHeaders overloads.
All real callers pass includeChecksum explicitly to the 4-arg version, so the
3-arg overload's hard-coded `true` was a footgun that could silently re-emit
checksum headers. Also drops the now-orphaned ResponseHeaderOverrides.NONE.
- Move getObjectWithChecksumModeReturnsChecksum / headObjectWithChecksumMode...
to the end of the 5-22 test block with unique @Order(23)/@Order(24), so they
no longer share @Order(5)/@Order(7) with getObject/headObject.
All 117 S3IntegrationTest cases pass.
* fix(s3): include checksum in empty-object suffix-range response when requested
The empty-object suffix-range path returns a full 200 via fullObjectResponse
instead of a 206, so it must honor x-amz-checksum-mode: ENABLED like any
other full-object response. It previously hardcoded includeChecksum=false,
omitting the checksum even when the client asked for it.
Also extends the existing suffix-range test to assert the checksum is
omitted without the header, and adds a new test covering the
x-amz-checksum-mode: ENABLED case.
* fix(s3): resolve rebase-onto-main test conflicts for checksum-mode gate
Sends x-amz-checksum-mode: ENABLED on the GetObject verification calls
that require checksum headers in the response (copyObject,
copyObjectWithoutChecksumOverride, copyObjectPreservesNonDefaultChecksum),
consistent with the behavioral fix in this branch. Adds
getObjectWithChecksumModeReturnsChecksum and
headObjectWithChecksumModeReturnsChecksum as self-contained tests with
unique, non-colliding @Order values.
---------
Co-authored-by: Mihai Blidaru <mihai.blidaru@lynxfctech.com>
* test(appsync): strengthen existing integration error tests with __type and message assertions
All 30 existing error assertions (400/404) previously checked only the HTTP
status code. Each now also verifies the AWS error body shape:
{"__type":"<ExceptionClass>","message":"<...>"}
This locks in the __type field that the AWS SDK v2 uses to instantiate the
typed exception (NotFoundException, BadRequestException, etc.) and guards
against accidental changes to error codes and messages.
* test(appsync): add 409 conflict and 429 limit tests
Add 7 new integration tests covering previously untested error paths:
ConflictException (409):
- createDataSourceDuplicateReturns409
- createResolverDuplicateReturns409
- createTypeDuplicateReturns409
- createDomainNameDuplicateReturns409
- createChannelNamespaceDuplicateReturns409
- associateApiDuplicateReturns409 (domain already associated)
LimitExceededException (429):
- createApiKeyExceedsLimitReturns429 (3rd key exceeds max 2 per API)
All tests are self-contained: create resources, assert the error, then
clean up. Each asserts statusCode + __type + message substring.
* test(appsync): add 404 tests for update/delete and cross-resource create
Add 11 new integration tests covering previously untested 404 paths:
Update/delete of non-existent resources (8):
- updateResolverNonExistentReturns404
- deleteResolverNonExistentReturns404
- updateFunctionNonExistentReturns404
- deleteFunctionNonExistentReturns404
- updateApiKeyNonExistentReturns404
- deleteApiKeyNonExistentReturns404
- updateDomainNameNonExistentReturns404
- updateChannelNamespaceNonExistentReturns404
Cross-resource 404 on create (3) — missing referenced resource:
- createResolverMissingDataSourceReturns404
- createFunctionMissingDataSourceReturns404
- associateApiMissingDomainReturns404
Each asserts statusCode + __type=NotFoundException + message substring.
* test(appsync): add pagination, edge case, and updateChannelNamespace tests
Add 7 new integration tests:
Pagination for previously untested list operations (3):
- listDomainNamesWithMaxResults
- listChannelNamespacesWithMaxResults
- listSourceApiAssociationsWithMaxResults
Each creates >=2 items, verifies page size + nextToken, follows token,
and cleans up.
Pagination edge cases (3):
- listWithMaxResultsZero (empty page + nextToken present)
- listWithNegativeMaxResultsReturns400
- listWithInvalidNextTokenNonApiReturns400 (data sources path)
Update channel namespace (1):
- updateChannelNamespace (verify description field change)
* test(appsync): upgrade SDK error tests to typed exceptions
Upgrade 4 existing SDK error tests from the generic AppSyncException to
the typed exception classes that the AWS SDK v2 maps from the __type
response field:
- getNonExistentApiThrowsException -> NotFoundException
- getNonExistentDataSourceThrowsException -> NotFoundException
- getNonExistentTypeThrowsException -> NotFoundException
- startSchemaCreation_invalidSchema -> BadRequestException
Each now also asserts hasMessageContaining with the expected message
substring. This aligns AppSyncTest with the repo convention used by
ApiGatewayV2ManagementTest, SchedulerTest, and ElbV2Test.
Also strengthen two existing update tests with field assertions:
- updateChannelNamespace: now sets codeHandlers and verifies the response
- updateDomainName: now asserts description field equals updated value
* fix: correct environment variables API path case for SDK compatibility
The AppSync controller used lowercase /v1/apis/{apiId}/environmentvariables
but the AWS SDK v2 sends to /v1/apis/{apiId}/environmentVariables (capital V).
This broke both getGraphqlApiEnvironmentVariables and
putGraphqlApiEnvironmentVariables for all SDK clients.
Fix the @Path annotations in the controller and update integration test
paths to match the SDK-expected casing.
* fix(appsync): align error codes and messages with AWS AppSync behavior
- DataSource duplicate: ConflictException 409 → BadRequestException 400
- Resolver duplicate: ConflictException 409 → BadRequestException 400
- Type duplicate: ConflictException 409 → BadRequestException 400
- DomainName duplicate: ConflictException 409 → BadRequestException 400
- Domain association duplicate: ConflictException 409 → BadRequestException 400
- API key limit: LimitExceededException 429 → ApiKeyLimitExceededException 400
- Add duplicate validation for Source API associations
- Add checkDuplicateSourceApiAssociation helper method
- Update all integration and SDK test assertions to match AWS exact messages
* feat(core): add extended data support to AwsException for AWS error parity
Add optional extended data to AwsException so the exception mapper can
emit structured error payloads matching the AWS error contract (e.g.
AppSync BadRequestException with reason=CODE_ERROR and detail.codeErrors).
The mapper auto-detects extended data and serializes it as additional
JSON fields alongside __type and message. When extended data is null
the previous simple AwsErrorResponse is returned, preserving behavior
for every existing error site.
* fix(appsync): return ConcurrentModificationException for duplicate source API association
AWS AppSync's AssociateSourceGraphqlApi returns ConcurrentModificationException
(HTTP 409) when an association already exists for the same source and merged
API pair. Floci was returning BadRequestException (400) with an association
ID in the message that did not match AWS.
Also filter out associations in DELETION_SCHEDULED status so a new
association can be created after the previous one has been removed, matching
AWS behavior where the previous association is no longer 'live'.
Message format now mirrors AWS: 'Source API association already exists
for Source API ID: <id> and Merged API ID: <id>.'
* refactor(appsync): remove non-AWS endpoints getApiKey and listAllResolvers
AWS AppSync does not expose:
- GetApiKey: there is no GetApiKey operation in the AppSync API
Reference. API keys can be listed, created, updated, and deleted
but not retrieved by id.
- ListAllResolvers: ListResolvers requires typeName. There is no
endpoint that lists resolvers across all types for an API.
Both endpoints were Floci-only and violated the 'no custom endpoint
shapes' rule. The associated service method (listResolvers) is also
removed. The corresponding integration tests are dropped in a
follow-up commit.
The getApiKey service helper stays because it is still used
internally by updateApiKey and deleteApiKey flows.
* feat(appsync): emit AWS-compatible BadRequestException extended format for SDL errors
AWS AppSync's StartSchemaCreation returns 400 BadRequestException with a
reason=CODE_ERROR field and a detail.codeErrors array. Each code error
carries errorType, value, and location{line, column, span}.
This commit:
- Catches SchemaProblem and InvalidSyntaxException from the parser and
throws BadRequestException with extended data built from
graphql-java's GraphQLError locations.
- Catches SchemaProblem from makeExecutableSchema for validation errors
(unknown types, missing fields) with errorType=VALIDATION_ERROR.
- Catches generic RuntimeException without extended data so flow
exceptions (NPE, OOM) do not produce a misleading codeErrors array.
- Validates unknown AppSync directives with errorType=VALIDATION_ERROR
and line/column/span from the SDL.
The errorType values follow the AWS Javadoc (PARSER_ERROR, VALIDATION_ERROR)
and span defaults to -1 when unknown, matching CodeErrorLocation.span()
in the AWS SDK.
* test(appsync): cover AWS-aligned error format, dead-code cleanup
- Add Order 157: createSourceApiAssociationDuplicateReturns409 asserts
ConcurrentModificationException 409 with the AWS message format.
- Add Order 158: createSourceApiAssociationReplacesDeletionScheduled
covers the new DELETION_SCHEDULED filter (a new association can
replace a previously deleted one).
- Add Orders 700, 701, 702: extended BadRequestException format for
PARSER_ERROR (syntax), VALIDATION_ERROR (semantic), and unknown
directive cases. Each asserts reason=CODE_ERROR, detail.codeErrors,
and the location{line, column, span=-1} shape.
- Update Order 124 (deleteApiKeyStandalone): the verification step
used the removed getApiKey endpoint, replace it with listApiKeys
asserting the deleted key is no longer present.
- Update Orders 600 and 607 to assert the new extended format for
generic SDL validation and unknown directive cases.
- Drop Order 32 (getApiKey) and Order 62 (listAllResolvers): the
underlying endpoints no longer exist.
- Drop encodeArn helper and the URLEncoder / StandardCharsets
imports that were no longer used by any test.
* test(sdk-java): cover AssociateSourceGraphqlApi 409 and extended schema error body
- Add Order 137 (createSourceApiAssociationDuplicateThrowsConcurrentModificationException):
use the typed AWS SDK exception ConcurrentModificationException instead
of the generic AppSyncException, validating the message format that
AWS returns.
- Add Order 200 (startSchemaCreation_syntaxError_throwsBadRequestWithExtendedBody):
send a raw HTTP POST with an invalid schema, then inspect the JSON body
to assert the AWS-compatible shape (__type, reason, detail.codeErrors[],
errorType=PARSER_ERROR, location{line, column, span=-1}). Uses a
jackson mapper rather than the SDK to read the response body directly.
- Import java.util.List to support the new deserialization in Order 200.
* feat(appsync): async schema creation with 409 in-progress gates
StartSchemaCreation is asynchronous in AWS: the request returns 200 +
PROCESSING, and the schema compiles in a background thread, transitioning
to ACTIVE (success) or FAILED (error) with the extended error format in
the polled GetSchemaCreationStatus response.
This commit:
- Adds SchemaCreationWorker, a singleton executor with configurable
thread count and graceful shutdown, that transitions the schema
status asynchronously and serializes the AwsException extended data
into the FAILED details string.
- Adds SchemaStatusStoreProducer so AppSyncService and the worker see
the same in-memory state for the schema status store (otherwise
two StorageFactory.create() calls would create independent maps).
- Refactors startSchemaCreation to set PROCESSING synchronously and
hand off compilation to the worker.
- Removes the synchronous ACTIVE override from the controller.
- Gates 27 per-API mutations and 2 account-wide operations
(CreateGraphqlApi, CreateApi) plus self-blocking on second
StartSchemaCreation with ConcurrentModificationException 409,
matching the AWS behavior documented in the AppSync API Reference
and service-2.json.
- Adds recoverOrphans() to EmulatorLifecycle.onStart so schemas left
in PROCESSING by a previous emulator run are marked FAILED instead
of permanently blocking the API.
- Adds schemaWorkerThreads and schemaWorkerShutdownTimeoutSeconds
to EmulatorConfig (FLOCI_SERVICES_APPSYNC_SCHEMA_WORKER_THREADS,
FLOCI_SERVICES_APPSYNC_SCHEMA_WORKER_SHUTDOWN_TIMEOUT_SECONDS).
* test(appsync): cover async schema polling, FAILED state, and 409 gates
- Adapts the 7 existing schema creation tests to the async pattern:
the post returns PROCESSING, tests poll for the terminal status with
Awaitility, and the extended format body is now read from the
polled FAILED details.
- Adds 9 new tests (Orders 703-711) covering the 409 in-progress gates
for createDataSource, createResolver, createFunction, createType,
putEnvironmentVariables, startSchemaCreation, createGraphqlApi,
updateGraphqlApi, and deleteGraphqlApi. The gates are exercised by
setting the status to PROCESSING directly via the shared store
backend, which is deterministic and avoids the race window of
waiting for the worker.
- Updates the EmulatorLifecycleTest constructor for the new
SchemaCreationWorker dependency.
* test(sdk-java): cover async schema with typed SDK polling
- Adds awaitility 4.2.2 to pom.xml (test scope) so the SDK test for
the polled status can use the same Awaitility DSL the integration
tests use.
- Updates the existing getSchemaCreationStatus test (Order 11) to
poll via the typed SDK call until the terminal status is reached
(ACTIVE in this case) instead of a single request. Without this,
the gate added in the previous commit would 409 every subsequent
SDK test that runs while the schema is still PROCESSING.
* fix(build): remove duplicate awaitility declaration in pom.xml
The pre-existing version-less awaitility declaration (BOM-managed by
Quarkus) was shadowed by the pinned 4.2.2 declaration added in this PR.
Maven resolves the first declaration it encounters, silently ignoring
the BOM version. Removed the version-less dup so the pinned 4.2.2
takes effect.
Addresses P1 from Greptile review.
* fix(appsync): add missing 409 gates and synchronize startSchemaCreation
Validating all 43 ConcurrentModificationException operations from
service-2.json against the code surfaced 5 operations missing the
PROCESSING gate (Greptile caught 1, 4 more were found during review):
- getChannelNamespace: added assertSchemaNotBusy (protects both get
and deleteChannelNamespace, matching getResolver/getFunction/getType)
- deleteDomainName: resolves the associated apiId from the domain
association store and gates on it (no-op if no association exists)
- disassociateApi: same pattern as deleteDomainName
- deleteMergedApiAssociation: gate on sourceApiIdentifier
- updateDomainName: resolves the associated apiId and gates on it
Also wraps the startSchemaCreation check-and-set in synchronized(this)
to close the TOCTOU race window between assertSchemaNotBusy and the
PROCESSING put. The async submitSchemaCreation call stays outside the
lock to avoid blocking the worker thread.
Addresses P1 and P2 from Greptile review.
* chore(appsync): document schema worker config in application.yml
Adds the appsync section under storage.services in both main and test
application.yml, documenting the three AppSyncStorageConfig keys:
- flush-interval-ms (5000 main / 60000 test, matching other services)
- schema-worker-threads (4)
- schema-worker-shutdown-timeout-seconds (30)
These already had @WithDefault fallbacks so the code worked without
the YAML entries, but the repository convention (AGENTS.md) requires
storage config to be documented in application.yml as the source of
truth for operators.
Addresses P2 from Greptile review.
* test(appsync): cover additional 409 gates for domain and merged operations
Adds 5 new integration tests (Orders 712-716) covering the PROCESSING
409 gates added in the previous commit:
- 712: deleteChannelNamespace_busy_returns409
- 713: deleteDomainName_busy_returns409
- 714: disassociateApi_busy_returns409
- 715: disassociateMergedGraphqlApi_busy_returns409
- 716: updateDomainName_busy_returns409
Each test creates the necessary resources (temp API, channel namespace,
domain name + association, or merged API association) before setting
the schema status to PROCESSING directly via the shared store, then
asserts the gated operation returns 409 ConcurrentModificationException
with the AWS-style message.
Integration test count: 154 -> 159.
* fix(appsync): remove incorrect CME gate from getChannelNamespace, add to deleteChannelNamespace
GetChannelNamespace does not declare ConcurrentModificationException in
service-2.json or the AWS Java SDK v2. Only BadRequestException,
NotFoundException, UnauthorizedException, InternalFailureException, and
AccessDeniedException are declared. The gate was incorrectly returning
409 during PROCESSING for an undeclared error code.
DeleteChannelNamespace does declare CME, so the gate is now applied
directly in deleteChannelNamespace instead of being inherited from
getChannelNamespace.
* fix(appsync): account-aware schema creation and worker store isolation
Scope schema creation status to the requesting account so concurrent
accounts cannot interfere with each other's in-flight schema operations.
- Add accountId field to SchemaCreationStatus
- Worker uses AccountAwareStorageBackend (putForAccount/getForAccount)
- SchemaStatusStoreProducer now produces AccountAwareStorageBackend
- SchemaStoreProducer CDI bean shares schemaStore between service and worker
- schemaStore.put moved to worker success path only
- assertSchemaNotBusy scoped to current account via getForAccount
- assertNoSchemaBusyAnywhere scoped to keysForAccount
- currentAccountId() helper reads RequestContext
- Worker config moved from AppSyncStorageConfig to AppSyncServiceConfig
* fix(appsync): ACTIVE→SUCCESS terminal schema status
Match AWS behavior: a successfully compiled schema is SUCCESS, not
ACTIVE. ACTIVE is not a valid terminal status in real AppSync.
- Worker marks SUCCESS on successful compilation
- Integration tests assert SUCCESS
- SDK compatibility test asserts SUCCESS
* refactor(appsync): remove circular dependency between SchemaRegistry and SchemaCreationWorker
SchemaRegistry depended on SchemaCreationWorker solely to delegate
submitSchemaCreation calls, creating a circular dependency. AppSyncService
now calls the worker directly, making the delegation unnecessary.
- Remove SchemaCreationWorker dependency from SchemaRegistry
- Remove submitSchemaCreation method
* fix(appsync): add assertSchemaNotBusy to deleteResolver, deleteFunction, deleteType
These three delete operations mutate the schema and should be blocked
while a schema creation is in PROCESSING state, matching the 409 gates
on the other schema-mutating operations.
* fix(appsync): return PROCESSING status synchronously from StartSchemaCreation
The controller was re-reading the status from the store after submitting
to the worker pool. In fast environments the worker could complete
(fail) before the read, causing the POST response to return FAILED
instead of PROCESSING — breaking the SDK compatibility test.
startSchemaCreation now returns the PROCESSING status it just set, and
the controller uses it directly instead of re-reading.
* fix(neptune): roll back proxy port and container on failed provisioning
createDbCluster reserved a proxy port and started the container/proxy with
no rollback: any throw after allocateProxyPort() leaked the port (only freed
on delete) and orphaned the container. Repeated failures could exhaust the
proxy-port range and surface as a spurious InsufficientNeptuneCapacity error.
Wrap startup in try/catch, add rollbackDbCluster() that stops the proxy and
container in isolated try blocks (guarded by handle != null) and always
releases the port in finally, then rethrow. Mirrors the merged ElastiCache
fix (#1618). Adds unit tests for both rollback branches (proxy-start throws
after container is up; container-start throws before any handle).
* fix(neptune): clean up container by id on readiness-timeout rollback
Address Copilot review: NeptuneContainerManager.start() registers the
container in activeContainers before the readiness probe, which throws on
timeout without returning a handle. The previous handle-based rollback saw a
null handle and skipped the container stop, orphaning a running container.
Add an idempotent stopByClusterId() (with a deterministic-name fallback) and
call it from rollbackDbCluster instead of stop(handle); the proxy stop stays
guarded by handle != null. Update the service tests to the by-id cleanup and
add a container-manager test for the name fallback.
* fix(neptune): guarantee proxy-port release against non-RuntimeException
Address greptile review: the finally that runs releaseProxyPort was attached
only to the container-stop try, so an Error (e.g. NoClassDefFoundError) escaping
the proxy-stop step would bypass it and leak the port — the exact failure this
rollback prevents. Wrap both cleanup steps in an outer try whose finally always
releases the port; each step keeps its own RuntimeException handling.
* fix(neptune): roll back on JVM Errors during provisioning, not just RuntimeException
Address greptile P1: the outer catch (RuntimeException) in createDbCluster
would not intercept a JVM Error (OutOfMemoryError, NoClassDefFoundError, etc.)
thrown by a Docker operation, so rollback never ran and the port + container
leaked. (Note: catch (Exception) would not fix this — Error extends Throwable,
not Exception.) Move the rollback into a finally guarded by a success flag so it
fires on any non-success exit, including an Error, while the catch still logs the
common RuntimeException case with detail. Adds a StackOverflowError rollback test.
* fix(neptune): reserve proxy port inside the try to prevent leak on config-read failure
allocateProxyPort() ran before the try opened, so a throw from the
db-type/image config reads between them would leak the reserved port —
the exact failure this rollback path prevents. Move the try to open
immediately after the allocation.
* fix(secrets-manager): return partial result for missing secrets in batch
* fix(secrets-manager): remove hardcoded errorCode mapping
* fix(secrets-manager): report deleted and missing current version secrets in BatchGetSecretValue errors
RegisterTaskDefinition now parses and stores containerDefinitions[].secrets
(name + valueFrom) and round-trips them on register/describe as references,
matching AWS (the resolved values are never returned).
At RunTask launch, EcsContainerManager resolves each secret to an environment
variable through the in-process SsmService / SecretsManagerService (the same
local resolution CodeBuildRunner already uses, no extra HTTP hops):
- SSM parameter by name or full ARN -> Parameter.value
- Secrets Manager full ARN -> SecretString
- a full ARN's own region is used, so cross-region references resolve correctly
- env precedence: task-def environment < resolved secrets < RunTask container
override environment (override still wins on a name collision)
When a referenced secret/parameter cannot be resolved the launch fails the way
AWS does: no container is started and the task goes STOPPED with a
ResourceInitializationError stoppedReason, rather than silently starting the
container without the variable.
Deferred (noted in floci-io/floci#1624): the Secrets Manager valueFrom selector
suffix (:json-key:version-stage:version-id) is not yet parsed; such a valueFrom
is resolved as the plain secret.
Adds handler round-trip tests, container-manager resolution / override /
cross-region unit tests, a stopped-task failure test, and Java SDK
compatibility coverage.
* fix(ses): populate VerificationStatus in v2 ListEmailIdentities
ListEmailIdentities built each item with only IdentityType / IdentityName /
SendingEnabled, so VerificationStatus always serialized as null and clients had
to call GetEmailIdentity per identity. Populate it from the identity's stored
status (mapped to the v2 enum via toV2Status), and refresh each identity's
state the same way GetEmailIdentity does so the list stays consistent (e.g. a
domain that transitioned to SUCCESS via its DKIM records).
* fix(ses): derive SendingEnabled from verification status in v2 ListEmailIdentities
SendingEnabled was hard-coded to true, so a not-yet-verified identity was
reported as sendable, which is inconsistent now that VerificationStatus is
populated. AWS returns SendingEnabled=true only when the identity is verified
(VerificationStatus SUCCESS) and false otherwise (PENDING/FAILED), matching the
VerifiedForSendingStatus logic already used by GetEmailIdentity. Derive it the
same way here.
In awsvpc mode every AWS task receives its own ENI, so a portMapping's
hostPort carries no host-binding semantics. Floci was publishing it
literally on the single local Docker host, so two tasks of the same
service — or two services sharing a port — collided on start.
awsvpc mappings now get a dynamic host port in native mode, or
expose-only in Docker mode where consumers reach containers via the
docker network IP. bridge and host mode keep publishing hostPort
literally, matching AWS.
Also fix the leak this surfaced: a failed start in
ContainerLifecycleManager.createAndStart left the created container
behind, so retrying callers accumulated Created containers and
fixed-name callers hit name conflicts on the next attempt.
Refs #1778
* fix(lambda): return a downloadable GetFunction Code.Location
GetFunction returned a fabricated real-AWS S3 URL for Code.Location that
404s, so clients (and browser UIs) cannot download the deployment package.
Persist the uploaded zip in Floci's own S3 (awslambda-<region>-tasks) on
every successful code deploy and return a path-style URL on the local
endpoint (built from the request via UriInfo), matching AWS/LocalStack.
Bytes are exact, so the download hashes to the stored CodeSha256.
Centralized in extractZipCode so it covers ZipFile, S3-source, and the
reactive S3-update listener; hot-reload is excluded by design. The stored
object is overwritten on redeploy and removed on DeleteFunction.
* fix(lambda): log deleteFunction S3 cleanup failure instead of swallowing it
The best-effort deleteObject cleanup caught and ignored exceptions with an
empty catch block, violating the AGENTS.md rule that a tolerated exception
must be logged with enough context to diagnose it. Log it via LOG.warnv,
matching storeDeploymentPackage.
* fix(ec2): serialize concurrent mutations of shared resources per resource
The storage backend's get() returns the live stored object, so mutating
its collections in place raced under parallel clients. Terraform runs
10-wide by default, and concurrent AssociateRouteTable calls dropped
associations; describes could also observe a half-updated list.
Mutators of route tables, network ACLs, security groups, and tags now
take a per-resource lock and swap collections copy-on-write, so a
concurrent describe only ever sees a complete list. The lock is striped
by storage key, so unrelated resources never contend — replacing the
coarse `synchronized` methods on the NACL paths.
Refs #1464
* fix(ec2): make ReplaceNetworkAclAssociation atomic and bound the lock stripes
The unlocked membership scan let concurrent callers with the same
associationId each claim the association: the loser's remove() silently
no-opped, so every caller minted a distinct moved association and added it
to the target ACL, leaving one subnet associated several times.
Claim the association under lock, and hold the source and target locks for
the whole move so a describe never observes the subnet associated with
neither ACL. Losers now fall through to InvalidAssociationID.NotFound.
Replace the per-key lock map, which never evicted, with a fixed stripe
array. Two-lock callers order acquisition by stripe index rather than
storage key, since distinct keys may share a stripe and key order would
not be a total order over the monitors.
Drop the redundant pre-lock getRequiredRouteTable in createRoute; the
call inside the lock throws identically, matching deleteRoute.
Create-time values were dropped, causing perpetual terraform plan diffs:
- Inline TagSpecification tags now round-trip on create for subnets,
route tables, internet gateways, elastic IPs, security groups, and
security group rules (each rule gets its own tag copy).
- CreateRoute stores and returns natGatewayId (was only gatewayId),
in both the query handler and the CloudFormation provisioner.
- DescribeSecurityGroupRules supports the security-group-rule-id
filter and multiple group-id values; the SecurityGroupRuleId
parameter and the filter are intersected (conjunctive), matching
AWS semantics.
Closes#1463
Supersedes #1491
Co-authored-by: seyi idowu <160403633+awsvigilante@users.noreply.github.com>
* test(stepfunctions): pass ecs:runTask ctor args in AslExecutorPathIntrinsicsTest
Same one-line fix as #1696: AslExecutor gained EcsService/EcsJsonHandler ctor
params in #1564 but this test (from #1558) was not updated, breaking test
compilation on main. Included here so this PR's CI is green independently of
#1696; resolves cleanly once #1696 merges (identical change).
* feat(ecs): inject the AWS SDK baseline env into launched task containers
Launched ECS task containers previously received only their task-definition and
override environment. An AWS SDK running inside such a container therefore had
no AWS_ENDPOINT_URL (so it targeted real AWS instead of the emulator), no
region, and an empty credential-provider chain. Lambda containers already avoid
this because ContainerLauncher injects those variables.
Extract that baseline into a shared LaunchedContainerAwsEnv helper and apply it
to ECS tasks too:
- LaunchedContainerAwsEnv (core/common/docker): builds the KEY=value baseline —
AWS_DEFAULT_REGION/AWS_REGION, credentials (a mounted ~/.aws dir when
configured, otherwise placeholder credentials from Floci's own env falling
back to test/test/test), and FLOCI_HOSTNAME/FLOCI_ENDPOINT/AWS_ENDPOINT_URL
from ContainerReachableEndpoint.
- ContainerLauncher (Lambda): replace the inline region/credentials/endpoint
block with the shared helper. The resulting environment is byte-for-byte
identical to before; only the source of the entries moved.
- EcsContainerManager (ECS): prepend the baseline to each task container's
environment as overridable defaults (task-def and RunTask containerOverride
values still win on key conflict), and enable withHostDockerInternalOnLinux()
+ withEmbeddedDns() so the endpoint hostname resolves to Floci from inside the
task container, the same way Lambda containers do.
Credentials are injected as env placeholders (as ContainerLauncher already does
for Lambda), not via the real ECS task-role container-credentials metadata
endpoint; emulating that endpoint would be a reasonable follow-up.
Adds LaunchedContainerAwsEnvTest and EcsContainerManagerAwsBaselineTest, and
updates the existing launcher/manager constructor call-sites.
* refactor(ecs): address review feedback on LaunchedContainerAwsEnv
- Drop the unused single-argument constructor that stored a null
ContainerReachableEndpoint and would NPE on any sdkBaselineEnv call
(Greptile P1), along with the vestigial EmulatorConfig field/param it
carried — the helper only needs ContainerReachableEndpoint.
- Remove the now-dead null guard in EcsContainerManager.buildEnvVars
(the real sdkBaselineEnv never returns null) and instead stub the mocked
helper with List.of() in the ECS unit tests, making the contract explicit
(Greptile P2).
* docs: regenerate action tables
* feat(stepfunctions): resolve payload-template .$ inside arrays and $$ context in intrinsic args
Two AWS States Language parity fixes in the payload-template / intrinsic path:
- resolveParameters now recurses into arrays, not just objects. A Parameters / ItemSelector /
ResultSelector template resolves .$ references at any nesting depth, including inside arrays
(e.g. an ECS Overrides.ContainerOverrides[].Environment[].Value.$). Previously array elements
passed through verbatim, so those references were never substituted.
- Intrinsic-function arguments can now reference the Context Object ($$). resolvePath /
evaluateIntrinsic / resolveIntrinsicArg thread the Context Object through, so an argument like
States.Format('{}', $$.Map.Item.Value.x) or a bare $$.Execution.Id resolves against the
context. Ordinary $. / input-only resolution is unchanged (context is null there).
Adds AslExecutorArrayParamsTest and AslExecutorIntrinsicContextTest.
* docs: regenerate action tables
* feat(cloudformation): support UpdateTerminationProtection
CDK bootstrap calls UpdateTerminationProtection on the CDKToolkit stack; Floci returned
UnknownAction. Add it: a boolean enableTerminationProtection on Stack, a
CloudFormationService.updateTerminationProtection(stackName, enabled, region) that sets and
persists it, a handler returning the UpdateTerminationProtectionResult/StackId envelope, and
the flag echoed as <EnableTerminationProtection> in DescribeStacks. Register the action in
AwsQueryController's CloudFormation action set so the Query-protocol POST routes to
CloudFormation instead of falling through. Adds an integration test toggling the flag and
asserting it round-trips through DescribeStacks.
* docs: regenerate action tables
* fix(elbv2): dispatch same-port listeners by host
* fix(elbv2): fall back to sole port listener
* fix(elbv2): avoid restricted Host header dependency
* fix(elbv2): keep same binding restarts in place
* docs: sync service action tables
* feat(pipes): apply EventBridge Pipe enrichment before target delivery
PipesPoller delivered the raw source record straight to the target; pipe.getEnrichment() was
stored but never invoked. Implement the AWS Pipes source->filter->ENRICHMENT->target flow: when an
enrichment Lambda is configured, invoke it once with the filtered events (bare JSON array) and
forward its response to the target (null/empty response skips the target, per AWS). Also resolve
qualified Lambda ARNs (:$LATEST) in PipesTargetInvoker. Covered by PipesTargetInvokerTest.
* fix(pipes): deliver enrichment result to the target as an event array
EventBridge Pipes delivers events to a target as a batch (JSON array). The
enrichment path forwarded a single-object enrichment response verbatim, so a
target expecting an array (e.g. a Step Functions state machine with
InputPath "$.[0]") received an object and resolved null. Wrap a non-array
enrichment response in a one-element array before target delivery. Covered by
PipesPollerTest.asEventArray*.
(cherry picked from commit f160f66857c2362e3f1bad3bbfdb025396b281a0)
* fix(pipes): treat a target/enrichment Lambda FunctionError as failed delivery
invokeLambda (the Lambda target path) discarded the InvokeResult, so a target
Lambda that returned a FunctionError (unhandled exception, throttle) was treated
as a successful delivery and the source record was consumed. Surface it (throw)
so the caller routes the record to the DLQ. Also switch applyEnrichment's
FunctionError failure from a bare RuntimeException to AwsException, per the
service-layer convention. Covered by PipesTargetInvokerTest.invoke_lambdaTargetFunctionErrorThrows.
* fix(pipes): only array-wrap the enrichment response for Lambda targets
deliverEnrichedBatch wrapped the enrichment response in a JSON batch array before invoking
the target unconditionally. That is correct for a Lambda target (which expects an
SQSRecord[]-style batch) but corrupts every other target — a Step Functions execution, SQS
message, SNS publish or EventBridge event must receive the raw enrichment response. Gate the
wrapping on isLambdaTarget, matching the non-enrichment delivery path. Adds pollSqs tests for
both a non-Lambda (raw) and a Lambda (wrapped) target.
* fix(pipes): align enrichment empty/unsupported handling with AWS + document SQS-only wiring
Review feedback:
- applyEnrichment now also skips the target when the Lambda enrichment returns an
empty object {} or empty array [] (whitespace variants included), matching AWS;
a non-empty array such as [{}] still invokes the target.
- A non-Lambda enrichment type (API destination, API Gateway, SFN Express) now
fails the batch to the DLQ instead of silently delivering the unenriched payload.
- Documented that enrichment is currently applied only on the SQS source path
(Kinesis/DynamoDB Streams/Kafka bypass it) in code and docs/services/pipes.md.
- Generalized a comment that named a specific downstream consumer.
- Tests: empty {}/[] skip, [{}] invokes, unsupported type throws.
* docs: regenerate action tables
* feat(ecs): apply EFS access point POSIX ownership to shared local volumes
#1569 materialises an ECS task's efsVolumeConfiguration volume as a shared
local Docker named volume (floci-efs-<fileSystemId>). Docker creates a named
volume root:root 0755, so a task whose image runs as a non-root USER — as
containers mounting an EFS access point typically do — cannot create files on
it and fails with EACCES.
Real EFS initialises an access point's root directory per
RootDirectory.CreationInfo {OwnerUid, OwnerGid, Permissions} and applies the
access point's PosixUser to all I/O regardless of the process uid. This change
emulates that mechanism for the shared local volume, driven by generic config:
- New floci.storage.efs.* block (owner-uid, owner-gid, root-permissions,
setgid, init-image, mount-user, mount-group-add). Every value is empty/false
by default, so a shared volume behaves exactly as before (a plain named
volume, no ownership change) unless explicitly configured.
- ContainerLifecycleManager.ensureSharedVolume(...) ensures the volume then, if
ownership is configured, chowns/chmods the mount root once (run-once guard;
optional setgid so subdirectories inherit the owner gid) inside a short-lived
helper container.
- ContainerSpec/ContainerBuilder gain withUser/withGroupAdd; wired into
createContainerCmd.withUser and HostConfig.withGroupAdd.
- EcsContainerManager initialises the EFS volume root via ensureSharedVolume
before mounting it.
Unit tests cover the no-op default (no helper container, no image pull), the
one-off chown/chmod/setgid helper with the run-once guard, the builder
round-trip, and the EcsContainerManager wiring.
* fix(ecs): apply configured EFS PosixUser to containers mounting a shared volume
Wire the previously-inert floci.storage.efs.mount-user / mount-group-add config into the
ECS container spec: a container mounting an EFS-backed shared volume now runs under the
configured uid[:gid] and adds the supplementary group, emulating the access point's
PosixUser squashing. Without this a non-root image USER could not write a volume owned by
owner-uid/owner-gid. Also add the floci.storage.efs.* section to application.yml (the
source of truth for effective defaults) and correct the root-permissions Javadoc, which
implied leaving it empty always skips volume init even when owner/setgid are set.
* docs: regenerate action tables
* feat(ses): implement PutEmailIdentityConfigurationSetAttributes for SES v2
Add the v2 PutEmailIdentityConfigurationSetAttributes API and wire an email
identity's default configuration set into the send path so its event
destinations fire. This includes Raw sends with no explicit FromEmailAddress:
the configuration set is re-resolved from the MIME "From" header once parsed,
so an omitted-sender Raw send still routes through the identity default.
Unknown identities surface the AWS-matched error message.
* test(ses): log instead of swallowing cleanup failures in the identity config-set compat test
* docs(ses): clarify default config-set precedence and clear-on-null semantics
* fix(ses): fail send when an identity's default configuration set was deleted
Per the SES Developer Guide, sending through an identity whose default
configuration set has been deleted fails with a bad-request error. The default
resolution was silently dropping the stale association; make it throw
BadRequestException ("Configuration set <name> does not exist.") to match AWS.
An audit found 69 types reachable from StorageFactory persistence
still unregistered after #1695: iot (all 10 persisted roots),
cloudfront (20), apigateway (13), route53 (7), transfer (4), appsync
enums (6), plus nested inner types file-level sweeps miss (memorydb
Endpoint, Secret$RotationRules/$Tag, KinesisShard ranges,
IotPolicy$PolicyVersion). Native-image builds failed to deserialize
their persisted state on restart.
Adds PersistedModelReflectionTest, a classpath-scan guard that
discovers every persistence-root TypeReference<Map<String,V>>, walks
V's reachable field graph, and fails listing any type missing
@RegisterForReflection (direct or via targets=).
Refs #1695
Replace hand-built "arn:aws:..." string concatenation with
AwsArnUtils.Arn.of/RegionResolver.buildArn (13 files) and migrate 16
manual ARN-parsing sites (split/substring/regex helpers) to
AwsArnUtils regionOrDefault/accountOrDefault/parse. Adds
XmlParser.childElementNames and moves S3SelectService off
indexOf/substring parsing and string-concat XML onto
XmlParser/XmlBuilder.
Also fixes the websocket $connect methodArn hardcoding account
000000000000 instead of resolving the caller account. Resource-tail
slicers (:stream/, :repository/, ...) are intentionally kept: parse()
would not remove the suffix logic.
* feat: implement read-only describe/list APIs for resource collection
Several read-only AWS actions returned UnsupportedOperation (HTTP 400) — or,
where no route existed, a 404 the AWS SDKs deserialize to a retryable
UnknownError. Both break clients that enumerate an account read-only: the 400
aborts the collection of the whole resource type, and the 404 sends the SDK
through its full retry/backoff schedule (~9 attempts, minutes) on every call.
Implement minimal, wire-accurate responses that mirror each service's documented
contract so SDK clients complete the read:
- IAM
- GetLoginProfile -> NoSuchEntity (404), the documented result when a user has
no console password; clients branch on it, so a 200 or 400 misleads them.
- GetAccessKeyLastUsed -> the "never used" shape (ServiceName/Region = N/A, no
LastUsedDate).
- ListSAMLProviders / ListOpenIDConnectProviders / ListServerCertificates ->
empty lists (non-paginated; ListServerCertificates carries IsTruncated=false).
- RDS: DescribeDBSnapshots / DescribeDBProxies / DescribeDBClusterSnapshots ->
empty results (empty wrapper, no Marker).
- DocDB: DescribeDBClusterSnapshots -> empty result (RDS namespace).
- ElastiCache: DescribeCacheSubnetGroups / DescribeCacheParameterGroups -> empty.
- Glue: GetJobs / GetCrawlers / ListDataQualityRulesets /
GetSecurityConfigurations / GetTags -> empty result under each result key.
- SSM: ListDocuments / ListAssociations / DescribeMaintenanceWindows -> empty
(NextToken omitted).
- AWS Backup: GetBackupVaultNotifications / GetBackupVaultAccessPolicy ->
ResourceNotFoundException (400), the documented "not configured" signal.
- S3 Control: ListAccessPoints -> empty AccessPointList (200), replacing the
missing-route 404 that triggered the SDK retry storm.
Responses are grounded in the AWS API reference for each action (error codes,
HTTP statuses, and "empty"/"never used" shapes). Adds focused unit and
integration tests for each handler.
* docs: ground ListAccessPoints comment in the S3 Control contract
Drop the consumer-specific retry magnitude ("~9 attempts") from the
ListAccessPoints comment and justify the empty-200 response purely on the AWS
contract: ListAccessPoints documents a single success path — HTTP 200 with an
AccessPointList (empty when the account has none) and an optional NextToken.
404 is not a documented outcome for the operation, so a missing route leaves
SDK clients unable to map the response to the expected result or a known error.
* fix(glue): keep GetTags delegating to the schema registry
The earlier commit replaced Glue GetTags with a hardcoded empty {"Tags":{}},
which regressed the schema-registry tagging path: GetTags must return the tags
stored for a registry/schema ARN and InvalidInputException for an unknown ARN.
Restore the original handleGetTags delegation and drop the empty-stub test for
it. GetTags was already implemented — only GetJobs/GetCrawlers/
ListDataQualityRulesets/GetSecurityConfigurations were genuine gaps, and those
remain empty stubs.
Fixes GlueSchemaRegistryMetadataAndTagsIntegrationTest (getTagsReturnsAddedTags,
untagResourceRemovesKey, getTagsOnUnknownArnReturnsInvalidInput) and the
sdk-test-java GlueSchemaRegistryTest compat failure.
* fix(iam): omit empty UserName from GetAccessKeyLastUsed
UserName is optional in the IAM model and its type is non-empty
(length 1-128). The emulator has no AccessKeyId->UserName lookup, so
emitting an empty <UserName></UserName> could be rejected by a strict
client. Omit the element entirely instead; callers that need the owner
already have it from the preceding ListAccessKeys response.
* fix(backup): drop unused headers param from vault notification/access-policy stubs
* test(iam): cover GetLoginProfile, ListSAMLProviders, ListOpenIDConnectProviders, ListServerCertificates
* feat(eventbridge): deliver events to Firehose delivery stream targets
EventBridgeInvoker dispatched Lambda, SQS, SNS, and Batch targets but silently
dropped Firehose-targeted events with an unsupported-ARN warning. Add the
:firehose: branch: the (input-transformed) event JSON becomes the record Data
verbatim, matching AWS, which appends no newline; the stream's NDJSON flush
handles separation. Covered by invoker unit tests and an end-to-end
PutEvents to rule to Firehose to S3 integration test.
Refs #1043
* refactor(eventbridge): use the Record constructor in the Firehose branch
The lambda:invoke integration took the last ':'-segment of FunctionName, yielding the version/alias qualifier (e.g. $LATEST) instead of the function name for ARNs like arn:aws:lambda:region:acct:function:NAME:$LATEST -> "Lambda function not found: $LATEST". Add extractLambdaFunctionName() to strip the :function: prefix and an optional trailing qualifier, used at both lambda:invoke call sites. Covered by AslExecutorLambdaArnTest.
* fix(s3): add support for S3 CopyObject operation and multipart uploads
* fix(s3): correct checksum type when copying multipart objects in S3
* fix(s3): validate checksum algorithms and support standard header fallbacks
* fix(s3): handle integration tests
* fix(s3): return InvalidRequest for valid but unsupported checksum algorithms
* feat(apigateway): persist API key tags and add GetApiKey route
CreateApiKey now stores the request tags and returns them from CreateApiKey, GetApiKey and GetApiKeys. Adds the missing GET /apikeys/{apiKeyId} route, which omits the value unless includeValue=true and returns 404 when the key is unknown.
* fix(apigateway): always emit tags object and harden API key tag parsing
Address review feedback: toApiKeyNode always emits "tags" (AWS returns "tags": {} even when empty); createApiKey coerces tag keys/values to String instead of an unchecked cast; the integration test initialises the shared apiKeyId to a sentinel and asserts the JSON error body on the 404 path.
* fix(apigateway): align 404 message and strip api key values from list by default
Address maintainer review: getApiKey now returns the AWS-accurate "Invalid API Key identifier specified" message; GetApiKeys honors the includeValues query param and omits each key's value unless requested (was leaking values by default); toApiKeyNode emits tags only when non-empty. Tests updated accordingly.
k3s containerd could not reach the emulated ECR registry: repository
URIs embed localhost plus the host-published port, which resolves to the
k3s container itself, and containerd requires a registries.yaml entry
before it will speak plain HTTP to a registry.
New clusters now get a generated /etc/rancher/k3s/registries.yaml,
injected through the Docker API before the container starts, that
mirrors every repository hostname the emulator can mint (the default
account across the region catalog, plus the path-style form) to the
registry container's in-network endpoint. Public registries are never
matched, and any failure skips the mirror without aborting cluster
creation. Opt out with FLOCI_SERVICES_EKS_ECR_REGISTRY_MIRROR=false.
Closes#1761
* fix: return ResourceNotFound 400 for SetAlarmState on missing alarm
* fix: use CloudWatch ResourceNotFound error code for missing alarm
* fix: use HTTP 404 for CloudWatch ResourceNotFound
Per @hectorvent's review: the CloudWatch service model (botocore
cloudwatch/2010-08-01 service-2.json) declares the ResourceNotFound shape with
httpStatusCode 404, so correct the AwsException status from 400 to 404 for the
missing-alarm SetAlarmState path and update the test assertion to match.
---------
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
* fix(rds): resolve tags by ARN resource type, not only DB instances
ListTagsForResource, AddTagsToResource and RemoveTagsFromResource
unconditionally resolved every ResourceName to a DB instance, so any
non-instance ARN (e.g. a DB subnet group) returned 404 DBInstanceNotFound.
This broke tools such as the Crossplane Upbound AWS provider, which calls
ListTagsForResource on every observe of a DB subnet group and never sees
it become ready.
Parse the ARN's resource-type segment and dispatch to the matching store
(db, cluster, subgrp): return the resource's tags, the resource-specific
NotFound fault when it is missing, and InvalidParameterValue for
unsupported resource types. Add tag storage to DbCluster and DbSubnetGroup
mirroring DbInstance. A bare (non-ARN) resource name still resolves to a
DB instance for backwards compatibility.
* fix(rds): return InvalidParameterValue for malformed or non-RDS tag ARNs
Address PR review: only fall back to a DB-instance lookup for bare,
non-ARN resource names. Strings that start with arn: are now parsed
strictly and must be RDS ARNs; malformed ARNs and ARNs for other
services return 400 InvalidParameterValue instead of a misleading
DBInstanceNotFound/DBClusterNotFoundFault.
* fix(rds): preserve subnet group tags across modifyDbSubnetGroup
Address PR review: buildSubnetGroup constructs a fresh DbSubnetGroup with
an empty tag map, so modifying a subnet group's subnets dropped any tags
added via AddTagsToResource. Carry the existing group's tags onto the
rebuilt object before persisting, matching AWS ModifyDBSubnetGroup.
* fix(rds): reject type-less RDS ARNs in tag ops and clarify unsupported-type message
Review feedback from #1649:
- An RDS ARN whose resource part is not <type>:<id> now returns 400
InvalidParameterValue (matching real AWS) instead of falling back to a
DB-instance lookup; bare non-ARN names keep resolving as DB instances.
- The unsupported-resource-type message now states the Floci scope
limitation instead of implying those types are untaggable on AWS.