Commit Graph
598 Commits
Author SHA1 Message Date
Matan Baruch 485b7c5047 feat(rds): accept AWS IAM DB auth users on MySQL (#3395) 2026-09-11 10:10:26 -04:00
Franklin G. Mendoza efcbc4d993 feat(marketplace-metering): emulate AWS Marketplace Metering API (#3344) 2026-09-11 10:06:04 -04:00
Rafael Sierra f9f90cfc98 feat(s3): add object annotations support (#3324)
* feat(s3): add object annotations support

PutObjectAnnotation, GetObjectAnnotation, ListObjectAnnotations, DeleteObjectAnnotation
via the ?annotation subresource, with per-version storage, x-amz-annotation-directive
on CopyObject, s3:ObjectAnnotation:* notifications, and x-amz-object-if-match.

* fix(s3): serialize annotation restore with copy publication and sweep payloads on reset

* fix(s3): lock cross-account copy buckets via resolveBucket and log compat test cleanup
2026-09-11 10:00:16 -04:00
Franklin G. Mendoza 3c080e1ea6 feat(marketplace-reporting): emulate AWS Marketplace Reporting API (#3343) 2026-09-11 09:15:23 -04:00
Vũ Thế Huy 6b17ef2b1c feat(redshift): emulate GetClusterCredentials and GetClusterCredentialsWithIAM (#3273)
* feat(redshift): add RedshiftCredentialBroker for short-lived Db credentials

* refactor(rds-proxy): widen PasswordValidator to a three-value AuthResult

The wire-level password check the PostgreSQL/MySQL proxy handlers take now
returns REJECT / PASSTHROUGH / MASTER_EQUIVALENT instead of a boolean, so a
caller can tell the proxy to open the backend leg as the cluster master for a
client it has vouched for. RdsAuthProxy keeps its own boolean master-password
callback, renamed MasterPasswordCheck to free the PasswordValidator name, and
adapts it at the handler boundary (non-master stays PASSTHROUGH).

* feat(redshift): auth proxy accepts live GetClusterCredentials credentials

passwordValidatorFor now returns AuthResult and consults RedshiftCredentialBroker:
the master pair and any live minted credential resolve to MASTER_EQUIVALENT, a
known broker user with a stale password is REJECTed, everyone else PASSTHROUGH.

* feat(redshift): add default-credential-duration-seconds config

* feat(redshift): implement GetClusterCredentials action

Mints a short-lived DbUser/DbPassword pair via RedshiftCredentialBroker and
returns it as Query-protocol XML. AutoCreate prefixes IAM: on the DbUser,
DbGroups are echoed, DurationSeconds is validated to 900-3600 (default from
the new config key), and an unknown ClusterIdentifier propagates ClusterNotFound.
The two credential actions are registered in AwsQueryController.REDSHIFT_ACTIONS
and the Query dispatch now forwards the Authorization header to the handler.

* feat(redshift): implement GetClusterCredentialsWithIAM action

Derives the DbUser from the caller's IAM identity resolved via the Authorization
header: an IAM user maps to IAM:<name>, an assumed role to IAMR:<role>, and an
unresolvable caller to the IAMR:floci fallback with a WARN so local and CI flows
are not blocked. Any DbUser request parameter is ignored.

* feat(redshift-data): resolve non-master DbUser via GetClusterCredentials

resolveViaDbUser now accepts a DbUser that has a live credential in
RedshiftCredentialBroker, connecting to the container as the cluster master
(the minted DbUser is nominal). An unknown non-master DbUser still fails with
ValidationException.

* test(redshift): end-to-end GetClusterCredentials + Data API non-master DbUser

Docker-gated: mints a credential for a non-master DbUser via GetClusterCredentials
then runs SELECT 1 through the Data API as that DbUser, asserting the result.

* test(compat): SDK coverage for Redshift GetClusterCredentials

Adds getClusterCredentials and getClusterCredentialsWithIAM assertions to the
AWS SDK Redshift compatibility test.

* docs(redshift): document GetClusterCredentials and GetClusterCredentialsWithIAM

Regenerates the redshift.md action table (excluding the DbGroups member-name
switch label), fills the two new descriptions, updates the wire-auth and
redshift-data.md DbUser notes, and bumps the Service Matrix count to 23.

* fix(redshift): reject a wrong master password instead of passing it through

passwordValidatorFor only treated the master pair as MASTER_EQUIVALENT and let
everything else fall to the broker. A request with the master username but a
wrong password is unknown to the broker, so it classified as PASSTHROUGH; the
wire proxy then opened the backend leg as master (isMaster is username-only) and
the client authenticated with the wrong password. Now the master username is
decided on its own password: match to MASTER_EQUIVALENT, mismatch to REJECT.

* fix(redshift): reject proxy logins when the cluster row is gone; strip IAM user path

passwordValidatorFor fell through to the broker when the cluster was absent from
the account partition, classifying an unknown user as PASSTHROUGH; the wire proxy
reads isMaster from its own start-time config, so that still opened the backend
as master for the master username with any password. Return REJECT when there is
no cluster row to validate against.

RedshiftIamDbUserResolver now strips an IAM path prefix from a user ARN
(user/team/alice -> alice), matching how AWS names the DbUser.

* fix(redshift): keep concurrent credentials, revoke on delete, bound the config default

Addresses PR review (greptile):
- RedshiftCredentialBroker now holds every unexpired credential per DbUser instead
  of one slot, so a reissue no longer invalidates a still-live password (matches
  AWS, which keeps each issued credential valid to its own expiry).
- Add revokeCluster(); RedshiftService calls it on deleteCluster and at the start
  of createCluster, so a cluster recreated with the same identifier does not
  inherit master-equivalent access from a stale credential.
- resolveDurationSeconds now holds the YAML default to the same 900-3600 bounds as
  a request value, falling back to 900 with a WARN instead of minting a credential
  that is already expired or over-range.

* fix(redshift): revoke temp credentials on createCluster rollback too

The greptile review asked for revocation on 'relevant rollback paths'. Both
createCluster failure branches that delete the cluster row now also call
credentialBroker.revokeCluster, so a credential issued by a concurrent
GetClusterCredentials while the row briefly existed cannot outlive it.

* fix(redshift): correct GetClusterCredentials AutoCreate prefix

AWS prefixes the returned DbUser with IAM: when AutoCreate is false and
IAMA: when it is true. The handler returned IAM: when true and no prefix
when false, so a client using the returned name could not authenticate
and the value diverged from GetClusterCredentialsWithIAM, which already
issues prefixed identities.

The broker keys on the returned name, so the proxy and Data API now
expect the prefixed DbUser. Tests and the redshift docs are updated to
match.

* test(redshift): give compat GetClusterCredentials tests distinct @Order

Three methods shared @Order(2), leaving their relative order undefined.
Number the two credential tests 3 and 4 and move testDeleteCluster to 5.
2026-09-10 23:58:33 -04:00
TATSUNO “Taz” Yasuhiro d9cc2a09d0 fix(rds): map Aurora MySQL engine versions to the MySQL image tag (#3382)
CreateDBCluster with Engine aurora-mysql and an Aurora version such as
8.0.mysql_aurora.3.08.0 used the version literally as the container
image tag. Docker has no such tag, leading the pull to 404.

Take the MySQL version in front of the Aurora suffix, so that example
runs mysql:8.0. Plain mysql versions still map to their own tag.

The Go compatibility tests for the RDS Data API on aurora-mysql skip
when the cluster cannot be created, so this failure never showed in
CI. They now run with the mapping fixed.
2026-09-10 23:50:55 -04:00
Franklin G. Mendoza 48d2928061 feat(marketplace-deployment): emulate AWS Marketplace Deployment API (#3341) 2026-09-10 23:43:12 -04:00
Kenshin Okinaka debf9fb0dc feat(firehose): validate and persist ProcessingConfiguration (#3375)
* feat(firehose): validate and persist ProcessingConfiguration

A stream configured with a record transformation was accepted with a 200,
the member dropped by ignoreUnknown, and nothing echoed back. It is now
modelled, validated and stored, so a caller sees what it configured. The
transformation itself is not applied yet: records are still delivered
untransformed, and create and update say so in a warning.

The behavior follows what real AWS does, probed in us-west-2:

- A Lambda processor requires a LambdaArn, which must be a well-formed
  function ARN, and BufferSizeInMBs and BufferIntervalInSeconds are
  all-or-nothing.
- Processor types and parameter names are checked against AWS's enums,
  reproducing the order those sets are printed in and the 1-based member
  paths of the constraint messages.
- UpdateDestination replaces the whole block rather than merging it
  member-wise, the opposite of DataFormatConversionConfiguration: an update
  carrying only {"Enabled": false} leaves no processors behind, and an
  update is validated against its own content.
- A stored Lambda processor gains NumberOfRetries 3 and the stream's
  RoleArn, echoed in AWS's own parameter order.

Two checks AWS does not make are deliberately absent: NumberOfRetries is
not range-checked, accepted as 0 or 9 despite the documented 1 to 8, and the
function a LambdaArn names is not required to exist, unlike the Glue table a
conversion schema names.

* docs(firehose): record what AWS does with a null processor list member

Probed: real AWS answers InternalFailure for "Processors": [null] and for
"Parameters": [null], a fault of its own rather than a validation error.
Reproducing that helps nobody, so the entry stays ignored, which leaves the
configuration a caller would have had by omitting it, and the deviation is
written down instead. A test pins the choice so it reads as a decision.

The review also asked for a maximum of 3 on the processor list. Probing found
no such bound: three, four and five processors all pass validation and reach
the role check, so nothing is enforced here.
2026-09-10 23:25:18 -04:00
lex00 cb6b4d8a88 feat(athena): create, update and delete data catalogs (#3381)
Adds CreateDataCatalog, UpdateDataCatalog and DeleteDataCatalog to the Athena
JSON 1.1 handler, backed by a data-catalogs.json store obtained through
StorageFactory. Catalogs accept the four modelled types (LAMBDA, GLUE, HIVE,
FEDERATED) and a FEDERATED catalog reports the ConnectionType carried in its
connection-type parameter.

TagResource and UntagResource are new, and ListTagsForResource now also serves a
datacatalog ARN. Tags live on the record they belong to, so a workgroup keeps
storing its own tags exactly as before.

The built-in AwsDataCatalog keeps the shape it had: it is still listed first and
still resolves as a GLUE catalog, and it is reserved against create, update,
delete and tagging the way the primary workgroup already is.
2026-09-10 23:07:42 -04:00
Franklin G. Mendoza 2d51259120 feat(verifiedpermissions): add full service emulation (#3128)
* feat(verifiedpermissions): add full service emulation

* fix(verifiedpermissions): harden OIDC and schema validation

* test(verifiedpermissions): add service layer coverage

* fix(verifiedpermissions): support native Cedar runtime

* fix(verifiedpermissions): package Cedar native FFI

* fix(verifiedpermissions): register Cedar deserializers for native

* fix(verifiedpermissions): bound JWKS refreshes

* fix(verifiedpermissions): avoid Cedar entity reflection

* fix(verifiedpermissions): register Cedar native reflection

* fix(verifiedpermissions): refresh rotated OIDC keys safely

* fix(verifiedpermissions): retry failed JWKS refreshes

* refactor(verifiedpermissions): isolate Cedar in sidecar

* fix(verifiedpermissions): harden Cedar sidecar runtime

* fix(verifiedpermissions): build cedar sidecar in compatibility CI

* fix(verifiedpermissions): remove stale cedar jni config

* fix(verifiedpermissions): recover cedar sidecar

* fix(verifiedpermissions): bound OIDC document responses

* fix(verifiedpermissions): start cedar sidecar in native sdk CI
2026-09-10 22:25:50 -04:00
Franklin G. Mendoza cbfa034470 feat(identity-center): complete IAM Identity Center emulation (#3331)
* feat(ssoadmin): add region operation

* feat(ssoadmin): attach customer managed policies

* feat(ssoadmin): create applications

* feat(ssoadmin): create application assignments

* feat(ssoadmin): create account instances

* feat(ssoadmin): create ABAC configuration

* feat(ssoadmin): create trusted token issuers

* feat(ssoadmin): delete account assignments

* feat(ssoadmin): delete applications

* feat(ssoadmin): delete application access scopes

* feat(ssoadmin): delete application assignments

* feat(ssoadmin): delete application authentication methods

* feat(ssoadmin): delete application grants

* feat(ssoadmin): delete identity center instances

* feat(ssoadmin): list principal account assignments

* feat(ssoadmin): provision permission sets

* feat(ssoadmin): list provisioned permission sets

* feat(ssoadmin): list accounts for provisioned permission set

* feat(ssoadmin): describe permission set provisioning status

* feat(ssoadmin): list permission set provisioning status

* feat(ssoadmin): describe account assignment deletion status

* feat(ssoadmin): list account assignment creation status

* feat(ssoadmin): list account assignment deletion status

* feat(ssoadmin): delete permission sets

* feat(ssoadmin): detach customer managed policy references

* feat(ssoadmin): list customer managed policy references

* feat(ssoadmin): get inline permission set policies

* feat(ssoadmin): put permission set boundaries

* feat(ssoadmin): get permission set boundaries

* feat(ssoadmin): delete permission set boundaries

* feat(scim): create groups

* feat(scim): create users

* feat(scim): delete groups

* feat(scim): delete users

* feat(scim): get groups

* feat(scim): get users

* feat(scim): list groups

* feat(scim): list users

* feat(scim): get schemas

* feat(scim): list schemas

* feat(scim): list resource types

* feat(scim): add service provider config

* feat(scim): patch groups

* feat(scim): patch users

* feat(scim): put users

* feat(ssoadmin): delete ABAC configuration

* feat(ssoadmin): delete trusted token issuers

* feat(ssoadmin): describe applications

* feat(ssoadmin): describe application assignments

* feat(ssoadmin): describe instances

* feat(ssoadmin): describe ABAC configuration

* feat(ssoadmin): describe regions

* feat(ssoadmin): describe trusted token issuers

* feat(ssoadmin): describe application providers

* feat(ssoadmin): list application assignments

* feat(ssoadmin): list principal application assignments

* feat(ssoadmin): list applications

* feat(ssoadmin): list application providers

* feat(ssoadmin): list regions

* feat(ssoadmin): list trusted token issuers

* feat(ssoadmin): put application access scopes

* feat(ssoadmin): get application access scopes

* feat: support listing application access scopes

* feat(ssoadmin): get application assignment configuration

* feat(ssoadmin): put application assignment configuration

* feat(ssoadmin): get application authentication methods

* feat(ssoadmin): put application authentication methods

* feat(ssoadmin): list application authentication methods

* feat(ssoadmin): get application grants

* feat(ssoadmin): put application grants

* feat(ssoadmin): list application grants

* feat(ssoadmin): get application session configuration

* feat(ssoadmin): put application session configuration

* feat(ssoadmin): list resource tags

* feat(ssoadmin): tag resources

* feat(ssoadmin): untag resources

* feat(ssoadmin): remove regions

* feat(ssoadmin): update applications

* feat(ssoadmin): update instances

* feat(ssoadmin): update ABAC configuration

* feat(ssoadmin): update trusted token issuers

* feat(ssooidc): register clients

* feat(ssooidc): start device authorization

* feat(ssooidc): create public client tokens

* feat(ssooidc): create IAM-authenticated tokens

* feat(ssoportal): list assigned accounts

* feat(ssoportal): list assigned account roles

* feat(ssoportal): issue assigned role credentials

* feat(ssoportal): invalidate portal sessions

* docs(ssoadmin): report complete operation count

* fix(identity-center): repair CI validation

* fix(identity-center): harden auth and native build

* fix(ssooidc): disambiguate RestAssured query parameter

* fix(identity-center): resolve CI compatibility failures

* fix(identity-center): address maintainer review

* fix(ssoadmin): preserve application provider partition

* fix(identity-center): repair Java compatibility tests

* fix(identity-center): trust local TLS in browser flows

* fix(identity-center): register refresh token grant in SDK test
2026-09-10 16:34:41 -04:00
Franklin G. Mendoza 87f2c2d1a8 feat(marketplace-entitlement): emulate AWS Marketplace Entitlement API (#3340) 2026-09-10 15:26:16 -04:00
Franklin G. Mendoza c99ecea0da feat(marketplace-agreement): emulate AWS Marketplace Agreement API (#3339) 2026-09-10 13:05:23 -04:00
Franklin G. Mendoza 50fa334dc5 feat(marketplace-catalog): emulate AWS Marketplace Catalog API (#3338) 2026-09-10 10:37:04 -04:00
Kenshin Okinaka 9a2a89399a feat(firehose): convert JSON records to Parquet via the floci-duck sidecar (#3333)
* feat(firehose): convert JSON records to Parquet via the floci-duck sidecar

Deliver data-format-converting streams for real: each flushed record is
parsed and type-checked in Java against the stream's Glue table schema
(per-record ParseError/MalformedData routing with AWS's probed message
shapes), valid rows are staged as normalized NDJSON and written to the
destination as Parquet by DuckDB's COPY, and failed records go to the
evaluated ErrorOutputPrefix as AWS-shaped NDJSON error lines. Batch-level
failures (missing Glue table, unsupported schema, sidecar errors) route
every record to the error output instead of dropping them. Adds the
floci.services.firehose.staging-bucket setting and replaces the
PR-1-era unconverted-delivery warning.

* fix(firehose): deliver a scheduled flush as the stream's own account

A scheduled flush runs on the flusher thread, where no request context is
active, so the Glue lookup, the staging writes, the destination writes and
the sidecar all resolved the default account instead of the stream's owner.
A stream owned by another account had its Glue table missed and its objects
written to the wrong partition. The delivery now runs under RequestScopes,
which the CUR scheduler already uses for the same reason, so every store the
delivery touches agrees on the owner. The unconverted path gets this too.

Cleanup failures in the compatibility test are logged rather than swallowed,
per the repository rule on tolerated exceptions.

* fix(firehose): cap the staging buffer size hints

rows.size() * 128 overflows an int at about 16.7 million records, so a batch
of many small records failed before writing any of them, and short of that it
asked for a multi-gigabyte array. Both hints are computed as a long and capped
at 8 MiB; the streams grow as needed, so this only affects the first
allocation.

* docs(firehose): state what a failed error-output write actually guarantees

The comment claimed a failure of the error-output write leaves the converted
rows in the staging bucket, but the enclosing finally removes the staged object
however the method exits, and the Parquet bytes are read into memory before
either destination write, so nothing is retained to recover from. What holds is
that nothing is delivered and the flush fails as a whole, which is what it says
now, along with where recovery does live: the source, which a Kinesis-backed
stream has and a DirectPut buffer does not.

The reverse ordering is documented rather than claimed away: the two
destination writes are not atomic, so an error object can land and the Parquet
write then fail, reporting the failed records while the converted ones are
gone.
2026-09-10 10:20:02 -04:00
Franklin G. Mendoza 483dfb4e1c feat(agentcore): expand Bedrock AgentCore control-plane coverage (#3317)
* feat(agentcore): emulate CreateBrowser

* feat(agentcore): emulate GetBrowser

* feat(agentcore): emulate ListBrowsers

* feat(agentcore): emulate DeleteBrowser

* feat(agentcore): emulate CreateBrowserProfile

* feat(agentcore): emulate GetBrowserProfile

* feat(agentcore): emulate ListBrowserProfiles

* feat(agentcore): emulate DeleteBrowserProfile

* feat(agentcore): emulate CreateCodeInterpreter

* feat(agentcore): emulate GetCodeInterpreter

* feat(agentcore): emulate ListCodeInterpreters

* feat(agentcore): emulate DeleteCodeInterpreter

* feat(agentcore): emulate CreateGatewayRule

* feat(agentcore): emulate GetGatewayRule

* feat(agentcore): emulate ListGatewayRules

* feat(agentcore): emulate UpdateGatewayRule

* feat(agentcore): emulate DeleteGatewayRule

* feat(agentcore): emulate CreateApiKeyCredentialProvider

* feat(agentcore): emulate GetApiKeyCredentialProvider

* feat(agentcore): emulate ListApiKeyCredentialProviders

* feat(agentcore): emulate UpdateApiKeyCredentialProvider

* feat(agentcore): emulate DeleteApiKeyCredentialProvider

* feat(agentcore): emulate CreateOauth2CredentialProvider

* feat(agentcore): emulate GetOauth2CredentialProvider

* feat(agentcore): emulate ListOauth2CredentialProviders

* feat(agentcore): emulate UpdateOauth2CredentialProvider

* feat(agentcore): emulate DeleteOauth2CredentialProvider

* feat(agentcore): emulate GetResourcePolicy

* feat(agentcore): emulate PutResourcePolicy

* feat(agentcore): emulate DeleteResourcePolicy

* docs(agentcore): update expanded coverage

* fix(agentcore): align expanded control-plane contracts

* fix(agentcore): address PR review findings

* test(agentcore): cover persistent delete replay
2026-09-10 00:00:51 -05:00
Matheus André 283890dce9 feat(stepfunctions): add SNS Publish service integration (#3316) 2026-09-09 23:49:27 -05:00
Matheus André abfa8e949e fix(iam): report the real default version of AWS-managed policies (#3275)
Signed-off-by: Matheus André <matheusandr2@gmail.com>
2026-09-09 22:55:17 -05:00
Mario Toffia 460aa0718e feat(cloudwatch): provision AWS::CloudWatch::Dashboard (#3231)
* feat(cloudwatch): provision AWS::CloudWatch::Dashboard

The dashboard name is the physical id, generated when the template gives none
and kept across updates. An update with the same name puts the body again and
drives the tags to the template's set, since PutDashboard leaves an existing
dashboard's tags alone. A changed name creates the new dashboard and leaves
the displaced one to the ReplacementCleanup record, which deletes it once the
update commits or restores it on rollback. The body may be written as a JSON
object in the template and is stored as the string the API takes.

The CloudWatch docs now list the dashboard and tag actions the handlers
already serve.

* fix(cloudwatch): roll back in-place dashboard updates and replace a dashboard whose explicit name is dropped

An in-place update keeps the body and tags it replaces on the resource, or
the fact that the dashboard did not exist, and a failed stack update puts
them back in full. The name mode is recorded as the Logs provisioner does, so
a template that drops an explicit DashboardName gets a generated name and a
replacement, as on AWS, while an unnamed dashboard keeps its generated name.
The Tags list is checked against the schema's cap of 50 on every provision,
since the tag operations an update reconciles through do not enforce it. The
integration test reads stack events with XmlParser.

* fix(cloudwatch): keep the dashboard rollback snapshot until the restore succeeds

A restore that throws left no snapshot behind, so the next rollback attempt
reported success without restoring anything. The snapshot is now spent only
after the body and tags are back.

* fix(cloudwatch): unwind a dashboard update that failed after it changed the body

An in-place update puts the body and then reconciles the tags. When the tag
calls failed, the exception left the dashboard carrying the new body while
CloudFormationService put the resource the stack held before the attempt back
in its place. That object never carried the snapshot taken by the attempt, so
the walker marked it restored and skipped rollbackUpdate: the stack reported a
completed rollback over a dashboard that still had the update's body, or a half
reconciled set of tags.

The mutating calls now unwind themselves through rollbackUpdate, the way
IotDomainConfigurationCfnProvisioner unwinds a replacement, and report the
resource restored. An unwind that cannot put the body back keeps the snapshot
and records the failure on the resource, so the stack ends in
UPDATE_ROLLBACK_FAILED rather than claiming the prior dashboard is intact, and
the original failure is still what the stack reports.

Tests: anInPlaceUpdateThatFailedOnItsTagsPutsTheBodyBack,
anUnwoundInPlaceUpdateIsMarkedRestored,
anUnwindThatCannotRestoreIsReportedAsARollbackFailure.

* fix(cloudwatch): record a dashboard unwind failure before joining it to the update failure

The unwind repeats the tag call the update just made, so a service that
keeps failing hands the unwind the very exception that interrupted the
update. Throwable.addSuppressed rejects a throwable suppressed under
itself, and that IllegalArgumentException escaped the unwind before the
rollback failure was recorded: the dispatcher reported "Self-suppression
not permitted" as the resource failure, no failure attribute reached the
stored resource, and the stack ended UPDATE_ROLLBACK_COMPLETE over a
dashboard whose tags were never put back.

The failure attribute is now written first and the two exceptions are
joined only when they differ, as PipesCfnProvisioner does. Two stack-level
tests drive the whole path through CloudFormationService with a spied
CloudWatchDashboardsService, the way CloudFormationPipesCleanupIntegrationTest
does: a one-off tag failure ends in UPDATE_ROLLBACK_COMPLETE with the prior
body and tags live, a persistent one in UPDATE_ROLLBACK_FAILED naming the
dashboard and carrying the unwind's reason.

Tests: anUnwindThatFailsWithTheUpdatesOwnExceptionIsStillRecorded,
anUpdateThatFailedOnItsTagsPutsTheDashboardBackAndTheStackRollsBackCleanly,
aFailedRestoreLeavesTheStackInUpdateRollbackFailedNamingTheDashboard.
2026-09-09 22:37:45 -05:00
Matan Baruch 6eca8540a8 feat(aps): implement AMP rule groups namespaces (#3330)
* feat(aps): implement AMP rule groups namespaces

Closes #3329

* fix(aps): validate rule groups namespace names and tag ARN scope
2026-09-09 22:22:26 -05:00
Matheus André 2d5a8f705b fix(amazonmq): add configuration for AMQP and console host port ranges (#3315)
Signed-off-by: Matheus André <matheusandr2@gmail.com>
2026-09-09 22:23:07 -04:00
Matheus André 8180d4b3b8 feat(acm): enhance email validation to report approval mailboxes and omit DNS records (#3290) 2026-09-09 22:03:21 -04:00
Allen Sanborn cf1aabce39 feat(ec2): back each VPC with a real Docker network in RFC 1918 space (#3272)
* feat(ec2): back each VPC with a real Docker network in RFC 1918 space

An instance's private IP was a plausible-looking number nothing could
connect to. Every VPC now gets its own Docker network, created lazily on
the first launch into it, with the VPC CIDR as the network's IPAM pool
and each subnet allocating static addresses from its own slice. The
address Floci reports is one the container actually holds, and instances
in different VPCs sit on different bridges.

One network per VPC, not per subnet: subnets inside a VPC route to each
other in AWS, so a network per subnet would manufacture a partition AWS
does not have and break the two-tier app/database topologies this corpus
is full of.

The declared CIDR is used verbatim wherever it can be. It cannot be when
it is absent, malformed, outside RFC 1918, or already claimed on the
Docker daemon, which includes another Floci VPC: two VPCs may legally
declare the same CIDR in AWS but one daemon cannot route two identical
ranges. Only then is an equivalent block drawn from the configured
fallback pool, and the substitution is logged at WARN. A reported private
IP that does not mean what the caller declared is either true or it is in
the log.

Leases are given back on every exit: a launch that never attaches, a
launch that fails, and terminate. Detach precedes release, because Docker
holds the address while the endpoint stands and would refuse the next
launch handed the same one. Startup reconciles this emulator's own
orphaned networks first (scoped by API port, so instances sharing a
daemon never touch each other's), then re-declares the plan from
persisted VPCs and subnets and re-reserves the addresses restored
instances still hold.

Between-VPC isolation is the Docker daemon's, not Floci's, and OrbStack
does not enforce it. On such a host the VPC boundary is an addressing
boundary only. docs/services/ec2.md says so.

Off with FLOCI_SERVICES_EC2_VPC_NETWORKS_ENABLED=false, and off whenever
ec2 mock is on.

* fix(ec2): do not adopt a leftover VPC network that routes another range

materialise() treated any network under the VPC's own name as its own: a
successful inspect set created=true and returned. A network left by a
previous run that declared a different CIDR was therefore adopted, after
which addresses were handed out of vpc.effective while the bridge routed
something else entirely.

Compare the leftover's IPAM subnet to vpc.effective. A match is adopted as
before. A mismatch is removed and recreated on the planned range rather
than re-planned onto the leftover's subnet: by the time materialise runs,
addresses have already been allocated from vpc.effective, and after a
restart some are leases held by live containers, so the plan cannot move
under them. The network name carries this emulator's own port and region,
so recreating it cannot destroy a user's network. If the removal fails the
instance stays on the shared bridge, which is a documented degradation,
instead of holding an address nothing routes.

Also make small blocks work or refuse out loud. FIRST_HOST_OFFSET was a
flat 10, so a /29 (eight addresses) and a /30 (four) allocated nothing at
all and said nothing about it, and fallback-prefix-length had no upper
bound to stop a /30 being configured. The offset now scales down to 2 for
blocks that cannot spare ten addresses, a block with no room for a host is
refused at plan time with a WARN, and the fallback prefix is clamped into
the range that can serve hosts.

* fix(ec2): keep the IMDS source address current across start and restore

Ec2MetadataServer resolves an instance from the source address of the
request, and a container's default route is the bridge, so a VPC-attached
instance's metadata requests arrive from its bridge address rather than
from the VPC address Floci reports. launch() registered both. start() and
restoreMetadataRegistration() registered only the address
getContainerBridgeIp returns, which for a VPC-attached container is the
VPC address: neither refreshed imdsSourceIp nor registered the bridge.

Docker hands out a fresh bridge address when a stopped container starts
again, and an emulator restart rebuilds the registration map empty, so
after either the instance's IMDS requests arrived from an address nothing
knew about, while the address from the previous run stayed registered.

Both paths now unregister the stale source address and register the
current one. A bridge-only instance is unaffected: its reported address
and its bridge address are the same, so there is no second registration.

* fix(ec2): keep the IMDS source registration when inspect fails

bridgeNetworkIp swallowed every inspect failure and returned null, the same
answer it gives for a container that genuinely has no bridge address.
refreshImdsSourceRegistration acts on that null by unregistering the instance's
recorded IMDS source address, so one transient Docker hiccup permanently dropped
a healthy instance's registration and put nothing in its place: its metadata
requests stopped resolving until some later start or restore happened to
succeed.

Split the two answers apart. bridgeNetworkIp now lets the exception propagate,
so null means only "no bridge address"; refreshImdsSourceRegistration catches it
and returns early, leaving the existing registration exactly as it was.

* docs(ec2): drop the em dashes this branch added

AGENTS.md forbids em dashes in all content. The enforcing check runs with
--diff-filter=A, so it only scans files a PR adds and stayed green on these, but a
check that cannot see a violation is not a licence for it. Six of them are in lines
this branch adds: four in docs/services/ec2.md, one in an Ec2ContainerManager javadoc,
one in an Instance javadoc.

Replaced with colons and commas. Wording is otherwise unchanged, and the em dashes
already present in these files are left alone: they predate this branch, and
rewriting them here would bury the actual change in unrelated churn.
2026-09-09 18:12:40 -05:00
Olamide Kosile b988dc5d1a feat(athena): support ListTagsForResource for workgroups (#3242)
* feat(athena): support ListTagsForResource for workgroups

Fixes #2791. terraform-provider-aws's read/refresh for aws_athena_workgroup
calls ListTagsForResource unconditionally, even when no tags are set,
and floci's Athena handler had no support for the action:

  Error: listing tags for Athena WorkGroup ...: InvalidAction: Action
  ListTagsForResource is not supported

Parses the workgroup name out of the ResourceARN (using the existing
AwsArnUtils helper) and returns the tags already captured on
CreateWorkGroup. The primary workgroup always answers with an empty
list, matching a live account, since CreateWorkGroup already rejects
"primary" and it can never carry real tags. An ARN for an unsupported
resource type, or naming a workgroup that doesn't exist, faults with
InvalidRequestException like the rest of this handler's not-found cases.

* docs(athena): sync the supported-actions table for ListTagsForResource

* fix(athena): reject ListTagsForResource ARNs naming a different service

pgermosen (review): listTagsForResource only checked that the ARN's
resource path started with workgroup/, never the service, so an ARN
naming a completely different service with a coincidentally matching
region and workgroup name resolved instead of being rejected the way
real AWS rejects a ResourceARN naming the wrong service.

Adds the explicit arn.service() == "athena" check, plus a RestAssured
test proving a workgroup-shaped ARN under a different service is
rejected even when a same-named workgroup genuinely exists. Verified by
disabling the check and confirming the new test fails with the exact
expected 400-vs-200 mismatch before restoring it.

Also adds an SDK-client test (AthenaTest, compat suite) round-tripping
ListTagsForResource through the real AthenaClient, per review request to
validate request/response shapes the way other management API PRs do.
2026-09-09 16:27:02 -04:00
fracermaandPriamo Germosen d466ffe099 fix(s3): preserve SSE-KMS key ID metadata (#2145)
* fix(s3): preserve SSE-KMS key ID metadata

* fix(s3): validate and copy SSE-KMS key metadata

* fix(s3): return SSE headers on CopyObject and UploadPartCopy responses

Both handleCopyObject and handleUploadPartCopy stored the destination's
server-side-encryption settings correctly but never echoed
x-amz-server-side-encryption / x-amz-server-side-encryption-aws-kms-key-id
on their own response — only a follow-up GET/HEAD on the copy revealed it,
which is why the existing SSE tests (checking only via HEAD) never caught
this. Real S3 returns both headers on CopyObjectResult and CopyPartResult.

UploadPartCopy required threading the KMS key id through
CreateMultipartUpload too: MultipartUpload had no field for it, so a part's
destination upload had nowhere to read it back from.

* fix(s3): drop em dashes from merged UploadPartCopy comments

AGENTS.md rules out em dashes anywhere in content. The two comments moved
during the origin/main downmerge (handleUploadPartCopy's SSE-settings note
and the relocated uploadPartCopyPreservesDestinationServerSideEncryption
test) carried one each. Reworded to a period and a comma respectively.

---------

Co-authored-by: Priamo Germosen <6233424+pgermosen@users.noreply.github.com>
2026-09-09 16:03:24 -04:00
Allen Sanborn 83b010e6c3 docs(lambda,s3): mark two leniencies as Floci's call, not observed AWS (#3270)
* docs(lambda,s3): mark two leniencies as Floci's call, not observed AWS

Both lines read as parity claims for behaviour nobody probed against
AWS, which is the failure mode of keeping measured and inferred apart:
a later reader can cite either one as a probed result.

lambda.md: accepting ApplicationLogLevel and SystemLogLevel alongside
LogFormat=Text is justified in the text by Floci's own response shape,
which never surfaces those levels for Text. Request behaviour and
response behaviour are both our choice, so say so.

s3.md: log-delivery-write really does match AWS on PutBucketAcl, but
AWS documents that canned ACL as bucket-only and the SDK's
ObjectCannedACL enum omits it, so accepting it on PutObjectAcl is a
Floci leniency rather than parity. Both paths share one canned-ACL
helper, which is also why aws-exec-read, an object-only canned ACL in
the SDK model, is accepted on buckets. Name that mirror-image case so
the next reader sees the pattern instead of filing it again.

No behaviour change: both entries describe code that stays as it is.

* docs(s3): attribute the aws-exec-read narrowing to the SDK model, not to AWS

The sentence said aws-exec-read is one "which AWS lists only for objects". That is
the same mistake this PR exists to correct, made inside the correction: AWS's canned
ACL reference lists it under "Bucket and object". What is narrower is botocore's
BucketCannedACL enum, which omits it while ObjectCannedACL includes it, so the
client-side validation on PutBucketAcl is an SDK artefact rather than documented AWS
behaviour.

Verified against the shipped model: BucketCannedACL is private, public-read,
public-read-write, authenticated-read; ObjectCannedACL adds aws-exec-read,
bucket-owner-read and bucket-owner-full-control.

The log-delivery-write half of the sentence was accurate and is unchanged.
2026-09-09 15:21:04 -04:00
Niels Kootstra 35159c5aaa fix(stepfunctions): persist execution history across restarts (#3291)
* fix(stepfunctions): persist execution history across restarts

* fix(stepfunctions): preserve persisted execution history

* fix(stepfunctions): preserve running execution snapshot during restart test

Keep the in-flight worker alive until the persisted snapshot is reloaded, then
wait for cleanup so the test cannot rewrite or retain its temporary state.

* fix(stepfunctions): checkpoint persisted execution history
2026-09-09 10:27:19 -04:00
Hector Ventura 895adce214 fix(cloudformation): provision CloudFront policies and origin access controls (#3228)
* fix(cloudformation): provision CloudFront policies and origin access controls

AWS::CloudFront::ResponseHeadersPolicy, CachePolicy, OriginRequestPolicy
and OriginAccessControl had no provisioner, so the dispatcher's stub arm
reported CREATE_COMPLETE with a synthetic id and a distribution that
referenced it failed with "The specified response headers policy does not
exist."

A new CloudFrontCfnProvisioner creates each type through CloudFrontService:
the physical id is the service id, Fn::GetAtt exposes Id and LastModifiedTime
(Id only for the origin access control, per the registry schemas), updates go
through the service's etag-guarded update, and deletes tolerate only the
type's own not-found code so an in-use policy fails the stack delete as on
AWS. The response headers configuration is reshaped into the flattened form
the service's codec stores through the new
ResponseHeadersPolicyConfigCodec.fromItemsTree.

Closes #2441

* fix(cloudfront): reject deleting a cache or origin request policy in use

DeleteCachePolicy declares CachePolicyInUse and DeleteOriginRequestPolicy
declares OriginRequestPolicyInUse, both 409 sender faults, and both are
documented as refusing the delete while the policy is attached to a cache
behavior. Floci checked only two of the four policy-shaped types:
deleteResponseHeadersPolicy and deleteOriginAccessControl raised their in-use
errors, while these two deleted unconditionally once the etag matched. A policy
still referenced by a distribution could be removed, leaving that distribution
pointing at something that no longer existed.

Both now raise the modeled error after the etag check, matching the ordering the
other two deletes already use. Cache, origin request and response headers
policies all hang off the same two places, a distribution's default cache
behavior and its ordered ones, so the three near-identical scans collapse into
one helper that differs only in which id it reads. The per-distribution
association count keeps its own entry point, since it asks about one config at a
time and can be handed a distribution with none.

Found while reviewing the CloudFormation provisioner in this PR, which was
already written for this: its delete tolerates only NoSuch<Type>, so it fails
the stack correctly now that the service raises the in-use error. The
CloudFormation integration test covers that end to end: it attaches both
policies to a distribution and still deletes the stack cleanly, because
CloudFormation removes the distribution before the policies it references.

Four tests: a cache policy attached to a default behavior and to an ordered one,
an origin request policy in use, and an unattached policy still deleting.

* test(cloudformation): parse stack outputs with XmlParser

The CloudFront policies integration test pulled Outputs out of the DescribeStacks
response with two regular expressions over <member> and <OutputValue> blocks.
XmlParser.extractPairs already does exactly this, and seventeen sibling
CloudFormation integration tests define the same one-line helper over it, so the
twelve-line version was reinventing a shared utility. It also matches the repo's
rule against parsing XML with regex.

Behaviour is unchanged, including the failure message that names the missing key.

* fix(cloudformation): roll back a recreated CloudFront policy on a failed update

When an update finds the prior policy or origin access control already deleted
out of band, the provisioner recreates it under a new physical id. If a later
resource then failed the stack update, the rollback left that new object behind:
the engine only deletes resources the update ADDED, inside the previous == null
branch of rollbackUpdatedResources, so an existing resource that merely acquired
a new physical id fell through to the "Rollback is not implemented" arm, which
deletes nothing.

ReplacementCleanup already models exactly this, and CognitoCfnProvisioner wires
it for the same situation, so the provisioner records the displaced entity after
each provision and delegates the cleanup hooks and rollbackUpdate to it. A
rollback now names the prior id again with the attributes it carried and deletes
the object the failed update created.

The physical id changes here only when the prior object was already gone, since
prior() returns the entity whenever the service still knows it, so the recorded
displaced entity is always one that no longer exists and its cleanup delete is a
no-op tolerated by the type's not-found code. The hooks are still needed, or a
recorded entity would stay owed a delete forever.

An in-place update keeps its physical id, so nothing is recorded and
rollbackUpdate answers false: putting a committed in-place change back needs a
configuration snapshot this provisioner does not keep, the same limitation
AWS::Cognito::UserPool has. A test pins that so it stays a decision.

Raised by the review on this PR. My first reply argued the finding did not hold,
generalising from the create path; that was wrong for this one, and the
correction is on the thread.
2026-09-09 09:32:52 -04:00
Mario Toffia c4027bbf54 feat(iot): MQTT over WebSocket at /mqtt (#3150)
* test(iot): MQTT over WebSocket at /mqtt, failing

* feat(http): echo MQTT WebSocket subprotocols

* feat(iot): MQTT over WebSocket at /mqtt

Bridges a WebSocket upgrade on /mqtt (HTTP and HTTPS) onto the broker's
plaintext listener, so wss://host:443/mqtt works on the 443:4566 mapping
with the same certificate as HTTPS and no extra listener or config.

* docs(iot): MQTT over WebSocket at /mqtt

* feat(iot): do not queue the /mqtt handshake behind ordered blocking tasks

* fix(iot): forward only binary WebSocket frames to the broker

One frame handler decides per frame: text closes with 1003, binary and
continuation frames are written to the broker socket, control frames are
left to Vert.x. Nothing else reads the frames, so a text payload can never
reach the MQTT stream.

* test(iot): AWS contract and framing tests for MQTT over WebSocket

Handshake: only GET upgrades (405), unsupported version is 426, each MQTT
subprotocol name is echoed and the first supported offer wins, ping gets
pong, non-upgrade requests fall through. Framing (MQTT 3.1.1 section 6):
a CONNECT split across two frames, two packets in one frame, garbage
bytes and a frame over the transport limit. Session semantics as on AWS:
MQTT 5 over wss, client id takeover across transports, retained messages,
QoS 2 disconnects, shadow topics, topic rules, keep-alive pings and the
IoT Data connection APIs on a WebSocket session.

* test(iot): log the tolerated exceptions in the WebSocket contract tests

* test(iot): pin the MQTT TLS port and the unrelated-subprotocol handshake

The profile pins floci.services.iot.mqtt.tls-port now that #3142 opens 8883
whenever TLS is on. A client offering only graphql-ws on an API Gateway
WebSocket path still connects, with no subprotocol echoed: the server-wide
MQTT list does not affect other WebSocket routes.

* test(iot): pin the deployment claims of MQTT over WebSocket

Every claim the docs and comments make now has a test that fails without
the behaviour: ws and wss share one port through TlsProxyServer (the
443:4566 path), a hostname learned by ensureHost serves /mqtt to a client
verifying that name, the first upgrade starts a lazy broker (also eight at
once, and again after a stop), a text frame or an abrupt TCP drop after a
live CONNECT frees the broker session, 30 connect and disconnect cycles
leave nothing behind, and the burst is 1000 messages.

* test(iot): force-close the Paho client the broker stop left behind

* test(iot): wait for the dropped session before closing the Paho client
2026-09-09 01:10:29 -05:00
lex00 64538f7d32 feat(iam): resolve resource and request tag condition keys for EC2 and S3 (#3212)
* feat(iam): resolve resource and request tag condition keys for EC2 and S3 bucket actions

A policy scoped through aws:ResourceTag or aws:RequestTag never matched
because neither key was placed in the request context. The resolver now
reads aws:RequestTag from the tags named in RunInstances, CreateTags and
PutBucketTagging, and aws:ResourceTag from the target's current tags for
the EC2 tag and instance actions and the S3 bucket tagging and delete
actions. EC2 and S3 are reached through Instance, as DynamoDB already is.

Ported from lex00/floci#135.

* fix(iam): authorize every target of a multi-resource EC2 request

The resource tag context came from the first ResourceId or InstanceId
only, so a caller could name a permitted resource first and act on
later ones the policy did not allow. The resolver now yields one
context per further target and the filter evaluates each of them,
denying the request when any target fails. An untagged target gets an
empty context so a tag condition fails on it.

* fix(iam): read a repeated numbered parameter the way the EC2 handler does

A Query request can repeat ResourceId.1 or InstanceId.1. The resolver
kept the last value while the handler acts on the first, so the
authorized resource and the acted-on resource could differ. The form
parameters now keep the first value, and the remaining-targets pass
starts only when member 1 is present, so both readers stop at the same
numbering gap.
2026-09-09 00:57:40 -05:00
lex00 5b7c2c4a62 feat(cloudwatch): store and serve metric stream definitions (#3214)
* feat(cloudwatch): store and serve metric stream definitions

PutMetricStream, GetMetricStream, ListMetricStreams, DeleteMetricStream,
StartMetricStreams and StopMetricStreams work over Query and JSON. A
stream is a definition with a running or stopped state, and nothing is
delivered to the Firehose delivery stream it names. The service lives in
its own metricstreams package next to dashboards and is injected into
both handlers, and the tag operations route a metric-stream ARN to it.

Ported from lex00/floci#42.

* fix(cloudwatch): validate nested metric stream members, page ListMetricStreams, keep batches atomic

StartMetricStreams and StopMetricStreams resolve every requested name
before changing any, so a batch naming a missing stream fails as a
whole. PutMetricStream now checks the nested members: a filter needs a
Namespace, an IncludeMetrics entry needs a Namespace and a MetricName,
and a statistics configuration needs non-empty IncludeMetrics and
AdditionalStatistics. ListMetricStreams pages through the shared
Pagination helper with MaxResults and NextToken over both protocols.

* fix(cloudwatch): answer an unknown name on StartMetricStreams and StopMetricStreams with InvalidParameterValue

The model declares ResourceNotFoundException on GetMetricStream alone.
Start and Stop declare InvalidParameterValue, so an unknown name in the
batch answers that, still after resolving every name before any change.
2026-09-09 00:57:17 -05:00
Matheus André f77cf4da77 fix(ec2,ssm): explain missing IMDS registration for SSM-only managed instances (#3283) 2026-09-09 00:26:30 -05:00
Sam Fakhreddine f30ba77ac0 fix(ec2): answer DescribeTransitGatewayConnects with an empty list (#3274)
* fix(ec2): answer DescribeTransitGatewayConnects with an empty list

LZA's tgw-associations-and-propagations module calls this unconditionally
alongside DescribeTransitGatewayVpcAttachments. floci does not yet support
creating Connect attachments, so the action was entirely unhandled and the
module failed with "Operation DescribeTransitGatewayConnects is not
supported", found while running LZA phase2 against parent 1176.

Since floci has no Connect attachments to return, an empty list is the
wire-faithful answer for every account. Requested attachment ids still
validate against the shared tgw-attach- id namespace: malformed ids reuse
the existing InvalidTransitGatewayAttachmentID.Malformed check, well-formed
but unknown ids get InvalidTransitGatewayConnectID.NotFound.

* test(ec2): cover DescribeTransitGatewayConnects over the Query protocol and make the service hook void

The service method only validates the request; the handler always renders
an empty transitGatewayConnectSet, so returning a List of VPC attachments
suggested a resource type it never produces. It is void now. Two
integration tests drive the action through the EC2 Query dispatch and pin
the response wire shape (EC2 namespace, requestId, empty
transitGatewayConnectSet) and the Malformed / Connect NotFound error codes.
2026-09-09 00:20:28 -05:00
Franklin G. Mendoza d322d48bd5 fix(ram): emulate organization sharing side effects (#3279)
* fix: emulate RAM organization sharing side effects

* test(ram): add SDK organization sharing coverage
2026-09-08 22:30:08 -05:00
Franklin G. Mendoza 9d4e71f8a2 feat(securityhub): add organization configuration operations (#3161)
* feat(securityhub): add organization configuration operations

* fix(securityhub): complete organization configuration contracts

* fix(securityhub): harden organization contracts

* test(securityhub): log tolerated organization state

* test(securityhub): clean organization fixture state

* test(securityhub): isolate organization cleanup failures

* fix(securityhub): return modeled invalid access error
2026-09-08 19:40:01 -05:00
Sam Fakhreddine fd3c4d9ab6 feat(cloudtrail): support AdvancedEventSelectors and CloudFormation Trail provisioning (#2720)
* feat(cloudtrail): support AdvancedEventSelectors in PutEventSelectors and S3 capture

Adds AdvancedEventSelector/AdvancedFieldSelector models, JSON wiring
through PutEventSelectors/GetEventSelectors, mutual-exclusivity
enforcement against basic EventSelectors, and field-selector evaluation
(Equals/NotEquals/StartsWith/NotStartsWith/EndsWith/NotEndsWith) in the
S3 data-event capture path. Lets a trail exclude its own log-delivery
bucket via resources.ARN NotStartsWith, avoiding the CloudTrail
circular-logging cost problem. Basic-selector behavior is unchanged.

* feat(cloudtrail): add CloudFormation provisioner for AWS::CloudTrail::Trail

Handles create/update/delete of AWS::CloudTrail::Trail via
CloudTrailService, applies EventSelectors or AdvancedEventSelectors
(mutually exclusive, same JSON shapes as PutEventSelectors), starts
logging when IsLogging is true, and sets the trail ARN as the
resource's physical id and Arn attribute. Delete is idempotent when
the trail is already gone.

* feat(cloudtrail): implement ListTrails and trail tagging

Adds ListTrails (returns Name/TrailARN/HomeRegion for trails visible
in the region, including multi-region trails), plus AddTags/ListTags
backed by per-trail stored state, keyed by trail name or ARN.

* fix(cloudtrail): emit data events for the trail's own log deliveries

CloudTrailLogWriter.flushTrail() wrote delivered log files via a direct
S3Service.putObject() call, bypassing S3Controller.emitCloudTrailEvent()
- the only place that recorded an S3 data event. A trail whose selector
matched its own destination bucket (the exact circular-logging config
from upstream issue #1192 / PR #1194) never saw its own deliveries,
so the emulator could prove the dangerous config was live but not
reproduce the loop it causes.

flushTrail now calls cloudTrailService.emitS3DataEvent() after each
delivery, so internal writes are evaluated against selectors identically
to API-driven ones. Closes issues/0034.

* docs: mark issue 0034 fixed

* fix(cloudtrail): resources.type reflects actual S3 resource, not hardcoded object

Advanced selector matching hardcoded resources.type to AWS::S3::Object for
every event, so an object-scoped AdvancedEventSelectors exclusion (the
real-world fix for the issue 0034 self-delivery loop) still let bucket-level
calls like ListObjects through against the excluded bucket. Now derived per
event from whether an object key is present.

Live-verified on 1160-ct: loop confirmed unbounded and compounding with
external writes, then confirmed stopped by the real AdvancedEventSelectors
remediation, with this gap found and closed in the same pass. Details in
issues/0034 and issues/0035.

* docs(0034): add raw delivery-size timeline from 1160-ct verification

Per-cycle size data showing the burst-compounding and the fix-stop point
concretely, not just summarized.

* fix(cloudtrail): match delete() to current CfnResourceProvisioner signature

Upstream/main dropped the accountId parameter from
CfnResourceProvisioner.delete() since this branch was originally
authored; the provisioner never used accountId in its body, so the
fix is a straight signature match with no behavior change.

* docs(cloudtrail): regen action table and register CFN Trail resource type

New ListTrails/AddTags/ListTags actions and the CloudFormation
AWS::CloudTrail::Trail resource type need doc entries per the repo's
docs-check gate.

* fix(cloudtrail): enforce AddTags 200-tag list limit

Botocore's AddTagsRequest.TagsList models a 200-item max (service-2.json,
cloudtrail 2013-11-01); the handler accepted an unbounded list. RED test
added first (addTagsRejectsMoreThanTwoHundredTags), confirmed failing
(200 instead of 400), then fixed by rejecting oversized lists with
TagsLimitExceededException, matching AWS's modeled error for AddTags.

* fix(cloudformation): close two audit-control gaps in CloudTrailCfnProvisioner

Local code review flagged two HIGH findings in the new CFN provisioner:

- physicalId was only set after selector validation and startLogging
  succeeded, so a create that failed on the mutually-exclusive
  EventSelectors/AdvancedEventSelectors check left a real trail with no
  recorded physical id for the engine to clean up. Now set immediately
  after createTrail returns.
- update only called startLogging when IsLogging was explicitly true,
  never stopLogging when it was explicitly false, so a template setting
  IsLogging: false on a currently-logging trail silently left logging
  enabled.

RED tests confirmed both failures against the pre-fix code, then GREEN
after the fix (6/6 provisioner tests, 51/51 CloudTrail suite).

* docs(issues): ledger deferred CloudTrail local-review findings

MEDIUM/LOW findings from the local code-review pass, plus a few
inherited-not-ours items on code this branch didn't touch, that are
real but out of scope for the CFN provisioner / advanced-selectors PR.

* style(cloudtrail): brace unbraced conditionals in ListTrails and event-matching traversal

Per AGENTS.md style rule (always use braces in conditionals).

* fix(cloudtrail): avoid NPE on List.of(trailName) when TrailName is missing

PutEventSelectors/GetEventSelectors called List.of(trailName) with a
possibly-null trailName before findTrailOrThrow could validate it,
throwing an NPE (500 InternalFailure) instead of the modeled
TrailNotFoundException. Guard the lookup so the null flows through to
the existing validation.

* fix(cloudtrail): do not re-queue records on self-delivery emission failure

flushTrail wrapped the self-delivery emitS3DataEvent call in the same
try/catch as the S3 write. A failure there re-queued records that were
already durably written, causing the next flush to redeliver the same
batch. Split the write and the emission into separate try blocks so
only a write failure triggers requeue.

* docs(cloudformation): register AWS::CloudTrail::Trail in the resource-type inventory

CfnResourceInventoryTest and the docs-sync resource-type table both
derived from supported-resource-types.tsv, which never picked up
CloudTrailCfnProvisioner's registration.

* docs(issues): drop fork-local ledger files from the PR

Per maintainer review, the issues/ ledger entries are fork-local tracking notes and are kept out of the upstream contribution.

* fix(cloudformation): wire CloudTrailCfnProvisioner into CfnProvisionerFixture

CfnProvisionerFixtureTest.everyProvisionerIsReachableThroughThePublicBuilderOrExplicitlyExempt
failed because CloudTrailCfnProvisioner had no field, setter, or
construction arm in the test fixture, so a test naming CloudTrailService
would silently fall through to the stub arm instead of exercising the
real provisioner.

Add cloudTrailService field, cloudTrail(CloudTrailService) setter, and
the discovered.add(new CloudTrailCfnProvisioner(...)) construction arm,
mirroring the existing Route53Service wiring.

* fix(cloudtrail): drop em-dashes from new test comments per AGENTS.md style check

* fix(cloudtrail): reject mixed basic and advanced selectors with InvalidEventSelectorsException

PutEventSelectors does not model InvalidParameterCombinationException; the
error it declares for an invalid selector combination is
InvalidEventSelectorsException (botocore cloudtrail/2013-11-01). Both the
JSON handler and the AWS::CloudTrail::Trail provisioner now throw that
code, and the integration test pins it. Also braces the remaining
one-line conditionals in matchesAdvancedFieldSelector.
2026-09-08 19:38:13 -05:00
Kenshin Okinaka 8a122d2b8c feat(firehose): validate and persist DataFormatConversionConfiguration (#3236)
* feat(firehose): validate and persist DataFormatConversionConfiguration

Accept, validate, store, and echo the extended S3 destination's
DataFormatConversionConfiguration instead of silently ignoring it.
Validation messages and precedence follow probed AWS behavior: Smithy
ParquetSerDe bounds first, then compression, buffering floor, and
member checks in AWS order, identical on CreateDeliveryStream and
UpdateDestination, which now merges the configuration member-wise and
validates the merged effective state. OrcSerDe is rejected as a
documented deviation (the planned DuckDB engine cannot write ORC).
Conversion itself is not applied yet: delivery logs a warning and
ships records unconverted.

* docs(firehose): match the conversion helpers' wording to what they do

The legacy-shape helper clears DataFormatConversionConfiguration alone, not
every extended-only member, and the create/update warning fires on each call
that leaves conversion enabled rather than once. Rename the first and reword
both so the contract a reader infers is the one the code keeps.
2026-09-08 09:01:31 -04:00
Mario Toffia af42564cb3 feat(lambda): provision AWS::Lambda::EventInvokeConfig (#3230)
* feat(lambda): provision AWS::Lambda::EventInvokeConfig

The physical id is the registry schema's composite FunctionName|Qualifier
identifier. A create puts the configuration, an update with the same identity
applies the template's settings through the merge-style update call, and a
changed function or qualifier is a replacement whose displaced configuration
the ReplacementCleanup record deletes once the update commits or restores on
rollback. The schema's MaximumRetryAttempts and MaximumEventAgeInSeconds
bounds are checked before any call, as CloudFormation validates them before
the handler runs.

The Lambda docs now list the five event invoke config operations, which the
page wrongly called not implemented, and say that asynchronous invocations do
not yet apply the settings.

* fix(lambda): update the event invoke config in place for equivalent names and roll back in-place changes

A short name and the function's ARN address one configuration, so an update
that changes between them updates in place under the prior physical id
instead of recording a replacement whose cleanup would delete that one
configuration. An in-place update keeps the settings it replaces on the
resource, and a failed stack update puts them back in full. DestinationConfig
is resolved before it is looked at, so a conditional that resolves to
AWS::NoValue is omitted rather than sent as an empty destination set. The
integration test reads stack events with XmlParser.

* fix(lambda): keep the event invoke config rollback snapshot until the restore succeeds

A restore that throws left no snapshot behind, so the next rollback attempt
reported success without restoring anything. The snapshot is now spent only
after the settings are back.
2026-09-08 07:34:52 -04:00
Franklin G. Mendoza 4944764fa3 feat(inspector2): add organization configuration operations (#3162)
* feat(inspector2): add organization configuration operations

* fix(inspector2): complete organization contracts

* fix(inspector2): scope organization account state

* test(inspector2): log tolerated organization state

* test(inspector2): isolate organization cleanup
2026-09-07 22:54:52 -05:00
TATSUNO “Taz” Yasuhiro cbec02df04 feat(dynamodb): import tables from S3 and report new exports as IN_PROGRESS (#3138)
* feat(dynamodb): import tables from S3 and report new exports as IN_PROGRESS

ExportTableToPointInTime handed its worker the same description object it
returned, so a small export could already read COMPLETED in the initial
response. The worker now mutates a copy and runs under the request account.

ImportTable creates the table in CREATING, loads DynamoDB JSON lines from
every object under the S3 prefix on a virtual thread, and flips the table
to ACTIVE when done. DescribeImport and ListImports report it. DYNAMODB_JSON
with NONE or GZIP compression is accepted. CSV, ION and ZSTD are rejected
with a ValidationException.

* fix(dynamodb): item calls on a CREATING table return ResourceNotFoundException

* fix(dynamodb): concurrent ImportTable calls with one ClientToken share one import

* fix(dynamodb): import reads S3 as the caller and denies another account's bucket
2026-09-07 22:25:24 -05:00
TATSUNO “Taz” Yasuhiro fd21ac9a6d feat(sfn): publish history events for Parallel branches and Map iterations (#3167)
* feat(sfn): publish Parallel branch and Map iteration history events

The states inside a Parallel branch or an inline Map iteration now publish
their events into the execution history.

The cause of a failure the interpreter raises now carries the AWS prefix
"An error occurred while executing the state '<name>' (entered at the event
id #<n>). ". It is written once, at the innermost state.

Every shape was verified against real Step Functions in us-east-1.

* feat(sfn): record EvaluationFailed for JSONata failures

A JSONata expression that fails now leaves the EvaluationFailed event AWS
records, with error, the attributed cause, location and state. The location
names the field the way the cause does. The event is recorded once per
attempt when the state retries, and before the Failed event and the Catch.
A Catch clause whose own expression fails records it from where the state
stood before its first Failed event, then fails the state again.

Verified against real Step Functions in us-east-1

* fix(sfn): record every Distributed Map run so DescribeMapRun resolves its ARN

* fix(sfn): stop counting history events once the execution has ended
2026-09-07 23:18:05 -04:00
lex00 5eacd01636 fix(ec2): store instance metadata options and add ModifyInstanceMetadataOptions (#3215)
RunInstances stores the MetadataOptions it is given, with AWS's launch
defaults for anything left out, and DescribeInstances reads the stored
values back instead of a hardcoded block. A launch template's metadata
options seed the launch and explicit request fields override them.
ModifyInstanceMetadataOptions changes only the fields it names and
returns the instanceMetadataOptions shape. Values outside the AWS
enumerations and a hop limit outside 1 to 64 are InvalidParameterValue.

Ported from lex00/floci#116, whose SSM half is floci-io/floci#3173.
2026-09-07 21:50:06 -05:00
Franklin G. Mendoza d99675a512 feat(controlcatalog): add control lookup operations (#3130)
* feat(controlcatalog): add control lookup operations

* fix(controlcatalog): complete control lookup contracts

* test(controlcatalog): verify pagination continuation

* fix(controlcatalog): move control model to package

* fix(controlcatalog): integrate service storage lifecycle
2026-09-07 21:49:39 -05:00
Mario Toffia b88034cd1d feat(iot): rule SQL message functions, isNull, isUndefined, IN and array literals (#3036)
Add clientid(), timestamp(), accountid() and newuuid(), the isNull() and
isUndefined() functions, the IN operator against a payload array or an
array literal, and array literals such as [lat, long], each following
the tables in the AWS IoT SQL reference. Equality extends to arrays
(element by element, in order) and objects (by key, in any order).

clientid() needs the MQTT client that published, so publish and
handlePublish carry the client id: the broker passes its session's
client id and an IoT Data Publish over HTTP passes none, which the
function reports as n/a as AWS does.

principal() stays unparsed: it returns the certificate a device
authenticated with, and the broker does not verify one yet.
2026-09-07 21:49:18 -05:00
BingEdward 90fa707145 fix(sts): return ExpiredTokenException for an expired web identity token (#3210)
* fix(sts): return ExpiredTokenException for an expired web identity token

AssumeRoleWithWebIdentity mapped every WebIdentityTokenVerifier failure to
InvalidIdentityToken, so an expired but otherwise valid IRSA token got the
same wire error as a bad signature or wrong issuer. Real STS reports the
expiry case as ExpiredTokenException so callers can refresh and retry.

Fixes #3205

* test(eks): inject EksOidcService through the test constructor
2026-09-07 21:43:46 -05:00
lex00 703744c9fb feat(s3): support bucket analytics and inventory configurations (#3213)
PutBucketAnalyticsConfiguration, GetBucketAnalyticsConfiguration,
ListBucketAnalyticsConfigurations and DeleteBucketAnalyticsConfiguration,
plus the four inventory counterparts, follow the shape the metrics and
intelligent-tiering configurations already use. Each body is validated
against the published schema and re-serialized in the AWS element
order, stored on the bucket record under its id, and returned from the
single and list reads. The PUT and DELETE forms are routed ahead of the
unqualified CreateBucket and DeleteBucket so they cannot fall through.
2026-09-07 21:43:19 -05:00
Vũ Thế Huy ec2d678e6d fix(lambda): honor MaximumBatchingWindowInSeconds on SQS event source mappings (#3203)
* fix(lambda): honor MaximumBatchingWindowInSeconds on SQS event source mappings

CreateEventSourceMapping, GetEventSourceMapping and UpdateEventSourceMapping now
parse, validate (0 to 300), persist and return MaximumBatchingWindowInSeconds
instead of silently dropping it.

When the window is greater than 0 the SQS poller holds an underfilled batch open,
accumulating messages across polls, and invokes the function once the batch
reaches BatchSize or the window elapses since the first buffered message. A window
of 0 or unset keeps the previous invoke-on-first-receive behavior.

Closes #3155

* fix(lambda): cover the batching window in SQS message visibility and window-off transitions

Address review feedback on the batching-window poller:

- Visibility timeout is now fn.timeout + window + 30 instead of the max of the two,
  so a message buffered for the full window and then processed for the full
  function timeout stays invisible for the whole span. Otherwise a long invoke
  could outlive the visibility and another consumer would receive a duplicate
  with a stale receipt handle.
- When the window is changed from positive to zero (or unset) on a live mapping,
  the poller now drains and delivers any already-buffered batch on the next tick
  instead of ignoring it, so those messages are not stranded until their
  visibility expires and cannot be replayed alongside fresh copies if a positive
  window is later restored.
2026-09-07 21:43:06 -05:00
Mario Toffia 53a84c8890 feat(iot): configurable DescribeEndpoint address for published AWS IoT ports (#3202)
* feat(iot): configurable DescribeEndpoint address for published AWS IoT ports

AWS IoT's DescribeEndpoint returns a bare hostname and each client adds its
own port (8883, 443 or 8443). Floci returns host:4566 because its HTTP data
plane lives there and IoT Data clients build https://<endpoint> from it. Both
are right for their callers, and Floci inside a container cannot tell whether
the operator published the AWS ports.

floci.services.iot.endpoint-address (FLOCI_SERVICES_IOT_ENDPOINT_ADDRESS)
is returned as is for every endpoint type when set; unset or blank keeps the
host and port of the base URL. EmulatorConfig.iotEndpointAddress() resolves
it once for DescribeEndpoint and for the AWS-managed domain configurations,
which now follow a changed address instead of keeping the value they were
seeded with. The name joins the generated server certificate's SANs the way
FLOCI_HOSTNAME does, so devices verify it on 8883 and 443.

* docs(iot): DescribeEndpoint address when the AWS IoT ports are published

Describe FLOCI_SERVICES_IOT_ENDPOINT_ADDRESS on the IoT page with the
compose port layout it is meant for, note it on the TLS page next to the
other names the server certificate covers, and list the IoT Core variables
in the environment variable reference.

* fix(tls): accept only host or host:port as the IoT endpoint certificate name

A value with a query or fragment, such as host?x=1, still parsed to a host
and was added to the server certificate. The name now has to be exactly the
authority java.net.URI reads back, so anything beyond host[:port] is skipped
with the same warning as a URL or a path.

* test(iot): pin the address the concurrent seeding test asserts at the end

Every caller had already been joined, so the final describe could not race,
but setting the address explicitly before it makes that plain to read.
2026-09-07 21:42:38 -05:00
Matheus André 991470e7c4 fix(cloudtrail): implement CreateTrail with tagging support and add integration tests (#3206)
Signed-off-by: Matheus André <matheusandr2@gmail.com>
2026-09-07 21:46:14 -04:00
Vũ Thế Huy b9039fef1d feat(redshift-data): emulate the Amazon Redshift Data API (#3186)
* feat(redshift-data): resource resolver, connection factory, statement store, service registration

* feat(redshift-data): field mapper, column metadata, SQL parameter binding

* feat(redshift-data): execute, describe, and paged result retrieval

* feat(redshift-data): batch execution, list statements, cancel

* feat(redshift-data): schema introspection operations

* test(redshift-data): end-to-end Data API over a real cluster plus SDK compatibility test

* docs(redshift-data): document the Redshift Data API surface

* fix(redshift-data): address code review findings

- rejectMultiStatement now reuses the SQL tokenizer so a semicolon inside a
  comment, string literal, or dollar-quoted block no longer rejects a valid
  single statement
- GetStatementResultV2 gains unit coverage for the typed and CSV envelopes
- CSV output is RFC 4180 quoted (embedded comma, quote, CR, LF)
- batch rollback is asserted transactionally in the integration test
- RedshiftDataFieldMapper logs a swallowed blob-read SQLException
- RedshiftPid/RedshiftQueryId use a non-negative hash
- NextToken that decodes to a negative offset is rejected
- CancelStatement leaves a FAILED statement FAILED
- DescribeTable paginates ColumnList and emits NextToken
- DbUser is echoed on the SecretArn path
- the statement store no longer builds its sweeper executor in the test constructor

* fix(redshift-data): address PR #3186 review findings

- SQL scanner handles PostgreSQL escape strings (E'...'): a backslash-escaped
  quote no longer ends the literal and mis-detects a following :name as a bind
  marker; plain '...' literals still treat backslash as an ordinary character
- ListStatements clamps MaxResults to 1..100 so MaxResults=0 no longer emits the
  same NextToken forever
- DescribeTable matches Table / Schema exactly (=) instead of LIKE, so a name
  containing _ or % cannot merge other tables' columns into ColumnList
- register the service in the README category table
- drop a stray em dash from the neighbouring services.yaml comment

* fix(redshift-data): bind string parameters untyped so real PostgreSQL infers the column type

CI ran the integration test against a real Redshift (PostgreSQL 15) cluster and
parameterisedStatement failed: a string bound to an int column via setString
raised "operator does not exist: integer = character varying". H2 in PostgreSQL
mode coerces it, so the unit test missed it.

- RedshiftDataConnectionFactory adds stringtype=unspecified to the JDBC URL, so
  setString sends the value untyped and the server infers the target type,
  matching how AWS binds Redshift Data API parameters
- ListStatements now rejects MaxResults above 100 with ValidationException
  instead of silently clamping (PR #3186 re-review)
- RedshiftDataOperationsTest uses JBoss Logging, not java.util.logging (PR #3186 re-review)

* fix(redshift-data): back the statement store with StorageFactory

The store held a bare ConcurrentHashMap outside the configured storage and
lifecycle model. It now obtains an account-aware backend through StorageFactory
("redshift-data", statements.json), the same as Athena's query store, resolved to
the global storage mode via the catalog descriptor. Default mode stays memory, so
statements are still lost on restart as documented; the 24h TTL sweep now walks
every account partition and deletes per account since the sweep thread has no
request context. StoredStatement is annotated for reflection and field-visible
serialization so persistent modes round-trip it.

* test(redshift-data): cover StoredStatement serialization round-trip and values()

The StorageFactory-backed store serializes StoredStatement in persistent modes.
Adds a round-trip test through the exact mapper PersistentStorage builds,
covering the ArrayNode, enum, Instant, and nested sub-statement fields plus the
field-visibility annotation, and a values() test.

* fix(redshift-data): register the nested Status enum for reflection

PersistedModelReflectionTest walks every type reachable from a StorageFactory
persistence root; StoredStatement.status pointed at an unregistered enum, so
native-image deserialization of a persisted statement would fail on restart.
2026-09-07 20:18:22 -04:00