Commit Graph
868 Commits
Author SHA1 Message Date
lex00 6cd1bb3794 feat(rds): add and remove a subscription's source identifiers (#4363)
* feat(rds): add and remove a subscription's source identifiers

SourceIds was write-once. CreateEventSubscription accepts the list and
ModifyEventSubscription has no SourceIds member, so
AddSourceIdentifierToSubscription and RemoveSourceIdentifierFromSubscription
are the only way to change it and neither existed.

Adding an id the subscription already carries is a no-op. The model declares
only SourceNotFoundFault and SubscriptionNotFoundFault for these operations,
so no fault fits a duplicate. Removing an id the subscription does not carry is
SourceNotFound, which is the fault that does fit.

* fix(rds): refuse a missing SubscriptionName as a parameter error

SubscriptionName and SourceIdentifier are both required by the model, and only
the identifier was checked. A missing name fell through to the subscription
lookup and came back as SubscriptionNotFound, telling the caller the
subscription does not exist when the request simply did not name one. The two
required members now fail the same way on both operations.

Also imports assertEquals in the new test rather than qualifying it inline.
2026-09-25 07:08:02 -04:00
Kenshin Okinaka 08c6ce0768 feat(ses): add v2 export jobs (#4327)
* feat(ses): add v2 export jobs

CreateExportJob, GetExportJob, ListExportJobs and CancelExportJob render the
per-recipient timelines already stored at send time as CSV or JSON, through
the same aggregation BatchGetMetricData serves, so an export and a query of
one window cannot disagree.

Real SES writes the file into a bucket it owns and refuses a caller-chosen
S3Url, so Floci does the same and writes into its own S3 emulation, which is
what the presigned URL on a finished job resolves against.

The VDM gate answers BadRequestException here where message insights and
metric data answer NotFoundException, so SesAccountService takes the caller's
error shape and keeps one copy of the probed sentence.

* fix(ses): use the published concurrent-export quota and prove the reset test parks

* fix(ses): scope the export bucket per account and fix two row-count bugs

* fix(ses): make the reset drain test deterministic and document the presigner limit

* test(ses): assert the reset thread finished, since join returns on timeout too
2026-09-24 22:54:36 -04:00
Mario Toffia 88a992757e feat(lambda): bisect failing DynamoDB stream batches and keep refused failures (#4337)
BisectBatchOnFunctionError now splits a batch that fails with a function
error in half, keyed by checkpoint, until the poison record is isolated.
Splits do not consume the retry quota; throttles and partial batch
responses do not split.

A discarded batch whose OnFailure destination refuses the send is parked
at the persisted checkpoint and only the send is retried with backoff,
instead of checkpointing past a batch that was never delivered.
2026-09-24 21:18:00 -04:00
Simone Primarosa 922402210f feat(ec2): attach volumes as real block devices (#4354)
* feat(ec2): attach volumes as real block devices

* fix(ec2): address review feedback on volume block device attachments

* fix(ec2,eks): handle volume deletion failures and node volume re-attachment on restore

* test(eks): verify cluster node instance registration and listener callback

* fix(ec2,eks): address review comments on loop device detachment and config

* fix(ec2): support both util-linux and busybox losetup in volume loop lookup
2026-09-24 21:10:55 -04:00
Mario Toffia 4abba5a218 fix(lambda): preserve CloudFormation event source mapping options (#4316)
AWS::Lambda::EventSourceMapping now forwards MaximumBatchingWindowInSeconds,
MaximumRetryAttempts, MaximumRecordAgeInSeconds, BisectBatchOnFunctionError,
FilterCriteria, DestinationConfig and ScalingConfig to LambdaService, so a
stack-created mapping matches an API-created one. On UpdateStack each of
these that the template omits is sent as null, which clears it.

ParallelizationFactor and TumblingWindowInSeconds are not modeled and remain
ignored; the resource-type table notes this.

Fixes #4313
2026-09-24 21:05:00 -04:00
lex00 09dcbabe2b feat(rds): manage event notification subscriptions (#4332)
* feat(rds): manage event notification subscriptions

CreateEventSubscription, DescribeEventSubscriptions, ModifyEventSubscription
and DeleteEventSubscription were all missing, so the subscription resource
could not be created.

Constraints come from the model. A SubscriptionName under 255 characters, a
required SnsTopicArn, SourceType limited to the documented valid values, and a
SourceIds list that may only be supplied alongside the SourceType its ids
belong to. An omitted Enabled activates the subscription, which the model
describes only in the negative: a subscription that is not activated is
created but not active. Modify applies only the members the request names.

Nothing is published to the topic. A subscription is stored and reported back
and no RDS event reaches SNS through it. The docs say so.

* fix(rds): synchronize the event subscription methods and cite the SourceIds constraint

createEventSubscription checked for a duplicate name and then stored, so two
concurrent creates of the same name both passed the check and the second
overwrote the first with neither caller seeing SubscriptionAlreadyExist. The
four methods are synchronized now, matching the 48 other public synchronized
methods in this file and the find-then-throw-then-store shape of
createDbSnapshot.

The comment on the SourceIds coupling said only that the model states it,
which sent a reviewer to the operation documentation where it is absent. It
now quotes the constraint and says it lives on
CreateEventSubscriptionMessage.SourceIds rather than on the operation.

* fix(rds): keep a rejected modify inert, carry subscription tags, and page the describe

Four findings from the automated review, all confirmed against the model.

ModifyEventSubscription wrote SnsTopicArn before validating SourceType, so a
request carrying a new topic and an unmodelled source type answered 400 with
the topic already changed. The store returns the live instance, so a later
describe reported it. This is the same shape as the Lambda code signing bug in
#4286 and I did not carry the lesson across.

CreateEventSubscriptionMessage has a Tags member that was dropped on the
floor, and resolveTagHandle had no arm for an es: ARN, so a subscription could
neither be created with tags nor tagged afterwards.

DescribeEventSubscriptionsMessage has MaxRecords and Marker, and its output
shape has Marker. None were read or emitted, so a bounded page returned
everything with no way to continue.

The new test used var, which AGENTS.md prohibits, the same thing flagged on
#4286.

* fix(rds): bound MaxRecords and resume paging past a deleted marker

Two defects I introduced in the pagination added last round.

MaxRecords was unbounded. Zero built an empty page and then read its last
element, throwing IndexOutOfBoundsException, and a negative value produced
invalid bounds. The model documents minimum 20, maximum 100, default 100, and
handleDescribeEvents a few hundred lines up already enforces that range. An
omitted value now defaults to 100 rather than returning everything.

The marker resumed by looking for its own name, so a subscription deleted
between calls left the offset at zero and handed back the first page again.
Resuming at the first name strictly greater than the marker is stable under
deletion.

The test used MaxRecords 1, a value the model rejects, so it exercised a page
size real RDS never serves. It now creates 21 subscriptions and pages with 20.

* fix(rds): validate MaxRecords before the named-subscription shortcut

The range check sat after the early return for a named subscription, so a
request naming one alongside an out-of-range MaxRecords succeeded. Request
validation should not depend on which branch serves the read.
2026-09-24 20:51:09 -04:00
Priamo Germosen 70df224189 test(codepipeline): make the S3 source poll interval configurable so the negative tests wait less (#4236) 2026-09-24 17:37:36 -05:00
Abhigya 76cc27f2f1 fix(ecs): retry teardown of redeployed task containers (#4280)
* fix(ecs): retry teardown of redeployed task containers

* test(ecs): wait for explicit task stop in SDK compatibility test

* fix(ecs): serialize teardown and align stop compatibility test

* test(ecs): observe blocked concurrent stop without delay

* fix(ecs): preserve unknown exits and serialize startup transition
2026-09-24 15:51:05 -04:00
XuJian b658c5f020 feat(ecr): update and validate pull-through cache rules (#4342) 2026-09-24 15:38:19 -04:00
Simone Primarosa 077b65df5c feat(ec2): implement ModifyVolume and volume modification state (#4320) 2026-09-24 15:14:59 -04:00
XuJian 4a51c0e814 feat(dlm): manage lifecycle policies (#4335)
* feat(dlm): manage lifecycle policies

* fix(dlm): use shared partition regex
2026-09-24 15:08:34 -04:00
Simone Primarosa 6de5e40f54 feat(eks): label cluster nodes with their topology zone and region (#4308) 2026-09-24 15:06:57 -04:00
Niels Kootstra 06ec4b563a fix(ec2): validate and expire IMDSv2 session tokens (#4303)
* fix(ec2): validate and expire IMDSv2 session tokens

PUT /latest/api/token accepted any TTL and tokens never expired. Require an
integer X-aws-ec2-metadata-token-ttl-seconds between 1 and 21600 (400
otherwise) and reject an expired or unknown token with 401, as IMDS does.
Requests without a token still use IMDSv1.

* test(ec2): use the shared MutableClock in Ec2MetadataTokenTest

Drop the test's private clock in favour of
io.github.hectorvent.floci.testing.MutableClock, which other tests
already share and which starts at the same instant.

* fix(ec2): reject an IMDSv2 token presented from another instance

A valid token won over the caller's IP, so container B presenting
container A's token received A's metadata, credentials included. The
docs say a token is not valid on other instances. Answer 401 when the
caller's IP maps to a different instance than the token's; an
unregistered IP still defers to the token.
2026-09-24 15:04:24 -04:00
Franklin G. Mendoza 02ad6aa768 fix(codepipeline): resolve effective source revisions (#3514) 2026-09-24 13:30:42 -04:00
lex00 41ceed4dba feat(lambda): manage code signing configurations (#4286)
* feat(lambda): manage code signing configurations

CreateCodeSigningConfig and its Get, Update, Delete and List siblings were
missing, so aws_lambda_code_signing_config and anything else that manages the
resource had nothing to call.

Adds the five, backed by a store. Constraints come from the model: an id of
csc- plus 17 characters, AllowedPublishers required with one to twenty signing
profile ARNs, a Description of at most 256 characters, and Warn as the default
UntrustedArtifactOnDeployment.

ListFunctionsByCodeSigningConfig now resolves the configuration instead of
answering every well-formed ARN with a 404. That answer was correct only while
no configuration could exist. A known one reports no functions, since
PutFunctionCodeSigningConfig is still not wired.

Nothing verifies a signature, so a configuration never gates a deployment. The
docs say so.

* fix(lambda): register the code signing config model for reflection

PersistedModelReflectionTest flagged it: a type reachable from persisted
storage needs @RegisterForReflection or native-image persistence breaks on
restart. The two nested shapes need it too.

* docs(lambda): name the ARN pattern as the reason the id alphabet is lowercase

The comment credited the id pattern, which is the looser of the two.
CodeSigningConfigId allows csc-[a-zA-Z0-9-_\.]{17} and CodeSigningConfigArn
ends in csc-[a-z0-9]{17}, so the ARN is what binds the alphabet. Anyone
reconciling the code against the old comment could widen it, still satisfy the
id pattern, and start emitting ARNs that do not conform.

Also imports List in the new test instead of writing java.util.List.of inline.

* fix(lambda): mint the code signing config ARN through AwsArnUtils

The ARN was assembled from a hardcoded arn:aws: prefix, so it named the
commercial partition whatever region the request carried. AwsArnUtils resolves
the partition from the region, which is what the partition-literals gate asks
for.

* fix(lambda): validate every member of an update before applying any

The store hands back the live instance, so validating and setting in turn left
an earlier member written when a later one was rejected. An update carrying a
valid Description and an empty AllowedPublishers answered 400 with the
description already changed, visible to the next GetCodeSigningConfig and
saved by the persistent and hybrid stores on their next write.

aRejectedUpdateChangesNothing sends that combination, and the same shape with
the policy as the rejected member, and asserts the description is unchanged
after each. It fails without the reordering.
2026-09-24 12:05:29 -04:00
Mario Toffia ec40bcf5f4 fix(iot): accept MQTT packets up to the AWS 128 KB payload limit (#4307)
* test(iot): 128 KB MQTT payloads on every transport, failing

* fix(iot): accept MQTT packets up to the AWS 128 KB payload limit

* test(iot): pin the 146 KB MQTT 5 packet limit with AWS maximum properties
2026-09-24 11:53:07 -04:00
Hector Ventura 0dd080a46f feat(core): partition foundation from botocore's published partition data (#4317)
P1 of the multi-partition initiative (#4272). tools/aws/regen_partitions.py
vendors botocore's partitions.json and endpoints.json (8 partitions, 46 regions,
the partition-wide endpoints with their signing regions) plus the CDK's opt-in
and S3 website rules into src/main/resources/aws/partitions.json, checked by
make aws-data-check. AwsPartition and AwsPartitions replace the hand-typed rules
behind AwsRegions; RequestContext carries the request's partition from its
SigV4 signing region; RegionResolver mints global ARNs in that partition and
buildArn routes a blank region there; floci.partitions.id pins the deployment's
partition behind a startup validator that refuses a contradiction with the
default region.

Behaviour a reviewer will see, all AWS-faithful: DescribeRegions follows the
request's partition and the opt-in model (17 commercial regions by default, all
34 with AllRegions=true, RegionName.N filters, endpoints on the partition's DNS
suffix); TLS SANs cover every published region; the EKS registry mirrors follow
the deployment partition's regions. The partition-literal baseline drops by two.

Part of #4272
2026-09-24 10:33:05 -04:00
Priamo Germosen 910f0922c9 feat(iam): add GenerateCredentialReport and GetCredentialReport (#4298)
Generates and downloads the account's credential report, the 23 columns
AWS documents for it, in CSV, Base64-encoded per the wire model. The
report is a single value per account, stored the same way accountAliases
and passwordPolicies already are, and regenerated only once the previous
one is older than 4 hours, matching AWS's documented caching window.

CSV content: every IAM user gets real password_enabled, password_last_used,
password_last_changed and access_key_1/2_active/last_rotated where Floci
already tracks that state, plus the documented placeholder values for what
it does not model (MFA devices, X.509 signing certificates, access-key
last-used date/region/service, and password_last_used itself, since
nothing in the codebase ever sets IamUser's passwordLastUsed field). The
root account row is present, as AWS always includes it, but is placeholder
throughout: Floci does not model root account credentials at all, the same
reason GetAccountSummary's AccountPasswordPresent and
AccountAccessKeysPresent are always zero.

password_last_changed needed a new LoginProfile field: UpdateLoginProfile
changes the password without touching LoginProfile's own createDate (its
meaning stays 'profile created'), so reading createDate for this column
would have kept reporting the original creation time after a password
change. passwordLastChanged is set alongside createDate initially and
updated whenever UpdateLoginProfile actually changes the password, falling
back to createDate for a profile persisted before this field existed.

additional_credentials_info is Floci's own wording, since AWS does not
document the exact text; in practice it is unreachable, since
CreateAccessKey already enforces the real 2-key-per-user quota.

Generating a report is effectively instant here, so GenerateCredentialReport
never actually returns INPROGRESS; a GetCredentialReport call right after
it always finds the report ready. The STARTED state and its description
for the no-report-exists case match AWS's own documented example response
verbatim; the report-expired case's wording is Floci's own, since AWS does
not document it.
2026-09-24 07:45:24 -05:00
XuJian 1952ba4052 feat(ecr): manage pull through cache rules (#4304)
Signed-off-by: XuJian <265865031+xujiantop-crypto@users.noreply.github.com>
2026-09-24 08:36:06 -04:00
Kenshin Okinaka 34be03b334 feat(ses): add v2 BatchGetMetricData (#4302)
Aggregates the per-recipient timelines already stored at send time, so the
batch metrics and GetMessageInsights cannot disagree about what a send
produced. Buckets are whole UTC days, the series is sparse rather than zero
filled, the end of the range is exclusive, and counting is per recipient.

SentEmail gains the configuration set the send resolved to, which the
CONFIGURATION_SET dimension filters on. The VDM gate moves into a shared
SesVdmGate so the two gated operations keep one copy of the probed message.

Metrics that need a real mailbox to act stay empty, as does TRANSIENT_BOUNCE,
since every bounce Floci derives is permanent.
2026-09-24 08:34:15 -04:00
Simone Primarosa 876ddc7422 feat(ec2): expose synthesized cluster node instances to the EC2 service (#4262)
* feat(ec2): expose synthesized cluster node instances to the EC2 service

* fix(ec2): enforce account isolation and tag persistence for cluster node instances

* fix(ec2): scope findInstanceById to caller account for external instances

Scope findInstanceById to the caller account when falling back to
external instances instead of matching across all accounts. Thread
the account identifier into SSM direct command execution, ELBv2 target
resolution, and classic ELB health checking so external cluster nodes
remain strictly account-isolated across all instance lookup paths.

* fix(ssm,eks): update test stubs for account-scoped direct execution and harden cluster provider
2026-09-24 08:27:52 -04:00
Abhigya bae7e0316a feat(s3): enforce Block Public Access on the data plane (#4253)
* feat(s3): enforce Block Public Access on the data plane

The four Block Public Access flags were stored and returned but never read
by any authorization path, so put-public-access-block was accepted and
changed nothing: a bucket left public by a policy or an ACL stayed readable.

Enforce all four, combining a bucket's configuration with its owner
account's and taking the most restrictive of the two, as AWS does.

BlockPublicPolicy and BlockPublicAcls reject the write that would introduce
public access, which AWS applies whoever the caller is, so they do not sit
behind enforce-auth. RestrictPublicBuckets and IgnorePublicAcls suppress
access an existing policy or ACL grants, which only has meaning once
anonymous authorization runs, so they take effect under enforce-auth.

Deciding what counts as public follows the documented AWS rules: an ACL is
public when it grants any permission to AllUsers or AuthenticatedUsers, and
a policy is assumed public unless a wildcard-principal statement pins a
recognised condition key to a fixed value. A single public statement makes
the whole policy public, so RestrictPublicBuckets also withholds the
cross-account delegation a separate non-public statement grants.

Enabling a setting never rewrites stored state; an existing public policy
or ACL is left exactly as written.

* test(s3): pin the Block Public Access contract at the wire

Cover the write-time flags under the default configuration and the
read-time flags under enforce-auth, including the reproduction that
motivated the fix: put-public-access-block followed by an anonymous
GetObject on a bucket whose policy is public.

Each enforcing assertion is paired with a negative control that must keep
passing without the fix, so a test cannot pass vacuously: the without-BPA
case still returns 200, and the owner's signed access is never affected.
Reverting the S3Service change fails the 11 enforcing assertions and leaves
the 10 controls green.

Unit tests cover the settings record's parsing and most-restrictive merge,
the ACL public-status rule, and the policy public-status rule against the
examples in the AWS documentation.

* test(s3): validate Block Public Access through the AWS SDK

Drives BlockPublicPolicy and BlockPublicAcls with S3Client so the rejection
is seen the way an SDK caller sees it: a 403 carrying the AccessDenied error
code, not just a status line. Both apply without enforce-auth, which is the
configuration this suite runs against.

* test(s3): drop the em-dash from the Block Public Access display name

* fix(s3): recognize scoped access point ARN in bucket policies

* fix(s3): honor ForAnyValue in public policy checks
2026-09-24 08:23:12 -04:00
lex00 72231c09cf feat(dynamodb): add the legacy global table operations (#4288)
* feat(dynamodb): add the 2017.11.29 global table operations

CreateGlobalTable, DescribeGlobalTable, UpdateGlobalTable and ListGlobalTables
were all UnknownOperationException, so a legacy global table could not be
created at all. The 2019.11.21 path through UpdateTable ReplicaUpdates already
worked, and these four now run on the same replica metadata.

Constraints come from the model. CreateGlobalTable builds on a table that
already exists, so an absent one is TableNotFoundException rather than the
item operations' ResourceNotFoundException, and a second create is
GlobalTableAlreadyExistsException. The one replica precondition a
single-process emulator can test is the stream, so a table joins only with
DynamoDB Streams enabled and a view type of NEW_AND_OLD_IMAGES.

DynamoDbIntegrationTest used CreateGlobalTable as its example of an
unsupported operation. It now uses DescribeGlobalTableSettings, which is still
unimplemented.

* fix(dynamodb): use the model's fault shapes on the global table surface

Two gaps on the new operations.

requireStreamWithBothImages raised InvalidParameterValue, which is not a
DynamoDB shape at all. Every other rejection in this file raises
ValidationException, seventy-six of them, so a client catching that one missed
this rejection alone. The test asserted only the status, never the code, which
is why nothing caught it.

UpdateGlobalTable delegated straight to applyReplicaUpdates, and that helper is
deliberately idempotent for UpdateTable and CloudFormation re-applies: a
duplicate add is skipped and an absent removal is a no-op. The model declares
ReplicaAlreadyExistsException and ReplicaNotFoundException for
UpdateGlobalTable and declares neither for UpdateTable, so sharing the path
dropped both. The membership check now lives in updateGlobalTable and the
helper keeps its idempotence.

Tests assert the codes rather than the status, cover both replica faults
including a re-add of the home region, and pin that UpdateTable still accepts
the same re-add.
2026-09-24 08:22:20 -04:00
XuJian 7cf8ab7d85 feat(ce): manage anomaly monitors and subscriptions (#4221)
* feat(ce): manage anomaly monitors and subscriptions

* fix(ce): return JSON objects for empty responses
2026-09-24 08:20:17 -04:00
Franklin G. Mendoza 196d1586da fix(codepipeline): retry failed stages in place (#3513) 2026-09-24 07:17:04 -04:00
Hector Ventura 836161e1ff feat(docker): own the floci-aws- container and volume prefix (#4273)
Every container and volume Floci creates was named floci-<service>-<id>. Every
Floci emulator shared that prefix, so two of them on one Docker daemon collided
on names, and docker volume prune --filter label=floci=true reached all of them
at once. Each emulator now owns a prefix of its own; this one uses floci-aws-,
and labels its resources floci_emulator=floci-aws.

Existing data is neither moved nor lost. Resources with a record (RDS, MSK,
OpenSearch, Amazon MQ, Kinesis Analytics savepoints, Timestream InfluxDB)
persist the volume name they were created with; records from before the field
existed are backfilled with the frozen legacy name so their data keeps
resolving. Volumes with no record (the ECR registry, EFS-backed task and Lambda
volumes) are found by probing the legacy name first. Containers are disposable
and always take the current name; the UI console and the ECR registry, which
survive shutdown and are adopted by name, are looked up under both prefixes so
an upgrade does not orphan one that still holds its host port. Stale-container
cleanup clears both names.

Scripts that name containers (docker exec floci-rds-<id>) must be updated, and
downgrading does not migrate back: a record written after the upgrade carries a
floci-aws- name an older build will not look for. Documented in storage.md.
2026-09-24 07:04:59 -04:00
Hector Ventura bfedf6c679 feat(batch): tag actions and one-lock teardown, wired into the CloudFormation provisioner (#4268)
Batch gains ListTagsForResource, TagResource and UntagResource (rest-json on
/v1/tags/{arn}, served by a BatchTagHandler under the shared V1Tags controller,
200 on success as the model declares no responseCode), and the compute
environment, job queue and job definition each get a teardown that deletes
under one lock and reports false when the resource is already gone (an
INACTIVE job definition revision counts as gone).

BatchCfnProvisioner deletes through those teardowns so DeleteStack and rollback
remove the backing resources instead of only forgetting them, and a JobQueue
update reconciles its tags in place. ProvisionContext.resolveTags now reads the
object form of Tags as well as the list form: Batch templates declare tags as a
map, which was silently dropped at create time.

Refs #2861
2026-09-24 07:04:27 -04:00
Priamo Germosen 94fc4c45bb feat(codeartifact): release a deleted repository's Maven storage (#4210)
DeleteRepository never cleaned up the Reposilite-side storage of a deleted
repository; it was left behind, wasting space over a long-running process.
Reposilite has no bulk-delete endpoint, but DELETE on a path recursively
removes everything under it in one call, so this deletes each of the
repository's top-level entries before removing it from the shared settings
list, verified against a live instance. Order matters: the repository must
stay registered while its files are deleted, since Reposilite 404s every
path, including DELETE, for an id absent from its settings.

Release is best-effort: the CodeArtifact-side metadata delete already
committed by the time it runs, matching real CodeArtifact's own
DeleteRepository (synchronous, always succeeds once the repository exists).
A sidecar that is unreachable must not turn an already-successful delete
into a 500, and must not leave the repository stuck, since a retry would
just 404 against the already-deleted record.

Introduces RepositorySidecarManager, a small interface every per-format
sidecar can implement, and CodeArtifactSidecarRegistry, which discovers
implementations via CDI. CodeArtifactService.deleteRepository releases
storage generically over whatever formats a repository has sidecar ids
for, so a future format's sidecar needs no change here. Reposilite is the
first and only implementation for now; CodeArtifactRepository's
mavenRepositoryId field becomes a sidecarContainerIds map for the same
reason.
2026-09-23 22:48:03 -05:00
XuJian b986b95074 fix(s3): reject reserved storage bucket names (#4289) 2026-09-23 23:41:20 -04:00
Vũ Thế Huy a450cdc9b0 feat(redshift): support Redshift Spectrum phase one (#4184)
* feat: add Redshift Spectrum metadata catalog

* feat: parse Redshift Spectrum DDL

* feat: read Redshift Spectrum CSV data from S3

* feat: classify and rewrite Redshift Spectrum queries

* feat: materialize Spectrum rows into PostgreSQL

* feat: intercept Redshift Spectrum queries

* test: cover Redshift Spectrum wire integration

* docs: document Redshift Spectrum phase one

* fix: handle Spectrum extended queries

* fix: preserve Spectrum query protocol state

* fix: resolve Spectrum cursor paging and extended query race condition

- Await prior backend queries before streaming local Spectrum Extended Query frames
- Drop synthetic Spectrum Parse/Bind/Describe/Close frames from coordinator pending queue
- Support server-side cursor pagination with PortalSuspended across multiple Execute cycles
- Add cascade cleanup for unexhausted portal cursors when prepared statement is closed

* fix(redshift): register SpectrumMaterializer for GraalVM runtime initialization

* fix(redshift): forward non-Spectrum queries and register storage models for reflection

* docs(redshift): clarify Spectrum temp table lifecycle across protocols

* docs(redshift): note that Simple Query Spectrum creates a temp table per query

---------

Signed-off-by: Vũ Thế Huy <31652864+vuthehuyht@users.noreply.github.com>
2026-09-23 23:34:03 -04:00
Simone Primarosa 766166fc35 feat(eks): set the cluster node providerID (#4255) 2026-09-23 22:45:07 -04:00
Hector Ventura 96264cde70 chore(build): make the native image build locally and give the Makefile a development workflow (#4271)
The Quarkus container build of the native binary failed on Apple Silicon with
GraalVM's BranchTargetOutOfBoundsException in a generated AwsQueryController
invoker (Quarkus 3.39 turns on -H:+AOTSingleCallsiteInline for Mandrel 25.0.4+),
and the packaged image died at startup because the builder links zlib
dynamically while ubi9-micro ships no libz.so.1. `make native` passes the same
flags CI does (-Ob,-H:-AOTSingleCallsiteInline), stages native/<arch>/ like the
workflow, and copies libz.so.1 from the builder image next to the binary, which
Dockerfile.native-package now puts on LD_LIBRARY_PATH.

The Makefile becomes the entry point for development: help (default), dev,
build, test T=, native (container build), native-host (host GraalVM/Mandrel,
adding the Mandrel-only flag when native-image reports Mandrel), run-native,
native-install (PREFIX, default ~/.local), native-image, native-up/native-down/
native-logs against a new docker/compose.native.yml overlay that carries the
five CI compat env vars, clean-sidecars, clean-volumes (a leftover ECR registry
volume is re-adopted on start and breaks the CDK bootstrap), compat SUITES= and
docker-tests. docker/run-docker-tests.sh gains FLOCI_START=0 and COMPAT_SUITES,
validated against the suite list, and its shell test covers both. Docs:
installation (native section rewritten), docker-images, CONTRIBUTING, AGENTS.
2026-09-23 22:35:24 -04:00
Priamo Germosen 1fa5534e6c feat(iam): add GetAccountAuthorizationDetails (#4208)
Returns every user, group and role in the account, plus every local
(customer-managed) policy and every AWS-managed policy actually attached to
or used as a permissions boundary by something in the account: the entity
lists themselves, their inline and attached policies, group membership,
instance profiles, permissions boundaries, and each managed policy's
version list.

AttachmentCount and PermissionsBoundaryUsageCount are computed by scanning
the account's own users, groups and roles rather than read off
IamPolicy.getAttachmentCount(): for an AWS-managed policy that field is a
single object shared process-wide across every account (attachUserPolicy
et al. mutate the same catalog entry every account resolves), so trusting
it would leak one account's attachments into another's response. Filed
separately as #4205, since fixing it properly means changing the
attach/detach methods themselves, well beyond this action.

Also fixes two related, smaller gaps found while building this:
- CreateInstanceProfile silently dropped a Tags parameter at creation,
  unlike every other Create* action.
- GetInstanceProfile, CreateInstanceProfile and ListInstanceProfilesForRole
  never serialized an instance profile's own tags into the response.
  ListInstanceProfiles keeps omitting them: its own operation
  documentation, like ListRoles's, says it returns a subset of attributes
  and does not return tags, even though the InstanceProfile shape itself
  carries no such exclusion note.

Policy documents are returned as plain JSON, not URL-encoded as AWS
documents them for this action: matches every other IAM action that
returns a policy document, none of which URL-encode either. Filter,
MaxItems and Marker are not honored; the response always includes
everything.
2026-09-23 18:16:27 -05:00
Priamo Germosen d30a744b66 fix(iam): reject an access key that exists nowhere under enforcement (#4182)
With enforcement enabled, a signed request whose access key resolved to no caller context was allowed through, so any access key id authorized any call. Reject it with InvalidAccessKeyId for S3 and UnrecognizedClientException elsewhere, matching what the S3 signature filter and the API Gateway execute path already return.

resolveCallerContext returns null for a key that does not exist and for a real credential it cannot map to policies, such as a session carrying no role ARN. Only the first is unauthenticated, so isKnownAccessKey searches sessions and long-term keys across every account and only a key found nowhere is rejected. The test credential, the bare account-id root principal, unresolvable actions and unsigned requests are unchanged.
2026-09-23 18:16:13 -05:00
Priamo Germosen 2e21c013c5 fix(s3): keep a bucket's data inside its own account directory (#4244)
A bucket name went into the storage path unvalidated, so a bucket named .. resolved to the account storage root itself and the containment check then passed for any account's objects. Reject a name that is not a single directory at CreateBucket, and resolve every bucket path through a helper that asserts the directory sits directly under its account, which also covers a bucket persisted before the name was refused.
2026-09-23 18:07:48 -05:00
stodan 34f4f72e82 fix(cloudformation): pass Lambda hot-reload code through to the Lambda service (#4093)
* fix(cloudformation): pass Lambda hot-reload code through to the Lambda service

AWS::Lambda::Function code of {S3Bucket: hot-reload, S3Key: /host/path} is
Lambda's bind-mount hot-reload convention: the bucket is a marker and the key
is a directory on the Docker host. The provisioner probed S3 for the pair
before calling CreateFunction, so no such object existed and the stack failed
with a ValidationError (or, with allow-stub-lambda-code on, quietly deployed
the stub handler).

Skip the S3 probe for the hot-reload bucket and hand the Code map to
LambdaService unchanged, which keeps enforcing hot-reload enablement, the
absolute-path rule and the allow-list, and reports its own error as the
resource status reason. Record a hot-reload code identity so a redeploy with
the same path is a no-op, and compare adopted functions by host path since a
hot-reload function carries no S3 bucket or key.

* fix(cloudformation): canonicalise the hot-reload code identity

LambdaService stores a hot-reload host path normalised (#4053), while the
provisioner recorded the raw template key as the code identity and compared
adopted functions against it. A template that spelled the same directory with
a trailing slash or a ".." segment, or a function adopted from a direct
CreateFunction, therefore looked like a code change and triggered an
UpdateFunctionCode that mounted the same directory again.

Build the identity from, and compare against, the normalised path. The raw key
still goes to Lambda so its validation and error messages are unchanged. Also
cover the documented SAM CodeUri form, s3://hot-reload//abs/path, through the
transform.
2026-09-23 18:03:35 -05:00
Allen Sanborn 67f06c3ac9 feat(cloudformation): list a deleted stack and report its DeletionTime (#4246)
* feat(cloudformation): list a deleted stack and report its DeletionTime

A deleted stack is already retained so DescribeStacks and DescribeStackEvents
keep answering for it by stack id after the delete, but the record they answer
with was incomplete in two ways.

It carried no deletion time, so DescribeStacks reported DELETE_COMPLETE with
nothing saying when. Stack now has a deletionTime, set as the stack reaches
DELETE_COMPLETE from the same service clock the retention window uses, and the
query handler emits DeletionTime wherever AWS does.

ListStacks omitted deleted stacks entirely. AWS keeps one there as
DELETE_COMPLETE long after DescribeStacks has stopped answering for it by name,
which is how a client reconciles what it deployed against what is left, and a
StackStatusFilter of DELETE_COMPLETE selects exactly those. Retained stacks are
now merged into the listing, still scoped to the caller's account and region and
still dropped once the window passes. A name reused after a delete lists twice,
once per stack id, as it does on AWS. Resource Explorer reads the live map
directly and is unaffected.

Restores deleted-stack-retention-seconds to application.yml, which #849 dropped
in a merge: the knob kept working on its @WithDefault, but the repository YAML
is the source of truth for what a deployment actually runs. Pinned in the test
YAML too, since the retention tests advance the clock past that exact window.

Nothing here changes how a delete runs, and it does not make a multi-stack cdk
destroy work: that client polls a destroy entirely by stack name, so a record
retained by stack id, these two members included, never enters its path.
DeleteStack does already return before the delete finishes, and the stack does
pass through DELETE_IN_PROGRESS, but the whole delete completes in roughly 15ms,
well inside one poll interval, so a client that starts watching when it issues
the delete finds the stack gone by name on its first poll. Giving a deleting
stack an observable window is separate work.

* fix(cloudformation): set a stack's deletion time before publishing the status

Stack.status is volatile and is documented as the publishing write of a deploy:
a reader that observes a terminal status is guaranteed to observe every write
that preceded it. deletionTime was assigned after it, outside that guarantee, so
a DescribeStacks running concurrently with the last step of a delete could
observe DELETE_COMPLETE while deletionTime was still null and answer with no
DeletionTime element at all.

Assigning it first puts it inside the same happens-before edge as the rest of
the delete. The window is nanoseconds wide and no test can land in it reliably,
so this carries none; the ordering rule is the thing being fixed, and the
comment records it so the next edit here keeps it.

* fix(cloudformation): retain a deleted stack before it leaves the live map

The handover at the end of a delete removed the stack from the live map, wrote
its removal through to storage, and only then retained it as deleted. A
ListStacks landing between the removal and the retention found it in neither
map and dropped it from the listing, though the stack both existed a moment ago
and is retained a moment later.

Retaining before removing closes that window. The stack is then briefly in both
maps, which is harmless: they hold the same Stack, and listStacks now reduces by
stack id, so it is listed exactly once throughout. Nothing else reads both maps,
since resolveStackForDescribe consults the retained one only after the live
lookup has missed.

Greptile reported the listing could also show the stack twice. It could not:
the old order removed before it inserted, so the two maps never overlapped. The
duplicate only becomes possible with this ordering, which is why the reduction
comes with it.

The test drives 60 deletes with four concurrent listings each. It fails on every
run against the old ordering and passes on every run against this one. It pins
the retention window open through a profile: the window is measured on the test
MutableClock, which advances on every read, and the pollers would otherwise
expire the retained record themselves.

* style(cloudformation): order the Stream import with the rest of java.util

java.util.stream.Stream landed between java.util.regex and java.util.concurrent
when it was added. It now follows both, the order AGENTS.md asks for. Only the
line this branch introduced moves; the block's older irregularities are left
where they are.

* fix(cloudformation): read the live stacks before creating the deleted-stack view

Retaining a stack before removing it keeps it in at least one map at every
instant, but listStacks built both of its views up front, the retained one
first and the live one after. A ConcurrentHashMap view reflects the table at
some point at or since its own creation and is not guaranteed to reflect a
modification made after it, so the retained view, created before the retain,
need never show the stack, while the live view, created after the remove, can
already miss it. A listing landing there loses the stack in both, which is the
window the retain-before-remove ordering was meant to close. Traversing the
retained view second does not help: creation bounds the guarantee, not
traversal.

The maps are now read one after the other instead of through a concatenated
pipeline, the live one first and in full, so the retained view is created after
any remove the live pass could have missed, and therefore after the retain that
preceded it. The reduction by stack id stays: the overlap it covers is real.

No test. The fault is the absence of a JDK guarantee rather than a behaviour:
these views do in practice reflect a later put, so the old ordering passes every
time and nothing can force it not to. The existing listing-race test still
covers the retain-before-remove ordering this rests on.

The java.util.stream.Stream import goes with Stream.concat, which the change
removes.

* test(cloudformation): stop the listing-race pollers on every exit path

The pollers were stopped after awaitDeleted returned, so a throw from the delete
or the wait left four non-daemon threads spinning on listStacks for the rest of
the run. That holds the test JVM open and buries the failure that caused it
under a hang, which is a far worse thing to debug than the failure itself.

Shutdown moves into a finally, so a failing delete stops them on its way out.
Each join is bounded and a thread still alive afterwards is interrupted and
recorded, with the poller loop now checking its own interrupt flag so that
interrupt is not merely decorative. The check that they all stopped is asserted
after the try and never inside the finally, where it would replace whatever the
delete threw with its own failure. The threads are daemons as a backstop, so a
future edit that throws somewhere nothing throws today still cannot wedge the
suite.

Also replaces an assertTrue(false, ...) in the wait helper with fail(...), which
says the same thing and reads as what it is. Noted here rather than slipped in.
2026-09-23 18:01:55 -05:00
Allen Sanborn 97a2a08e1f feat(lambda): deliver asynchronous invocation results to configured destinations (#4247)
* feat(lambda): deliver asynchronous invocation results to configured destinations

An event invoke configuration was stored and returned faithfully but never
applied, so a function with an OnSuccess or OnFailure destination computed its
result and the emulator dropped it. A CDK application that carries a function's
output on to a bus, as the Loan Broker sample does with an EventBridge
destination, saw nothing arrive.

An Event invocation now hands its result to AsyncInvokeDestinationRouter, which
delivers the invocation record AWS sends to all four destination kinds, routed
by the service in the destination ARN: an EventBridge event bus, an SQS queue,
an SNS topic, and another Lambda function. On a bus the record is the event
detail, under the source "lambda" and the detail type "Lambda Function
Invocation Result - Success" or "... - Failure", so a rule matching
detail.responsePayload.<field> sees the function's own response where AWS puts
it. A function error routes to OnFailure with a condition of RetriesExhausted, a
responseContext.functionError, and the error as the responsePayload.

The router is its own bean and reaches its collaborators through Instance
lookups because the dependency graph runs the other way: SnsService invokes its
Lambda subscribers and EventBridgeInvoker its Lambda targets, so injecting
those services into LambdaExecutorService eagerly would close a CDI cycle. The
lookup happens per delivery, which is also when a destination is first known to
exist, so a function without one costs a single map read. Delivery runs on the
invocation's pool thread under the destination account's request scope, and a
destination that rejects the record is logged: the caller was answered with 202
long before, and has nowhere to receive a late failure.

Retries and event age are still not applied, so a failure reaches its
destination once and approximateInvokeCount is always 1. The docs say so.

* fix(lambda): read an event invoke configuration as the function's own account

The configuration store is account-aware: PutFunctionEventInvokeConfig writes
into the caller's partition, keyed by that account. findEventInvokeConfig is
called from the asynchronous invoke pool, which carries no request context, so
the read fell back to the default account. A function in any other account
therefore looked as though it had no configuration and its destination was
silently skipped, with nothing logged, because having no destination is the
ordinary case this path is built to return quickly.

The read now runs under the function's owning account, taken from the function
itself and falling back to the account in its ARN, the same way the other
background workers re-establish an account before touching an account-aware
store.

* fix(lambda): bound a Lambda destination chain that leads back into itself

A function whose OnSuccess or OnFailure destination is a Lambda function, and
whose chain of those leads back to a function already in it, invoked forever.
Real AWS is not unbounded here either: recursive loop detection halts such a
chain after about sixteen invocations, so looping without end was a deviation
and not merely a hazard, and on a laptop it is a worse one than on AWS.

The number of destination hops that reached an invocation is now carried with
it, from the router through invokeArnFromDestination and into the executor, and
a Lambda destination at the sixteenth hop is dropped with a warning naming the
function the chain started from. A ThreadLocal, which is how the EventBridge
invoker bounds bus-to-bus forwarding, cannot serve here: every hop is an Event
invocation and so runs on a different pool thread.

The bound applies to Lambda destinations alone, the only kind that re-enters
this path. A queue, topic or bus at the last hop is still delivered, since it
ends the chain rather than extending it.

* docs(lambda): state the destination limits in the service docs

The alias constraint was recorded only in findEventInvokeConfig's javadoc, which
serves a maintainer reading the code and not a user reading the service docs,
and AGENTS.md asks for an intentional deviation to be documented. A destination
configured on an alias is not found, because the lookup matches the version the
invocation ran; $LATEST and an explicit version both work, and the CDK onSuccess
and onFailure properties store theirs under $LATEST.

Records the Lambda destination chain bound alongside it, so both limits of this
feature are in one place.

* refactor(lambda): make the destination routing switch an expression

AGENTS.md asks for switch expressions over switch statements without
qualification. The routing switch was a statement whose arms fell through to a
shared log line, with two of them returning early to skip it. Each arm now
yields whether the record was delivered and the log line is guarded on that,
which also removes the two returns hidden inside the arms.

The Lambda arm moves into its own method so its chain-bound check reads as a
condition on delivery rather than a second exit from the switch. No behaviour
changes: a record dropped for an unsupported ARN or for reaching the chain bound
is still logged at warn and still leaves the debug line unwritten.

* fix(lambda): carry the function and destination as event resources, and say S3 is not delivered

Two parity gaps against the capturing-records page, both found in review.

putOnEventBus set no Resources. AWS fills the event's resource field with the
invoked function and the destination, and EventBridgeService already emits the
member and matches rules against it (buildEventEnvelope reads entry Resources at
:1041 and writes `resources` at :1064; matchesPattern reads it at :894). Without
it a rule whose pattern matches on `resources` never fires -- the field arrives
empty rather than absent, so the pattern does not match and the record is dropped
at the bus rather than at the destination. Rules matching on `detail`, which is
the case the tests cover, are unaffected, which is why it stayed invisible.

The docs claimed all four destination kinds are supported. AWS has five: an S3
bucket, on failure only. The router keys on the service in the destination ARN
and has no s3 arm, so such a record reaches the default arm and is dropped with a
warning. That is the deploys-green-nothing-arrives shape this branch exists to
remove, so it is now a third bullet in the limits list rather than an omission,
and the opening sentence says four of five instead of all four.

The Resources test is measured killing a mutant: with the entry.put removed it
fails with "was: null", which is the defect verbatim.

* docs(lambda): correct the pre-fix mechanism, and scope the hop bound honestly

Two corrections from review, both to things this branch asserted.

The Resources javadoc and its test comment said the member "arrives empty
rather than absent, so the pattern simply does not match". It was absent, and
the route is worse than a mismatch: matchesPattern casts event.get("Resources")
to an ArrayNode unconditionally (EventBridgeService.java:894), so an absent
member throws NPE, the surrounding catch swallows it, and it is logged as
"Failed to parse event pattern" and reported as no-match. The record is dropped
at the bus and the log blames the caller's pattern. SesEventPublisher.java:215
already documents the same shape in almost the same words.

The limits list said a chain "stops at 16 hops" without qualification. The bound
is keyed on the destination being a Lambda ARN, so a cycle that leaves and
re-enters Lambda another way is not bounded at all: SnsService.java:1688 and
EventBridgeInvoker.java:109 each start a fresh chain at zero, so a topic that
fans back to the function, or a bus rule targeting it, loops forever. With
CallerRunsPolicy on the async executor that grows the stack once the queue
saturates rather than just spinning.

The code fix needs the depth threaded through both re-entry points, so it is
filed rather than done inline. The docs no longer claim what the code does not
do, which is the half that must not wait.

* fix(lambda): always emit millisecond precision in the record timestamp

Instant.toString() emits micro or nanosecond precision on JDK 9+, and emits no
fractional part at all when the nanos are zero. AWS always emits milliseconds
(2019-11-14T18:16:05.568Z), so a consumer parsing the record with a fixed .SSS
pattern breaks on the whole-second case. Same formatter shape as
ElasticBeanstalkQueryHandler, which already had this problem.

The test is deterministic on purpose. An assertion that only formats now() is
passed by truncatedTo(MILLIS).toString() about 999 runs in 1000, since that
differs only on an exact second -- I measured exactly that: the first version of
this test let the near-miss through, 16/16 green. formatRecordTimestamp is
package-private so the deciding input can be pinned, and the mutant now fails
with "expected 2019-11-14T18:16:05.000Z but was 2019-11-14T18:16:05Z".

LambdaEventInvokeConfigAccountScopeTest becomes an IntegrationTest. The earlier
round dismissed the conformance warning as a rule the repo ignores; review
counted it, and it does not: 778 of 922 @QuarkusTest classes follow the naming,
and 26 of 29 within services/lambda. The dismissal was wrong.
2026-09-23 18:32:06 -04:00
Kurt McAlpine a574a6d01f fix(docker): keep host network mode for containers that publish ports (#4192)
* fix(docker): keep host network mode for containers that publish ports

A spec with port bindings skipped HostConfig.NetworkMode on create and
connected to the network after start, which Docker refuses for host,
none and container:<id>. Such containers silently stayed on the default
bridge with a published port, so an OpenSearch domain under
FLOCI_SERVICES_DOCKER_NETWORK=host stopped listening on the host's :9200
once domains always published a host port (#2798).

Namespace network modes now always go on the HostConfig, their port
bindings are dropped since Docker publishes nothing there, and the
post-start connect is skipped. A host-network container's endpoint
resolves to localhost when Floci itself runs in Docker instead of a
null host.

* fix(docker): resolve container:<id> endpoints through the owning container

resolveEndpoint only special-cased host, so a container sharing another
container's network namespace fell through to resolveContainerIp, which
has no network to read, and Floci stored a null host for it. The
endpoint now follows HostConfig.NetworkMode to the owning container:
localhost when that container is on the host network, otherwise its IP
on the Docker network. Reading the mode from the inspect rather than the
spec also covers adopted containers.

* test(docker): pass portBindingHostIps to the network test spec helper

ContainerSpec gained a 28th component in #4175 after this branch was cut, so the spec(...) helper added here no longer compiled once rebased onto main.
2026-09-23 18:31:09 -04:00
Niels Kootstra ea60f70ad2 fix(apigatewayv2): cap HTTP_PROXY integration responses at the 10 MB payload quota (#4226)
HttpProxyInvoker read the whole integration response into memory with no
limit. Stop reading once a response passes API Gateway's 10 MB payload quota
and return 413 Request Entity Too Large, for Content-Length, chunked and
close-delimited bodies alike. REST and HTTP APIs share this invoker, so both
get the limit.
2026-09-23 17:08:11 -04:00
yarammanasa2001-maxandyarammanasa2001-max 317e007942 fix(redshift): fix Redshift emulation gaps found against the Terraform AWS provider (#3987)
* fix(redshift): add SnapshotArn and SnapshotCreateTime to snapshot responses

DescribeClusterSnapshots and CreateClusterSnapshot never populated
SnapshotArn or SnapshotCreateTime — the Snapshot model didn't carry
either field. Real AWS returns both, and callers that filter on
recovery-point age or restore by ARN have nothing to key off.

SnapshotArn reuses the existing snapshotArn(clusterIdentifier,
snapshotIdentifier) helper (already used for tagging, just never
attached to the model). SnapshotCreateTime is captured via Instant.now()
at snapshot creation and formatted with the same DateTimeFormatter.ISO_INSTANT
convention already used elsewhere in this file for Expiration/CreateTime.

Both elements are omitted from the XML response when the snapshot predates
this field (an on-disk store surviving an upgrade), matching how the other
optional elements in buildSnapshotXml already degrade.

* feat(redshift): support DescribeLoggingStatus, EnableLogging, DisableLogging

The Upbound Terraform provider's redshift Cluster resource calls
DescribeLoggingStatus on every observe cycle, unconditionally, as part
of its standard drift check across all configurable cluster aspects —
not something a caller opts into. Without it, every cluster's observe
step failed outright with InvalidAction, and the cluster could never
report Synced/Ready even once fully created and available.

Adds the three logging actions as a set, matching how EnableLogging/
DisableLogging/DescribeLoggingStatus share one response shape in the
real API. No log delivery is emulated — only the configuration a caller
set (enabled, bucket, prefix) is tracked and returned, the same
graceful-scope choice already made for snapshot dump handling.

XML wrapper element names (DescribeLoggingStatusResult, EnableLoggingResult,
DisableLoggingResult) were verified against aws-sdk-go-v2's own generated
deserializer, not assumed from the docs.

* fix(redshift): default parameter group and MultiAZ on cluster responses

Terraform provider's resourceClusterRead indexes ClusterParameterGroups[0]
and requires MultiAZ to be exactly "enabled" or "disabled" unconditionally.
Real AWS always attaches a default parameter group and never returns MultiAZ
blank; floci previously omitted both, causing a panic and then a read error
in the provider.

* fix(redshift): resolve RestoreFromClusterSnapshot by SnapshotArn too

Real AWS lets callers restore from either SnapshotIdentifier or
SnapshotArn. Terraform's aws_redshift_cluster resource populates only
snapshot_arn when that's the field configured, so the request carried
no SnapshotIdentifier at all and floci NPE'd looking one up as null.

* fix(redshift): use the real AWS error code for missing subnet groups

RedshiftService threw "ClusterSubnetGroupNotFound", but AWS's actual
code is "ClusterSubnetGroupNotFoundFault" and the Terraform AWS
provider's generated deserializer type-matches on that exact string to
recognize "doesn't exist yet, create it". A bare code fell through to
an unclassified error, so the provider never got past Observe and a
cluster subnet group could never be created through Crossplane.

* fix(redshift): address PR review feedback

Validate SnapshotArn (400 on malformed/missing, account and region check),
honor ClusterParameterGroupName and MultiAZ, seed the default parameter
group, allow CloudWatch EnableLogging, return 400 for missing subnet
groups, sync docs, and add tests.

* test(redshift): fix merge of logging tests with main's IAM role tests

* refactor(redshift): share logging response helper and trim comments

* fix(redshift): restore testDisableLogging's closing brace lost in the main merge

Merging main's snapshot-copy-grant tests (#3628) next to the logging
tests dropped the closing brace of testDisableLogging and the @Test
annotation on describesSnapshotCopyGrants, so the latter body ran
inside the former and the file failed to compile.

* docs(redshift): resync action table order after the main merge

make docs-sync moved ModifyCluster after the snapshot-copy-grant rows
main added, matching the generator's canonical action order.

---------

Co-authored-by: yarammanasa2001-max <271440416+yarammanasa2001-max@users.noreply.github.com>
2026-09-23 16:59:27 -04:00
XuJian 22c56157ee feat(ecr): advertise TLS registry URIs on opt-in (#4252) 2026-09-23 16:46:10 -04:00
jwoa95 eb039eb71c feat(cognito): serve managed login for native users with PKCE (#4238)
GET /oauth2/authorize with identity_provider=COGNITO, or none, now signs
in the pool's own users through managed login instead of requiring a
federated provider. It redirects to a plain sign-in form at
/cognito-idp/login (/login on a custom domain), which checks the
password as USER_PASSWORD_AUTH does, sets a pool-scoped `cognito`
session cookie and redirects to the callback with code and state. A
browser with a live session skips the form.

/oauth2/token enforces PKCE (S256 only, as on AWS) when the
authorization request sent a code_challenge, for managed login and
federated sign-in alike, and refuses a code_verifier for a code issued
without one (RFC 9700). The ID token carries the request's nonce.

/cognito-idp/logout (/logout on a custom domain) ends the session and
redirects to a registered LogoutURL, or back to the sign-in form for
the redirect_uri form of the request. Discovery advertises
code_challenge_methods_supported.

Closes #4218
2026-09-23 16:35:35 -04:00
jwoa95 7e4d4dafae feat(rds): pause and resume Aurora Serverless v2 clusters at zero capacity (#4232)
An Aurora cluster whose ServerlessV2ScalingConfiguration has MinCapacity 0
now freezes its database container with docker pause once nothing has used
it for SecondsUntilAutoPause, and resumes it for the next client, as Aurora
Serverless v2 does.

Every client of a backend container holds a lease while it uses it: each
connection through the auth proxy (cluster, reader, instance and RDS Proxy
endpoints), each RDS Data API call and open transaction, and each command
Floci runs inside the container. A client that reaches a paused cluster is
held, not refused, until the container runs again, after
FLOCI_SERVICES_RDS_AURORA_RESUME_DELAY_MILLIS (default 0; Aurora takes
about 15000). A connection that arrives while the pause is under way
cancels it.

While paused, the cluster and its instances stay available,
DescribeEvents reports RDS-EVENT-0370 to 0374 for each instance, and
ServerlessDatabaseCapacity, ACUUtilization and CPUUtilization report 0
once a minute. A cluster with a provisioned instance, in a global database
or behind an RDS Proxy never pauses. A ModifyDBCluster that changes
MinCapacity or SecondsUntilAutoPause resumes a paused cluster. Stopping,
deleting or rebooting a cluster, shutting Floci down and resetting its
state thaw a paused container first.
FLOCI_SERVICES_RDS_AURORA_AUTO_PAUSE_ENABLED=false keeps every cluster
running.

Closes #4219
2026-09-23 16:25:41 -04:00
Niels Kootstra addee350ba fix(kinesis): expire shard records past the stream's retention period (#4224)
* fix(kinesis): expire shard records past the stream's retention period

Shards kept every record for the life of the stream, so memory grew without
bound and TRIM_HORIZON returned records older than the retention period.

Drop records older than the retention period when a shard is written or read,
including right after DecreaseStreamRetentionPeriod. Continuation and LATEST
iterators now resume by sequence number instead of by array index, so
trimming older records does not make a consumer skip data. Index-based
iterators issued by earlier versions, such as persisted Firehose checkpoints,
are offset by the number of records pruned since.

* fix(kinesis): read a shard's records and pruned count under one lock

A legacy index iterator is offset by the number of records pruned since
it was issued. The records and the count were read in two separate lock
acquisitions, so a prune between them left the count ahead of the
snapshot and the consumer resumed too early, replaying records it had
already read. Take both from one snapshot.

* chore: rerun CI

* test(kinesis): pin the service clock instead of stretching retention

The JSON handler timestamp tests raised retention to 8760 hours so a
fixed 2026 arrival timestamp survived pruning against the wall clock,
which would start failing a year later. Build those services with a
clock fixed just after the literal instead, and restore the fixed
2026-01-01 base in millisBehindLatestIsTimeDeltaWhenBatchLimitHit.
2026-09-23 14:05:10 -04:00
jwoa95 f8f1b56ce9 feat(cloudfront): forward viewer headers, cookies and query strings per origin request policy (#4230)
Custom origins only ever received the origin custom headers: the serving
controller built each origin request from them alone and dropped the
query string, whatever cache policy, origin request policy or legacy
ForwardedValues the matched cache behavior carried.

CloudFrontOriginRequestBuilder now decides what reaches the origin. With
a cache policy it forwards the union of the cache policy's
ParametersInCacheKeyAndForwardedToOrigin and the origin request policy
(every HeaderBehavior, CookieBehavior and QueryStringBehavior value).
Without one it applies legacy ForwardedValues, including the headers
CloudFront forwards by default. It also adds what CloudFront always
sends: Host for the origin unless the viewer Host is forwarded,
User-Agent "Amazon CloudFront", X-Forwarded-For, Via and X-Amz-Cf-Id.
Authorization is kept on the methods CloudFront does not cache, and
CloudFront-Forwarded-Proto, -Viewer-Address and -Viewer-Http-Version are
generated when a policy asks for them. Origin custom headers now replace
every same-named viewer header, and signing parameters are still never
forwarded.

The eight AWS managed origin request policies are served by their AWS
IDs and cannot be updated or deleted. With no origin request policy and
nothing selected by the cache policy, no cookies or query strings are
forwarded, as before.

Closes #4217
2026-09-23 13:59:53 -04:00
jwoa95 4ca0e085cd feat(cloudfront): serve POST, PUT, PATCH and DELETE viewer requests (#4229)
The serving controller only declared GET, HEAD and OPTIONS, so a write
method on a distribution host matched the resource class but no method
and fell through to a bare 405, even when the cache behavior allowed all
seven methods.

POST, PUT, PATCH and DELETE are now served under the same AllowedMethods
check (403 "Invalid method." otherwise) and the same trusted key group
enforcement as the read methods. Custom origins receive the method, the
viewer request body, its Content-Type and its Authorization header, with
Content-Length taken from the body; GET and HEAD still reach the origin
without Authorization, as on CloudFront. In-process S3 origins answer
these methods with 403 Access Denied instead of forwarding them, which
is documented.

Closes #4216
2026-09-23 12:24:40 -04:00
Simone Primarosa 188542e67f feat(ssm): seed the EKS optimized AMI parameter paths (#4191) 2026-09-23 12:00:12 -04:00
Abhigya f2d6710b24 fix(rds): apply DBInstanceClass, AllocatedStorage and EngineVersion on ModifyDBInstance (#4214)
* fix(rds): apply DBInstanceClass, AllocatedStorage and EngineVersion on ModifyDBInstance

ModifyDBInstance parsed the password, IAM auth, subnet group, option group,
security groups and the backup and monitoring settings, but never read
DBInstanceClass, AllocatedStorage or EngineVersion. A resize or an engine
upgrade returned 200 while DescribeDBInstances kept reporting the values the
instance was created with, so a caller that diffs its configuration against a
read-back saw the same pending change on every run.

The three members move into a DbInstanceScalingChanges record that the handler
fills from the request and the service applies, with the rules the AWS API
reference states for them:

- AllocatedStorage below the current size fails with InvalidParameterCombination
- an increase under 10% is rounded up to 10% greater on PostgreSQL, MySQL and
  MariaDB, and taken as given on SQL Server
- the same size is not a change and is left alone
- a different major EngineVersion needs AllowMajorVersionUpgrade

Floci applies the change immediately rather than deferring it to the preferred
maintenance window: it runs no maintenance window and models no
PendingModifiedValues, so a deferred change would never be applied at all.

* fix(rds): reject a ModifyDBInstance scaling change before applying any member

The scaling members were validated as they were assigned: the class was set,
then the storage was resolved, which can refuse a shrink, then the engine
version was checked, which can refuse a major upgrade. The instance a modify
works on is the stored object rather than a copy, so a request refused at the
second or third step had already written the earlier ones, and a read-back
reported a class the 400 said it never got.

The checks now run in resolveFor, ahead of every setter in modifyDbInstance,
including the password rotation that reaches the running container. applyTo is
left as pure assignment of an already-resolved record.
2026-09-23 11:41:15 -04:00
Allen Sanborn daecc6da17 fix(route53resolver): CreateResolverEndpoint reads IpAddresses, as AWS names it (#4180)
* fix(route53resolver): CreateResolverEndpoint reads IpAddresses, as AWS names it

CreateResolverEndpoint read its address list from a member called
IpAddressRequests. AWS names that member IpAddresses; the list's SHAPE is named
IpAddressRequest, which is where the wrong wire name came from.

The distinction is not cosmetic. Every AWS SDK, the CLI and the Terraform
provider serialise IpAddresses, and the CLI refuses to send IpAddressRequests at
all because no such member exists in its model. So the operation dispatched and
no real client could call it:

  {"Name":"ep","Direction":"INBOUND","SecurityGroupIds":["sg-1"],
   "IpAddresses":[{"SubnetId":"subnet-1"}]}
  -> 400 InvalidParameterException: IpAddressRequests is required

That is the worst shape a gap can take, because every cheap check says the
service works: it is in the service directory, /_floci/health lists it, an
operation-name grep finds it, and a does-it-route probe passes.

Reads IpAddresses, still accepting the old spelling so anything written against
the previous behaviour keeps working — the existing CustomResources tests use it
and are untouched. The error message names only the AWS member, since it is the
sole hint a caller gets. The idempotency record keeps its internal member name
deliberately: renaming it would make every endpoint stored by an earlier build
read as absent, which that code reports as a replay conflict.

Tests: the AWS member is accepted, the legacy one still is, a retry that switches
between the two spellings is not a conflict, and the missing-member error names
IpAddresses. 55 Route53Resolver tests pass.

Reported as #4108. Found while confirming that an earlier finding — Route53Resolver
absent entirely — had been fixed upstream: the probe written for it asserted only
that the call dispatches, which is what let this hide behind it.

* style: use -- rather than an em dash in added prose

AGENTS.md forbids em dashes in all content and the conformance check flags them.
Two in javadoc lines this branch added. Comments only, no behaviour change.

* docs(route53resolver): name the list shape correctly, and trim the member note

The list shape is `IpAddressesRequest`; `IpAddressRequest` is the shape of each
element, and that element name is where the wrong wire spelling came from. Both
the service doc and the Javadoc on ipAddressesOf had it as the list's own name.

The Javadoc also carried a paragraph on how the bug stayed hidden, which the PR
description already covers at length. What a reader of this method needs is the
member name and the legacy alias, so that is what is left.
2026-09-23 11:20:50 -04:00