EC2 froze every resource's owner to the configured default account at
construction time, so OwnerId came back as 000000000000 no matter which
account the request resolved to. Per-account isolation itself worked, but
the reported owner contradicted what STS returns for the same credentials
and what SQS embeds in its ARNs.
The visible consequence was DescribeImages --owners: the filter was honored
but matched against the frozen value, so filtering on the account actually
in use returned nothing, and the common Terraform pattern of pinning an AMI
to a known owner account failed with "Your query returned no results".
Resolve the owner per request through callerAccountId() instead, for the
ownerId fields, the generated ARNs and the self owner alias. Callers outside
a request scope (startup seeding, internal provisioning) still fall back to
the configured default account.
Closes#3775
CreateDBInstanceReadReplica creates a standalone instance with its own
container and endpoint that inherits the source's engine, version,
credentials, database name and, unless overridden, class, storage and
minor version upgrades; a same-region replica also inherits the parameter,
option, subnet and security groups, a cross-region one (source named by
ARN) gets the region's defaults, as the API reference states. The replica
starts with automated backups off, and both ends report the link the way
DescribeDBInstances does: ReadReplicaSourceDBInstanceIdentifier plus a
"read replication" StatusInfos entry on the replica,
ReadReplicaDBInstanceIdentifiers on the source, identifier within a region
and ARN across regions. A subnet group with a plain identifier source is
refused with DBSubnetGroupNotAllowedFault.
The replica's database is initialised from a pg_dumpall of the source taken
at creation, the mechanism RestoreDBInstanceFromDBSnapshot already uses, so
only PostgreSQL sources are accepted (CreateDBSnapshot draws the same
line). Writes after creation are not streamed; the docs say so.
PromoteReadReplica clears the link on both ends, turns backups on with the
requested retention (one day when omitted) and window, and reboots the
instance as RDS does. Deleting a source promotes its same-region replicas
and leaves a cross-region replica with replication terminated, as the user
guide documents for PostgreSQL; deleting a replica drops it from the
source.
SwitchoverReadReplica is refused with InvalidDBInstanceState, the only
state error the API reference lists, since AWS supports it for Oracle and
SQL Server only. PromoteReadReplicaDBCluster answers
InvalidDBClusterStateFault because no cluster here is created as a replica.
Refs #3778
* feat(athena): read Iceberg-format Glue tables via iceberg_scan
Glue tables written by pyiceberg's GlueCatalog (Parameters.table_type=
ICEBERG) never populate StorageDescriptor.InputFormat/SerializationLibrary,
so GlueViewDdlBuilder's format-sniffing heuristic always fell through to
read_csv_auto and failed parsing the table's binary Parquet data files.
Detect Iceberg tables via Parameters.table_type and build the view from
iceberg_scan(Parameters.metadata_location) instead, following the table's
real manifest list rather than globbing every Parquet file physically
present under its location -- which also fixes silently wrong results for
any table with more than one snapshot (updates, deletes, repeated
appends), not just the CSV-parse failure on a single-snapshot table.
The iceberg extension is installed/loaded once, only when the DDL batch
actually contains an Iceberg table. A table flagged ICEBERG but missing
metadata_location falls back to the existing format-sniffed heuristic.
Verified against a live build: pyiceberg write -> Athena SELECT returns
correct rows for both a single-snapshot and a two-snapshot table; full
athena + glue test suites (352 tests) pass with no regressions.
Fixes#3737
This change was implemented by Claude (Anthropic's AI coding assistant),
working on behalf of @maurice1979 who filed the linked issue.
* docs(athena): fix formatting and clarify Iceberg handling explanation
Corrected formatting and clarified the explanation regarding Iceberg
tables and their handling in DuckDB.
Signed-off-by: Jordi Vidal de LLobatera <is.maurice@protonmail.com>
* docs(glue): cross-reference Iceberg handling from glue.md; fix em dash
docs/services/glue.md still described only the InputFormat/SerdeInfo
format-sniffing heuristic for choosing a DuckDB read function, without
mentioning that Iceberg-format tables (Parameters.table_type=ICEBERG)
bypass it entirely via iceberg_scan, per the change in the previous
commit. Added a short cross-reference to Athena's format-inference docs
so glue.md doesn't describe stale, pre-fix behavior.
Also removed an em dash from GlueViewDdlBuilder's new Javadoc, per this
repo's own AGENTS.md style rule (no em dashes; colons, commas, or
periods instead). The matching instance in docs/services/athena.md was
already fixed via the Copilot autofix suggestion.
Both findings came from the Copilot pull request review on #3738.
This change was implemented by Claude (Anthropic's AI coding assistant),
working on behalf of @maurice1979.
---------
Signed-off-by: Jordi Vidal de LLobatera <is.maurice@protonmail.com>
Floci's container launcher has no way to ask a daemon for an accelerator, so
every container it starts is CPU-only. Services that need a GPU, such as
SageMaker training and hosting, have nowhere to express the request.
Adds optional device requests to the shared container layer:
- withGpuCount(int) / withAllGpus() build Docker's count form
- withGpuDeviceIds(List) pins specific devices by index or vendor UUID
- withCdiDevices(List) selects Container Device Interface devices by name
Count, device ids and CDI names are alternatives, and passing more than one is
rejected: a Docker request carrying both a count and explicit ids is refused by
the daemon.
CDI is included because Floci already documents rootless Podman as a supported
host, and CDI is how a Podman daemon exposes accelerators over its
Docker-compatible API. It is also not GPU-specific, so the same primitive
reaches any device the host's CDI specs describe. The two forms are not
interchangeable: Podman accepts Docker's count form and then starts the
container with no device attached (containers/podman#22645), so the javadoc
steers a caller that may be talking to Podman toward CDI, whose failure mode is
a refused start rather than a silent CPU-only container.
Default behavior is unchanged. A spec that asks for no device sets no
DeviceRequests on the HostConfig, so a daemon configured with an accelerator
runtime as its default does not start handing devices to every container Floci
launches. Existing ContainerSpec constructors keep working through a delegating
overload that defaults the new component to empty.
Tests cover the exact request built for each form, the absence of any request
by default, the validation rules, and that requests reach the HostConfig.
ContainerGpuDockerIntegrationTest exercises real hardware and is opt-in via
-Dgpu.integration.enabled=true, skipping cleanly where no GPU exists, so CI
still covers request construction without needing one.
Verified on an RTX 5060 Ti against Podman 5.8.2 with NVIDIA Container Toolkit
1.19.1: a container requesting the device by CDI name reported exactly that
UUID from nvidia-smi, and a container requesting nothing failed to start
rather than reaching a GPU.
Add CopyDBParameterGroup, CopyDBClusterParameterGroup, CopyOptionGroup,
ResetDBParameterGroup and ResetDBClusterParameterGroup. The groups, their
overrides and options were already modelled and served by the create,
modify, describe and delete actions; these five answered
UnsupportedOperation.
A copy resolves its source by name or ARN, creates the target through the
existing create path so the already-exists check and the ARN come from one
place, and copies the family and overrides, or the engine, major version
and options for an option group, with any Tags applied. Source and target
names must pass AWS's identifier rule, which is how AWS refuses to copy a
managed default group: its name carries periods, and the answer is
InvalidParameterValue with the identifier message. A reset drops the named overrides or all of
them; ResetAllParameters together with a Parameters list is
InvalidParameterCombination, and a managed default cluster group answers
InvalidDBParameterGroupState as Modify does. Responses use the model's
result wrappers and shapes. The action table in docs/services/rds.md is
regenerated and its note that CopyOptionGroup is unimplemented removed.
Closes#3777
* feat(sfn): support ItemReader InputType CSV
A Distributed Map can read a CSV dataset through ItemReader. Field names come
from the first row, or from ReaderConfig.CSVHeaders when CSVHeaderLocation is
GIVEN, and each data row becomes an object of string values.
Every value is a string, a row shorter than the headers pads with empty
strings, and a longer one drops the surplus, as AWS documents.
Drops the assertion that CSV is not implemented, which this replaces.
* feat(sfn): honour CSVDelimiter and quoted newlines in ItemReader CSV
ReaderConfig.CSVDelimiter selects COMMA, PIPE, SEMICOLON, SPACE or TAB. An
unsupported value fails the state with States.ItemReaderFailed.
CsvParser.parseAll gained a delimiter overload and now tracks quotes across
line breaks, so a quoted field may carry the delimiter or a newline without
ending the record. The single argument overload keeps comma behaviour for the
existing callers.
* fix(sfn): apply the documented CSV quote and backslash escaping
AWS preserves a doubled quote as a single quote whether or not the field is
quoted, so the reference dataset's {""MyKey"":""MyValue""} has to reach
States.StringToJson as {"MyKey":"MyValue"}. The reader dropped both quotes
instead: only a quote opening a field starts a quoted run, and the unquoted
case fell through to the toggle that consumed the pair.
Backslash escaping was missing as well. A backslash escapes another backslash,
a quote or the configured delimiter, and a backslash before anything else is
dropped.
parseLine and parseAll now share one scanner so the rules live in one place.
The backslash rules stay off for parseLine, which S3 Select and Athena use,
where a lone backslash is ordinary data.
The RDS service model declares the Parameters list with locationName
Parameter, so the CLI and every SDK serialise it as
Parameters.Parameter.N.ParameterName. ModifyDBParameterGroup and
ModifyDBClusterParameterGroup only read Parameters.member.N, the plain Query
encoding, so a real client's overrides were never seen: the call returned
200 and DescribeDBParameters stayed empty. Terraform's parameter blocks were
dropped the same way while the apply reported success.
Parse both encodings through one helper, keeping the member form for
hand-built callers as ModifyOptionGroup does for OptionsToInclude.
Closes#3779
* feat(verifiedpermissions): run Cedar from the floci-sidecar-cedar image
The Cedar sidecar now comes from floci-io/floci-sidecars as
floci/floci-sidecar-cedar, pinned to an exact version because a cached
:latest is never re-pulled. CedarSidecarManager reads the contract JSON
that the image's /health returns: a sidecar speaking another contract
major is refused immediately with a message naming the image and the
FLOCI_SERVICES_VERIFIEDPERMISSIONS_CEDAR_IMAGE and _CEDAR_URL settings
to change, instead of polling for thirty seconds or failing later on a
request. A pre-configured URL is probed the same way. A sidecar whose
health body is not JSON predates the contract and is accepted with a
one-time warning.
* test(verifiedpermissions): exercise the published Cedar image
VerifiedPermissionsIntegrationTest no longer boots the in-tree sidecar in
process: CedarSidecarManager starts the pinned image through Docker, the
same path production takes, under a vp-test resource namespace so the
manager's remove-before-start cannot kill a developer's live sidecar. It
is skipped without Docker, and locally when the image is not present; in
CI a missing image fails. VerifiedPermissionsServiceTest keeps its
reject-before-persist coverage against a fake sidecar answering 400, and
CedarSidecarClientTest pins the request shapes and the 200/400/other
mapping Floci owns.
* chore(build): drop the in-tree Cedar sidecar
sidecars/cedar now lives in floci-io/floci-sidecars as cedar/ with its
history. The build-helper test source root and the test-scoped cedar-java
dependency existed only to boot that server inside the test JVM; the
tests now run against the published image, so both go, along with the
.dockerignore allowlist entry that let the sidecar Dockerfile see its
sources from the repository root context.
* ci: stop publishing the Cedar sidecar from this repository
The release, nightly and reusable image workflows no longer build a
Cedar image or record it in the provenance manifest; the sidecar is
released from floci-io/floci-sidecars on its own cadence. The
compatibility workflow no longer builds and starts the sidecar by hand:
Floci pulls the pinned image itself over the mounted socket onto
compat-net, exactly as it already does for floci-duck. The unit-test
shards prefetch the pinned image, reading the tag from application.yml
so the two cannot drift.
The floci/floci:*-cedar tags stop at this change; whether the next
release cut retags the sidecar image under the old name for a
deprecation window is a release decision, not a workflow default.
* docs(verifiedpermissions): document the external Cedar sidecar image
The Verified Permissions page names floci/floci-sidecar-cedar, why it is
pinned to an exact version, how to pre-pull it, where its API and the
sidecar contract are documented, and what a contract mismatch looks
like. The README's Docker integration table gains the Verified
Permissions row it never had. AGENTS.md records the sidecar rule: own
repository, no tag suffix on the Floci image, no :latest default, the
sidecar releases first, and how a sidecar is tested from here.
The fifteen /v2/email/configuration-sets endpoints, event destinations
included, and their six option parsers move byte-for-byte out of
SesController into SesConfigurationSetController. Eleven of them call
SesConfigurationSetService directly and so do the v1 handler's eight
matching actions, so SesService drops twelve delegations and reads the
store through the service internally. Create, the tracking and delivery
option setters and delete stay on the facade, which supplies the
verified-domain and dedicated-pool probes and guards the delete against
tenant associations. The new class is registered on the SES descriptor.
No wire behavior changes.
RekognitionService and TextractService each carried a byte-for-byte
identical buildGeometry/addPoint pair (BoundingBox plus 4-point
Polygon construction), found via CPD as a 26-line block (#3792).
Rekognition's own Javadoc already documented this as known,
intentional duplication: "the same shape Textract uses (Rekognition's
Geometry shape is structurally identical)".
Extracted it into AwsGeometry.buildGeometry in core.common, and
pointed both services at it.
No behavior change: the response shape is identical to both copies
before this, only its location changed. Both RekognitionIntegrationTest
and TextractIntegrationTest already assert directly on the Geometry/
BoundingBox/Polygon shape, so that path is covered.
ParquetEmitter.validatePathSegment was byte-for-byte identical to
S3DestinationValidation.requireSafeKeySegment (#3791), which #3651/
#3666 already created for exactly this logic, originally shared
between BCM Data Exports and CUR. ParquetEmitter was never migrated
to it.
Deleted the private copy and pointed both call sites at the shared
utility instead.
No behavior change: the validation rule and error message are
identical, only their location changed. validateBucketName is left
alone: its error messages differ from S3DestinationValidation's
bucket-name check, so replacing it would be a separate change, not
covered by this issue.
* refactor(cloudformation): move AWS::Route53::RecordSet into Route53CfnProvisioner
The record set leaves CloudFormationResourceProvisioner for the provisioner that
already owns AWS::Route53::HostedZone, which gains a type switch in provision and
delete; the hosted-zone path is untouched. The record-set arm keeps the legacy
behaviour exactly, a name-only resource whose Ref is the resolved Name or a
generated record- id, and now also publishes Id, the registry schema's only
read-only property, which Fn::GetAtt could never resolve before. Its delete logs
the same warning the legacy default arm did, since nothing was ever written for
the record. Writing the record through ChangeResourceRecordSets and enforcing the
schema's required Type and Name are follow-ups, not part of the move.
The legacy switch goes from 24 to 23 types and the monolith loses its last
Route53 reference.
* refactor(cloudformation): keep AWS::Route53::RecordSet free of GetAtt attributes
The move published Id because the schema coverage gate asks for every
read-only property in the registry schema. That schema has no handlers:
RecordSet is a legacy type, and the CloudFormation resource specification
gives it no attributes, so Ref stays its only reference, as it was in the
legacy provisioner. Id is recorded in getatt-attribute-gaps.tsv instead.
* feat(apigateway): honour the remaining REST integration settings
PutIntegration persisted 6 of the 16 fields AWS documents. The rest were
accepted without error and silently dropped, so an integration could be created
exactly as intended and then behave as though the configuration were absent.
- timeoutInMillis is applied to the backend call and defaults to AWS's 29,000ms
rather than the previously hardcoded 30s. Values below AWS's 50ms floor are
rejected; the 29s ceiling is an edge-optimized limit, so Regional APIs may
exceed it.
- tlsConfig.insecureSkipVerification skips backend certificate and hostname
verification. Without it an HTTPS backend behind a private CA or a self-signed
certificate was unreachable with no way to opt out.
- contentHandling converts payloads in both directions: CONVERT_TO_TEXT
base64-encodes a binary request for mapping templates, CONVERT_TO_BINARY
decodes a base64 text request before it is sent. Integration responses accept
it too, applied as an output conversion after response templates.
- binaryMediaTypes on the RestApi marks content types as binary. A binary body
now reaches an AWS_PROXY integration base64-encoded with isBase64Encoded set;
previously it was read as a UTF-8 string, which corrupted it.
- connectionType VPC_LINK requires connectionId to name a link that exists and
is available. The five REST VPC Link operations are implemented at /vpclinks.
Floci has no real VPC, so a valid link routes straight to the integration URI;
what is enforced is the misconfiguration AWS also rejects.
- cacheNamespace and cacheKeyParameters drive response caching, gated on both
switches AWS requires: cacheClusterEnabled on the stage and caching/enabled on
the method. Only successful responses are cached, expiring after the method's
ttlInSeconds.
- credentials is persisted and returned. Floci does not enforce IAM, so the role
is not actually assumed.
The same fields are now carried through an OpenAPI import, which previously
dropped them from x-amazon-apigateway-integration.
* fix(apigateway): align TLS, cache keys and VPC link patches with AWS
Three review findings on the REST integration settings, all cases where the
local behaviour was looser than the contract AWS documents.
tlsConfig.insecureSkipVerification installed a trust-all X509TrustManager, so an
expired certificate, a broken chain or a chain with no root reached the backend
happily. AWS skips only the check that the certificate was issued by a supported
certificate authority; it still performs basic validation of the expiration
date, the hostname and the presence of a root certificate authority. A backend
that would fail in AWS therefore worked here, which is the direction that hides
a production TLS misconfiguration. The trust manager now verifies validity,
checks that the chain holds together and terminates in a self-signed root, and
requires cA=true on that root when it actually issued a leaf. Hostname
verification is now requested explicitly rather than being switched off: note
that java.net.http.HttpClient always applies HTTPS endpoint identification and
ignored the previous null algorithm, so the hostname was in fact still checked,
but the code and its documentation both claimed otherwise.
The response cache key appended the method and request path to cacheNamespace.
AWS allows one cacheNamespace across several resources exactly so those
resources return the same cached data, and no two resources share a path, so the
setting could never do what it exists for. The key is now the namespace plus the
declared cacheKeyParameters. The namespace still defaults to the resource id, so
resources that did not opt into sharing stay separate.
UpdateVpcLink never looked at op. Any operation on /name or /description was
applied, so op=remove,path=/name set the name instead of being rejected, and
every other path was silently ignored and reported as success. AWS's patch table
supports only replace on those two paths; anything else is now a
BadRequestException.
Also removes the em dashes AGENTS.md disallows from the test files this branch
adds, which the Documentation Style check flagged.
* fix(apigateway): enforce keyCertSign and name constraints under insecureSkipVerification
The comment on CaIssuanceSkippingTrustManager claimed the root check matched
AWS's two requirements on a private root, cA=true together with a keyUsage
including keyCertSign, but only getBasicConstraints() was ever consulted. A root
with CA:TRUE and no keyCertSign was accepted here and rejected by real API
Gateway, which is the direction that hides a broken certificate authority until
deployment. The keyUsage bit is now checked alongside basicConstraints. An
absent keyUsage extension is still accepted: RFC 5280 leaves the key
unrestricted when it is missing, and PKIX reads it the same way.
The rest of the chain walk is now the platform's PKIX validator, anchored on the
chain's own root, which is exactly the "stop checking that the root is one we
trust, keep checking everything else" semantic this setting has in AWS. That
brings X509v3 name constraints with it, which the hand-rolled walk did not
implement at all, along with basicConstraints and keyCertSign on intermediates
and pathLenConstraint. The anchor's own extensions are not examined by PKIX, so
the root's checks stay explicit, and its NameConstraints extension is passed
through to the TrustAnchor. Expiration stays explicit too, because PKIX exempts
a trust anchor from it and AWS does not.
A lone self-signed certificate keeps its own path: it is its own root and is the
plain self-signed-server case the setting exists to enable, so CA extensions are
not demanded of it.
Three tests against real HTTPS backends: a well-formed private CA chain is
reached, a root declaring CA:TRUE without keyCertSign is rejected, and a root
that permits itself only internal.example while issuing for localhost is
rejected. The latter two return 200 without this change.
* fix(apigateway): require keyUsage on a private root and evaluate name constraints properly
Two corrections to the previous round's TLS work.
AWS states the root constraint as "x509 extension keyUsage must have
keyCertSign", which a root carrying no keyUsage extension at all does not
satisfy. The previous commit read a missing extension as leaving the key
unrestricted, which is generic RFC 5280 semantics but not this API
Gateway-specific requirement, and so accepted a certificate authority real API
Gateway turns away. A root without the extension is now rejected.
The name constraints handling was also wrong, in a way its own test hid.
Constraints were unwrapped from the root and handed to the TrustAnchor, but the
platform validator refuses to process anchor-supplied constraints and fails with
"name constraints in trust anchor not supported". So a root carrying the
extension was rejected blindly, never evaluated, and the test asserting a
violated constraint passed on that unrelated error.
Root-level constraints are now rejected deliberately, with an error that says
so, rather than as a side effect of a validator limitation. That is also the
documented behaviour: AWS tells operators hitting validation errors under
insecureSkipVerification to check their CA certificates for Name Constraints
extensions and reissue without them. Constraints on an intermediate sit inside
the certification path, where the validator does read them, and those are
enforced for real: the log now shows "name constraints check failed" rather than
"not supported".
Tests follow the same split. A three-certificate chain whose intermediate
permits only internal.example while issuing for localhost is rejected, a chain
whose intermediate permits localhost is reached, so the first is failing on the
constraint rather than on chain length, and a root carrying constraints is
rejected as its own documented case. Plus a root with CA:TRUE and no keyUsage
extension, which returns 200 without this change.
* fix(apigateway): match binaryMediaTypes literally apart from the catch-all
The matcher expanded a subtype wildcard, so an image/* entry covered
image/png. Nothing in the AWS documentation establishes that as a
pattern: */* is documented concretely ("To support all binary media
types, specify */*"), while every other example names one exact media
type at a time, and the browser walkthrough tells you to register the
concrete image/webp even though the request's Accept header carries
image/*. Expanding it made Floci treat a payload as binary where AWS
would compare the entry as a literal string and treat it as text.
Entries are now compared literally, ignoring the charset parameter,
with */* as the one wildcard. The wildcard branch keeps its coverage
through a */* test, and a second test pins the subtype wildcard as
not expanded so the behaviour cannot drift back silently.
A state reset and nuke run every container teardown (#3718), a hook written
for process shutdown. The SageMaker training runner and endpoint manager shut
their worker pools down there and never created new ones, so after one reset
every CreateTrainingJob, CreateEndpoint and UpdateEndpoint returned 500 with
RejectedExecutionException until Floci restarted. The ECS service stopped its
reconciler the same way, so services were never reconciled again.
The three services now implement Resettable and restore the pool or the
reconciler in clear(), which a reset runs after the teardown and the storage
wipe and shutdown never runs. Teardown itself is unchanged, so the ECS
reconciler still stops before the final flush on shutdown.
A reset also interrupts in-flight training runs, and an interrupted run wrote
its failure back unconditionally, which could bring a wiped job back.
updateTrainingJob now writes only while the stored job is the same one, by
ARN and creation time, as finalizeEndpointStart already does for endpoints.
CI only showed this when EmulatorInfoControllerIntegrationTest and
SageMakerDockerIntegrationTest shared a shard, which the deterministic
partitioner does for some class lists, so it failed every rerun on those PRs.
The nine /v2/email/tenants, /v2/email/tenant and /v2/email/resources
endpoints and their JSON helper move byte-for-byte out of SesController
into SesTenantController. Creating, reading and listing tenants and
setting their suppression attributes call SesTenantService directly, so
SesService drops those four delegations; the resource associations stay
on the facade because they check that the associated identity,
configuration set or template exists, and the tenant delete stays for
its suppression cascade. The new class is registered on the SES
descriptor. No wire behavior changes.
Floci had zero CodeArtifact support: no service package, no docs, nothing.
Any terraform apply touching aws_codeartifact_domain, aws_codeartifact_repository,
or either permissions-policy resource failed outright. This adds the full
CodeArtifact control plane: domain and repository CRUD, resource policies with
optimistic-locking revisions, tags, and the fixed set of real AWS-hosted
external (upstream) connections (public:npmjs, public:pypi, public:maven-central,
etc.).
Package publish/fetch endpoints per format (npm, PyPI, Maven, NuGet, generic)
are intentionally out of scope here: this closes the terraform apply gap, not
real package serving.
ListTagsForResource (POST /v1/tags?resourceArn=) is CodeArtifact's one tag
operation that addresses the resource with a query parameter on the bare path
rather than a path segment, unlike every other V1TagsController/SharedTagsController
handler. That method lives on V1TagsController itself rather than the shared
AbstractTagsController base: SharedTagsController (mounted at /tags) already
declares its own bare POST (tagResourceByBody, for TagResource), so a bare POST
on the shared base collides with it and Quarkus refuses to start. CodeArtifact's
handler is @V1Tags-qualified and only ever registered against V1TagsController,
so the method belongs there. core/common stays service-free: CodeArtifactTagHandler
registers itself as a bean the same way MskTagHandler does, and TagHandler gained
a default for the lowercase key/value entry names CodeArtifact uses instead of
AWS's usual capitalized Key/Value.
Known, documented limitations (see docs/services/codeartifact.md): no cycle
detection across upstream chains, no referential-integrity check when deleting
a repository other repositories reference as an upstream, and no authorization
check on cross-account domainOwner addressing (consistent with Floci's opt-in
IAM enforcement elsewhere).
Verified against the real botocore codeartifact service-2.json (protocol, exact
querystring vs. body placement per operation, exact ARN format, epoch-seconds
timestamps, real error shapes) and the live AWS API docs for behavioral rules
not in the wire model (DeleteDomain blocked while repositories exist, the real
fixed external-connection name/format list, PutDomainPermissionsPolicy's
all-body field placement vs. the sibling repository operation's querystring
placement).
Live-verified three ways:
- Unit tests including a concurrent-create race test proving the synchronized
guard actually holds under contention, plus full-stack QuarkusTest/RestAssured
integration tests.
- A real terraform init/apply/plan/destroy cycle against a running Floci
instance, independently confirming destroy actually tore the domain down via
a follow-up describe-domain call.
- A live AWS SDK v2 Java test exercising the real CodeartifactClient against a
live instance.
The four /v2/email/suppression/addresses endpoints move byte-for-byte
into SesSuppressionController and the three /v2/email/tags endpoints
into SesTagController. Both keep calling the SesService facade: an
optional TenantName routes each suppression operation to that tenant's
own list across the suppression and tenant domains, and tagging parses
the resource ARN and dispatches to whichever of the seven taggable
domains owns it, so the facade loses nothing and both moves are pure
size splits in the shape of LambdaTagController. Both classes are
registered on the SES descriptor. No wire behavior changes.
* feat(redshift): seed catalog and system views on cluster startup
Seed Amazon Redshift catalog and system views on container startup into both template1 and dev databases so BI, ORM, and migration tools (Tableau, Looker, DBeaver, Flyway, Liquibase, dbt) can introspect database schema metadata without missing-relation errors.
* feat(redshift): record COPY failures in stl_load_errors and dynamicize query logs
Record failed S3 COPY attempts into pg_catalog.stl_load_errors via LoadErrorRecorder across simple and extended query flows. Convert stl_query and svl_qlog into dynamic views backed by pg_stat_activity, and add stv_wlm_query_state and svv_diskusage catalog views.
* fix(redshift): align catalog views with documented Redshift column schema
* fix(redshift): separate catalog seeding from copy error recording
* test(redshift): preserve container manager coverage
EmulatorLifecycle.onStop and EmulatorInfoController's /state/reset and
/state/nuke each independently ran an identical loop over every
ContainerTeardown implementation, log text included (flagged on #3718).
Extracted the loop into ContainerTeardowns.stopAll(), following the same
pattern as the recent cron/SigV4/SSRF dedupes. Callers keep passing their
own LOG so the log category stays tied to the calling class instead of
shifting to ContainerTeardowns.
Also fixed a stale comment in EmulatorInfoController: "Storage first" sat
under a "Containers first" comment that now runs before it; it means
"Storage before resettables" today.
No behavior change, so no new tests: EmulatorInfoControllerTest already
covers the ordering and per-teardown failure tolerance this loop provides.
* fix(ec2): reject key pair requests without KeyName
CreateKeyPair accepted a request with no KeyName and stored a nameless key
pair; the duplicate check then dereferenced that name on every later
CreateKeyPair, and the Query catch-all reported it as
"Unexpected error: null". CreateKeyPair and ImportKeyPair now answer
MissingParameter, ImportKeyPair answers InvalidKeyPair.Format instead of an
InternalFailure for material that is not base64, DeleteKeyPair requires a
name or an id and returns the deleted keyPairId, and the name comparisons
tolerate a nameless record already sitting in a persistent store. The EC2
docs still described the placeholder key material that #3307 replaced.
Closes#3356
* fix(ec2): return InvalidKey.Format for malformed key material on ImportKeyPair
The EC2 API error reference lists InvalidKey.Format as the key pair not being in a valid OpenSSH public key format, which is the message this branch sends. InvalidKeyPair.Format is a separate documented code for a different failure.
* fix(sqs): reflect CancelMessageMoveTask at once instead of after the rate interval
A throttled message move task slept 1000 / MaxNumberOfMessagesPerSecond ms
between moves and checked its cancel flag only afterwards, and
CancelMessageMoveTask set the flag without waking the worker. At rate 1 a
cancel therefore took up to a second to be reflected and the task kept
reporting RUNNING meanwhile. AWS reports CANCELLING as soon as the cancel is
accepted and CANCELLED once the in-flight message is done. The latency is
what made cancelledMessageMoveTasks_areBoundedAndAllowTheNextTask flaky:
eleven rate-1 cancels each waiting about a second on a loaded shard.
Replace the flag with a one-shot latch the worker waits on as its throttle,
so a cancel wakes it and its finally block writes CANCELLED at once. Mark
the task CANCELLING when the cancel is accepted, with a compare-and-set so a
task that already completed is left alone, and classify CANCELLING as
active so it neither starts the terminal TTL nor counts against the
terminal history cap, and still blocks a second task on the same source.
Closes#3756
* fix(sqs): record move task progress under the store lock
cancelMessageMoveTask now writes a task's status from a second thread, and
updateMoveTaskCounter's get-then-put outside the store's lock was only safe
while the worker was the sole writer: a cancel landing between the get and
the put could be stomped back to RUNNING until the loop resolved to
CANCELLED. Move the counter update into a synchronized store method that
reads the current status and writes back under the same lock transition
uses. Import CountDownLatch and TimeUnit and make the two touched
declarations explicit.
Raised in review on #3757.
* fix(sqs): resolve a move task's terminal status under the store lock
The worker's finally block read the task, decided COMPLETED or CANCELLED
from its own cancellation signal, and only then wrote, all outside the
store's lock. A cancel accepted between the decision and the write, which
had already moved the task to CANCELLING, was overwritten with COMPLETED.
Resolve the outcome in a synchronized store method that reads the status
at that moment: a task already CANCELLING ends CANCELLED whatever the
worker concluded, otherwise the worker's view stands. A package-private
finishMoveTask lets the regression replay the worker's terminal write with
a stale decision after a cancel has been accepted.
Raised in review on #3757.
An unhandled exception with no message, such as a NullPointerException on
the native image, rendered as "Unexpected error: null" on the Query wire,
which is what the reporter of #3356 saw. The Query controller and the SQS,
RDS and Neptune handlers now fall back to the exception's class name.
Refs #3356
The six /v2/email/account endpoints and their FeatureStatus helpers move
out of SesController into SesAccountController, which injects
SesAccountService, SesSuppressionService and SesSentEmailService and
composes GetAccount from their reads without the facade. The send
endpoints in SesController and the v1 handler read the account sending
switch and the sent-mail count from those services directly too, so
SesService drops its eleven account-level delegations. The
SuppressedReasons and SendingEnabled parsers turn out to be shared with
the configuration-set endpoints and move into SesV2Json with unit tests.
The new class is registered on the SES descriptor. No wire behavior
changes.
* fix(lifecycle): stop managed containers on state reset, not just shutdown
/state/reset and /state/nuke clear StorageBackend and every Resettable
bean, but ContainerTeardown was only invoked from EmulatorLifecycle.onStop.
A reset left Batch, CodeBuild, and now SageMaker training/endpoint
containers running with no record of them left in the store to reconcile
against. EmulatorInfoController now runs the same teardown loop before
wiping storage, tolerating individual failures the same way shutdown does.
* fix(lifecycle): use explicit InOrder type instead of var in test
AGENTS.md disallows var for local declarations; the concrete Mockito
type at a call site is the thing worth seeing in a review.
RotateSecret stages the new version from the rotation executor while a
request thread answering DescribeSecret, GetSecretValue or
ListSecretVersionIds iterates the same Secret.versions map. The map was a
plain HashMap, so a put landing during that iteration failed the request
with a ConcurrentModificationException. It surfaced as a flaky
SecretsManagerJsonHandlerTest.rotateSecretParsesRotationRules on main, and
any client polling a secret during its rotation could hit it, where AWS
always answers with a consistent version set.
The writes already run under the per-secret lock from #3247; the reads
deliberately do not, because a describe never waits on a rotation, as on
AWS. A fail-fast map cannot support that contract. Secret.setVersions now
copies a plain map into a ConcurrentHashMap and installs a ConcurrentMap
as given, which covers createSecret, the rotation lifecycle and Jackson on
reload from persistence. Iteration is weakly consistent: no exception, and
a reader sees the version set as of before or after the staging put.
A deterministic regression parks the handler's DescribeSecret one entry
into its iteration, stages a version, and resumes it; it throws on main and
passes here. The existing BlockingVersions test helper extends
ConcurrentHashMap so the setter installs it unchanged.
Closes#3753
A subscription filter policy compared a String.Array message attribute against its
serialized JSON array as a single opaque string, so a policy rule of "Name" never
matched an attribute of ["Name","stringName"]. Any subscription filtering on a
multi-valued header silently matched nothing. AWS treats each element as a separate
string: a positive rule matches when any element matches, while anything-but matches
only when no element is listed, and exists asks about the attribute rather than its
elements.
$or was not recognised at all. The key was looked up as a message attribute literally
named "$or", which never exists, so the subscription went silent with no warning. It
is now honoured in both MessageAttributes and MessageBody scope under the conditions
AWS requires -- an array of at least two objects, none using a reserved operator name
as a field name -- and otherwise falls back to being an ordinary key, as AWS does.
EventBridge already had $or; SNS never got it.
Parsing the array value uses FAIL_ON_TRAILING_TOKENS, so a value like "[\"a\"] junk"
is treated as malformed and matched whole rather than element-matching as ["a"].
* feat(secretsmanager): add the five missing actions and correct response fidelity
Secrets Manager implemented 18 of the 23 actions in the API reference. This
adds the remaining five and corrects a number of response and validation
divergences found by working through each operation's reference page.
New actions:
- CancelRotateSecret turns rotation off and reports the half-built AWSPENDING
version an interrupted rotation left behind. The staging labels are left
alone, as AWS leaves them, because that version id is the only handle on a
stale AWSPENDING - and a stale AWSPENDING that is not also AWSCURRENT makes
every later RotateSecret fail with "a previous rotation isn't complete".
- ValidateResourcePolicy reports wildcard principals under the same
REFLEXIVE_PRINCIPAL_CHECK name AWS uses. BlockPublicPolicy on
PutResourcePolicy now enforces the same check.
- ReplicateSecretToRegions, RemoveRegionsFromReplication and
StopReplicationToReplica, backed by a replication model on Secret. Replicas
carry the primary's ARN with the Region swapped, track later writes to the
primary, and are read-only; a primary that still has replicas cannot be
deleted.
Scheduled rotation now fires. RotationRules were stored and echoed back but
never acted on, so AutomaticallyAfterDays and ScheduleExpression described a
schedule that could not happen. A background sweep rotates secrets whose
NextRotationDate has passed, reusing the EventBridge Scheduler expression
parser for rate() and cron(). The schedule advances when a rotation is
dispatched rather than when it succeeds, so a failing rotation cannot pin the
sweep on one secret forever.
Response fidelity:
- ListSecrets honours SortBy, SortOrder and IncludePlannedDeletion, and its
entries carry SecretVersionsToStages, the rotation fields, DeletedDate and
PrimaryRegion.
- PrimaryRegion and ReplicationStatus appear only on multi-Region secrets,
matching AWS's "only returns fields that have a value" rule.
- Versions with no staging labels are deprecated: DescribeSecret and
ListSecretVersionIds omit them unless IncludeDeprecated is set, and an empty
VersionStages array is omitted rather than sent.
- ListSecretVersionIds gained IncludeDeprecated, LastAccessedDate and paging.
Validation, all previously accepted silently:
- DeleteSecret rejects a recovery window outside 7-30 and the
ForceDeleteWithoutRecovery/RecoveryWindowInDays combination. A window of 0
used to fall through to force-delete, turning a request for no recovery
window into an unrecoverable delete.
- CreateSecret uses ClientRequestToken as the version id and is idempotent on
retry; UpdateSecret, which AWS documents as not idempotent, rejects a token
that already names a version.
- RotationRules bounds, secret name charset, SecretString/SecretBinary
exclusivity, KMS key existence and state, and the documented caps on
BatchGetSecretValue, Filters, ExcludeCharacters and ResourcePolicy.
Secret values remain stored in the clear; encrypting them with the emulator's
own KMS would protect nothing while making the store unreadable. KmsKeyId is
validated instead, which is the part a caller can observe.
Two deviations are deliberate and recorded in docs/services/secrets-manager.md:
LastRotatedDate is retained after CancelRotateSecret, and RotateSecret with
RotateImmediately=false does not create the throwaway AWSPENDING version.
* test(secretsmanager): create a real KMS key in the sdk-test-java compat test
kmsKeyIdPreservation asserted that floci round-trips whatever KmsKeyId it is
handed, using an ARN that was never created. That passed only because floci
did not check the key; real AWS rejects a key it cannot access, and so does
the new validation.
The test now creates a key through the emulated KMS and round-trips that ARN,
so it still covers KmsKeyId preservation without depending on the missing
check. A second case pins the rejection itself.
* refactor(secretsmanager): import types instead of qualifying them inline
AGENTS.md asks for imports unless a name collision forces qualification.
AwsException and UUID had neither.
* fix(secretsmanager): hold the rotation lock while promoting a replica
StopReplicationToReplica wrote the promoted replica outside the per-secret
lock every other mutation in this file takes. The promotion races the
primary's replica sync, and losing that race writes the replica back over the
copy the call just promoted.
Also imports KmsKey, ConcurrentHashMap and HashMap rather than qualifying
them inline, per the same AGENTS.md rule.
* test(secretsmanager): assert the KMS rejection by exception type, not message text
createSecretWithAnUnknownKmsKeyIsRejected matched "InvalidParameterException"
against the message, but that is the exception type; the message itself reads
"You can't access the KMS key ... in this Region". The assertion now checks
the typed InvalidParameterException and the text it actually carries.
* test(secretsmanager): give the new KMS compat test its own order
createSecretWithAnUnknownKmsKeyIsRejected inherited @Order(13) from the test
it was added next to, so two cases shared a position. JUnit breaks the tie
deterministically, but the duplicate made the sequence misleading; the tail is
renumbered so each case keeps a distinct order.
Also sorts the new KMS imports, which landed between the lambda ones.
* fix(secretsmanager): guard every write to a secret with its owning monitor
UpdateSecret read, mutated and persisted without taking the secret's lock,
unlike every other mutator in the class, so two concurrent calls could drop
one another's field.
StopReplicationToReplica locked the replica's own ARN, but persist() writes a
primary's replica slots while holding only the primary's lock: two monitors
guarding one store slot, so a sync landing after the promotion could overwrite
the promoted copy. The promotion now runs under the primary's monitor, and its
two halves run in one critical section so nothing lands between them.
SecretsManagerWriteLockTest parks a write mid-flight and asserts the second
caller waits; both cases fail without the fixes.
* fix: enforce safe default network binding
* fix(config): keep signed test authority stable
Pin the integration-test listener to the existing all-interface test bind and
opt into that bind only in the test profile. This preserves localhost-based
SigV4 fixtures while production keeps the loopback default.
* fix(config): keep compat image backward compatible
* chore: retrigger CI
* fix(config): mirror JVM image network binding
The five /v2/email/custom-verification-email-templates endpoints and
their two helpers move out of SesController into SesCvetController. Get,
list and delete call SesCvetService directly, and SesQueryHandler's v1
actions do the same; create and update stay on the SesService facade
because their validation checks the From address against the identity
domain. SesService drops the three pure delegations, and sending a
custom verification email stays with the send endpoints. The new class
is registered on the SES descriptor. No wire behavior changes.
* chore(cloudformation): sweep the dead code out of the legacy resource provisioner
Eleven batches have moved types out of CloudFormationResourceProvisioner and each
left something behind: a constructor parameter that is injected but never assigned,
a helper whose last caller moved, an import for a model type nothing here touches, a
section header with no code under it. None of it is reachable, so none of it needs a
test to remove.
Gone: eight constructor parameters (22 to 14, every remaining one is assigned and
used), eleven private methods with no caller but their own declaration (the nine
JSON put and parse helpers plus resolveOptionalWithoutDynamicReferences and
parseCfnTags, whose last callers left with RDS and DynamoDB), twenty-six imports
with no remaining use, and seven empty section headers. The test fixture drops the
same eight positional arguments; its builder keeps the fields because the inferred
provisioners still take those services. 3,638 lines to 3,430, no behaviour change.
* chore(cloudformation): drop the orphaned CORS Javadoc and reattach the legacy-set Javadoc
Two comment-only leftovers of earlier batches, both found while checking a review
comment on the sweep. The Javadoc for the S3 CorsConfiguration method stayed behind
when #2754 moved the method to S3CfnProvisioner; it goes. The Javadoc describing
LEGACY_SWITCH_TYPES was stacked directly above the DELETE_NEEDS_STACK_RESOURCE one,
so the compiler attached it to nothing and the set it describes had no doc; it now
sits above its own declaration, text unchanged.
* feat(eks): expose IMDS on 169.254.169.254 inside cluster containers
When applications or agents run on Kubernetes nodes or use hostNetwork: true, they expect the AWS Instance Metadata Service (IMDS) at the standard link-local address 169.254.169.254:80. In Floci, EKS k3s cluster containers lacked access to IMDS at this link-local address, preventing workloads from discovering instance identities, node IAM roles, or dynamic cluster credentials without custom endpoint overrides.
This change exposes IMDS on 169.254.169.254:80 inside EKS cluster containers when floci.services.eks.imds is enabled. It configures a background TCP relay via socat pointing to the host's EC2 metadata port, registers a synthesized EC2 node instance with the cluster's IAM role and container IP in Ec2MetadataServer, extracts reusable metadata proxy logic into Ec2MetadataProxy, and documents node network namespace reachability and hop limit handling.
* fix(eks): address review feedback on lifecycle check, default flag, and instance seed
* fix(eks): synthesize distinct node instance profile and import CompletableFuture
* test(eks): enable IMDS profile and provide curl in docker test fixture
The 16 character cap was applied to every engine, but RDS accepts 63 on
PostgreSQL and 32 on MySQL, so an instance whose master username is longer
could not be created at all. The bound now comes from DatabaseEngine, using
the engine createDbInstance already resolves; the character rule and the
error message are unchanged.
Closes#3729
* feat(apigateway): implement GetUsage
GetUsage had no implementation, so a caller asking a usage plan what it
had consumed hit an unsupported action.
This returns the real envelope with zeroed numbers rather than metering
anything. Shape captured from real API Gateway: an items map of API key id
to one pair per day of the inclusive range, alongside usagePlanId,
startDate and endDate, and no position element when there is no further
page.
The pair is [used, remaining], not [used, quota]. Measured on a live usage
plan, the second element is the quota limit minus cumulative use in the
period: a plan with a 1,000,000 limit reported 999863 after 137 calls, then
999740 after 123 more. Anything reading that element as a quota is reading
it wrong.
Both elements are zero here, deliberately. Nothing counts requests per API
key, and a usage plan carries no quota to subtract from, so there is no
limit to report against. Throttle settings are already accepted and stored
without being enforced, so this is consistent with how the service treats
the rest of that surface. Storing a quota on the usage plan and counting on
the execute path are the two pieces still missing, and both the javadoc and
the service docs say so.
A caller that sums the used counts therefore gets zero, which is what it
already got when the action did not exist, without having to special-case a
missing endpoint.
Validation follows the captured errors: an unknown plan is NotFoundException
and an end date before the start date is BadRequestException, "Usage end
date must be after start date".
* fix(apigateway): paginate GetUsage
GetUsage takes limit and position, which this did not accept at all: every
attached key came back in one response, so the implementation only matched
the single-page case the original capture happened to exercise.
Pagination now runs over the API key entries, defaulting to 25 a page. The
token is the last key id already returned rather than a positional offset,
so a page resumes after a known key and a concurrent key attachment cannot
shift it. No position is emitted on the terminal page, matching the shape
captured from real AWS.
Two edges deliberately differ from real API Gateway, because it is not a
good guide there. It answers limit=0 with an InternalFailure, which is a
fault rather than a contract, so a page size below one is a
BadRequestException here. It also accepts a limit past the documented
maximum of 500, so anything larger is clamped rather than refused. Both
choices are written down in the service docs.
An unrecognised position is a BadRequestException, "Invalid position
parameter", which is the message real API Gateway returns.
The existing tests looked keys up with a dotted GPath. API key ids are
random and can begin with a digit, which Groovy then parses as a number, so
every lookup into items now uses bracket notation. That was luck rather
than correctness before.
* fix(apigateway): stop inventing a GetUsage limit ceiling
The previous head clamped any limit above 500 to 500, extrapolated from a
single observation that 501 was accepted. One accepted value does not
establish a rule.
Probed properly against real API Gateway: 500, 501, 1000, 5000, 100000 and
2147483647 are all accepted without error. The documented maximum is not a
rejection boundary, so no ceiling is imposed here either and the regression
asserts the observed rule across that ladder rather than an emulator
specific clamp.
Whether the service caps the page it actually returns above 500 is not
observable without a usage plan holding more than 500 keys, so nothing is
assumed about it and the docs say as much.
The lower bound stays a deliberate divergence, now with both values
measured: limit=0 and limit=-1 both answer InternalFailure on real API
Gateway. That is a fault rather than a contract, so a page size below one
is a bad request here instead of a reproduced 500.
* fix(apigateway): cap the GetUsage page at 500 while still accepting more
Removing the ceiling entirely went too far the other way. The probe shows
real API Gateway accepts a limit above 500, so rejecting one would be
wrong, but it never showed the service returning more than 500 entries in a
single page, and the documented contract caps a page at 500. Returning more
than 500 was therefore as unevidenced as rejecting the request.
Request acceptance and response page size are now separate: a larger limit
is honoured as a request, and the page stays capped at 500 until a real
result with more than 500 keys shows otherwise.
resolveUsageLimit becomes package-private so the distinction can be
asserted directly rather than needing a usage plan with 500 keys behind it.
* fix(apigateway): return GetUsage key usage under the values wire key
The response serialised the per-key usage map as "items", which is the
SDK-side member name, not the wire key. The Usage shape models that
member with locationName "values", so a real client parsing a body keyed
"items" finds the field absent and reads no usage at all.
Verified with botocore's own rest-json parser against the apigateway
service model: a body keyed "values" populates the member, a body keyed
"items" leaves it None.
Assertions and the service docs move with it. Only GetUsage is affected;
the sibling list actions are a different shape and are untouched.
A Distributed Map could only read a JSON dataset: every other InputType failed
the state with "not yet implemented". JSONL now reads one item per line,
skipping blank lines, so a trailing newline is not an item.
ReaderConfig.ItemsPointer stays JSON only, as on AWS, and MaxItems truncates a
JSONL dataset the same way it truncates a JSON one.