Commit Graph
716 Commits
Author SHA1 Message Date
Allen SanbornandPriamo 25a63eef9e fix(ssm): page GetParametersByPath and GetParameterHistory with MaxResults and NextToken (#6268)
* fix(ssm): page GetParametersByPath and GetParameterHistory with MaxResults and NextToken

Both actions ignored MaxResults and NextToken and returned every item.
Page them with Pagination.paginate, as DescribeParameters already does.

MaxResults is validated against the SSM model: 1-10 for
GetParametersByPath and 1-50 for GetParameterHistory, rejected with
ValidationException like DescribeParameters. A bad NextToken is
InvalidNextToken. Omitting MaxResults still returns everything, so
callers that never follow NextToken keep working.

History is paged by a zero-padded version cursor so version 10 sorts
after version 9.

Closes #6254

* fix(ssm): reject wrongly typed MaxResults and NextToken when paging parameters

A string MaxResults or a numeric NextToken was coerced instead of failing
to deserialize. Read both through the SSM deserialization helpers so they
fail with SerializationException, as other SSM fields do.

* fix(ssm): refuse a parameter page token minted for another listing

GetParametersByPath and GetParameterHistory tokens were bare cursors, so a
token from another operation, path or parameter was read as a position
in this listing and could skip results or return an empty page. Bind
each token to its operation, region and selection (path and Recursive,
or parameter name) and answer a mismatch with InvalidNextToken.

* test(ssm): follow GetParametersByPath and GetParameterHistory pages with SDK paginators

* fix(ssm): read pagination fields before listing parameters or their history

GetParameterHistory looked the parameter up before reading MaxResults and
NextToken, so a missing parameter answered ParameterNotFound for a request
whose pagination fields failed to deserialize or validate. Read and
validate both fields first in GetParameterHistory and GetParametersByPath.

* fix(ssm): refuse path and history page tokens in DescribeParameters

DescribeParameters decodes its token as a bare name cursor, so a
GetParametersByPath or GetParameterHistory token was read as a name and
could return a truncated or empty page. Refuse a token that decodes to
either namespace with InvalidNextToken. Its own tokens are unaffected:
the namespaces contain a colon, which AWS does not allow in a name.

* fix(ssm): bind parameter page tokens to the requesting account

Parameter storage is partitioned by account, but GetParametersByPath and
GetParameterHistory tokens named only the region and selection, so a token
minted in one account was accepted in another and skipped its entries.
Add the request account to both token namespaces.

* style(ssm): keep each javadoc on the method it describes

* fix(ssm): page DescribeParameters through the shared paging helpers

DescribeParameters repeated the MaxResults range check word for word and
decoded its token a second time to refuse GetParametersByPath and
GetParameterHistory tokens. Route it through pageRequest and page under a
namespace of its own, keeping its default page of 50. Its tokens are now
bound to the account and region like the other two listings, and a
wrongly typed MaxResults or NextToken fails to deserialize as theirs do.

Also cover resuming GetParametersByPath after the parameter that ended
the previous page is deleted.

---------

Co-authored-by: Priamo <pgermosen@gmail.com>
2026-10-24 14:27:22 -04:00
Jimmy Liu Jia be7b0ed62b fix(s3): expose bucket policy status (#6397)
* fix(s3): expose bucket policy status

* fix(s3): align bucket policy status response

* test(s3): verify policy status through SDK and IAM

* refactor(s3): reuse bucket policy lookup for status
2026-10-24 13:49:10 -04:00
jwoa95 346a7f4526 fix(elasticache): terminate required TLS at cache proxies (#6227) 2026-10-24 09:31:10 -04:00
TiM 39f37c21ff fix(kinesis): stop routing records to closed shards (#6414)
* fix(kinesis): stop routing records to closed shards

Repeated resharding can leave a selected shard and both of its direct children closed. `selectShard` currently falls back to that closed parent, so a successful write can append after the shard's ending sequence number.

- Follow both parent links through closed intermediate shards to an open descendant, with deterministic breadth-first order and visited shard IDs.
- Reject an unreachable open destination before appending. Keep the producer lock, ordinary-key hash selection, ExplicitHashKey routing, and actual returned ShardId.
- Cover repeated splits, split/merge lineage, malformed graphs, handler success/failure results, and Java SDK writes after resharding.

* test(kinesis): protect breadth-first descendant preference

Add a mixed-depth split topology so routing to the still-open direct child is distinguished from depth-first traversal through its closed sibling.

* test(kinesis): cover both mixed-depth shard layouts

Parameterize the split child so the direct-child preference regression rejects depth-first traversal under either child ordering.

* fix(kinesis): preserve the open-shard routing fast path

Delay the lineage snapshot until the selected shard is closed, avoiding a shard-list copy on ordinary open-shard writes. Name expected descendant destinations in routing fixtures and cover an unrelated open shard preceding the reachable child.
2026-10-24 08:51:07 -04:00
TATSUNO “Taz” Yasuhiro 023cb8341b feat(dynamodb): write export files and descriptions as AWS does (#6400)
* feat(dynamodb): write export files and descriptions as AWS does

* fix(dynamodb): check export prefixes as AWS does

* fix(dynamodb): abort the upload of an export file that fails

* chore(dynamodb): share the timed id of backups and exports

* chore(dynamodb): let tests run exports on the calling thread
2026-10-24 08:38:15 -04:00
Kenshin Okinaka 5a9f9cbbd6 feat(ses): add the v2 reputation entity operations (#6407)
* feat(ses): add the v2 reputation entity operations

Implement ListReputationEntities, GetReputationEntity,
UpdateReputationEntityPolicy and UpdateReputationEntityCustomerManagedStatus.
Every tenant is a reputation entity referenced by its full ARN. The policy
and the customer-managed status live on the tenant record, and the status
is the tenant's aggregate SendingStatus. A tenant whose status is DISABLED
is now refused on SendEmail and SendBulkEmail with MessageRejected.

Shapes, messages and validation order follow probes against real SES.

* test(ses): surface unexpected tenant cleanup failures in the reputation compat test
2026-10-24 08:16:23 -04:00
Andre Kurait 5b24703815 fix(ec2): normalize subnet IPv6 CIDRs and expose zone network borders (#6387)
Normalize subnet IPv6 responses and expose regional availability-zone network borders. Keep the read-only regional test at a unique execution order.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
2026-10-23 20:27:03 -04:00
Andre Kurait 18910223e1 fix(route53): normalize record name case identity (#6374)
Normalize Route53 record identity without mutating records before batch commit. Reuse the shared ASCII record-name normalization for alias comparison, as requested in maintainer review.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
2026-10-23 16:43:25 -04:00
Vũ Thế Huy 38c641ec7e feat(redshift-data): support client token idempotency (#6343)
* feat: support Redshift Data API client token idempotency

* test: verify Redshift Data API retry compatibility

* fix: address Redshift Data admission and cleanup races

* refactor(redshift-data): remove implicit in-memory receipt constructor
2026-10-23 14:36:33 -04:00
Vũ Thế Huy 1b8548a0af feat(redshift): create final snapshots before deleting clusters (#6346)
* feat(redshift): create final snapshots before deleting clusters

* fix(redshift): clean failed dumps and scope snapshot locking

* fix(redshift): default manual snapshot retention and fix Spectrum cleanup
2026-10-23 14:06:47 -04:00
TATSUNO “Taz” Yasuhiro 7e6439cf86 feat(lambdaweb): check the execution role as AWS does (#6347)
* feat(lambdaweb): check the execution role as AWS does

AWS refuses a revision whose execution role is in another account with
403 AccessDeniedException. It refuses a role that does not exist or does
not trust lambda.amazonaws.com with 400 ValidationException, and that
check gives no aws:SourceAccount or aws:SourceArn. An environment
assumes the role with the function as its source, and a request gets
502 Platform.CannotAssumeRole when Lambda can no longer assume it.

* fix(iam): match a wildcard principal and the service keys in service trust

{"AWS": "*"} lets Lambda assume a role, and a Deny on it refuses the role.
Lambda sets aws:PrincipalIsAWSService to true and aws:PrincipalServiceName
to its principal when it checks the role and when an environment assumes it.

* fix(lambdaweb): answer CannotAssumeRole when the role goes during a start

A role deleted after the trust check gave the container the account's
placeholder credentials. AWS answers 502 Platform.CannotAssumeRole for a
deleted role.
2026-10-23 10:50:14 -04:00
Isak Lindbeck 756e72273c feat(msk): support SCRAM secret associations (#6221)
* feat(msk): add SCRAM secret association metadata APIs

Add association, listing and disassociation endpoints with persisted metadata and secret validation. Broker user management and reconciliation follow separately.

* test(msk): enhance cleanup logic in MskTest for SCRAM secrets and KMS keys

* fix(msk): accept resolved secret ARNs with generated suffixes

* fix(msk): reject KMS alias ARNs for SCRAM secrets

Closes #6229

* fix(msk): reject partial secret ARNs with operation-specific errors

* fix(msk): clean up SCRAM associations for deleted clusters

Add scheduled, account-aware cleanup of association left after cluster delete

* fix(msk): allow disassociation of deleted SCRAM secrets
2026-10-23 07:18:33 -04:00
Mario Toffia ba353021e1 feat(sqs): publish AWS/SQS queue metrics to CloudWatch (#6280)
* feat(sqs): publish AWS/SQS queue metrics to CloudWatch

Every active queue now reports the AWS/SQS metrics once a minute on the
QueueName dimension: the depth gauges, ApproximateAgeOfOldestMessage, the
send, receive, delete and empty-receive counters, SentMessageSize, and for
FIFO queues the in-flight groups and deduplicated sends. The samples follow
what SQS sends on AWS, so alarms, GetMetricData and GetMetricStatistics see
queue metrics without PutMetricData.

The CloudWatch metric store is now journaled under persistent mode, as the
CloudWatch Logs event store is, since it takes a write per metric per active
queue every minute.

Closes #6275

* fix(sqs): stamp queue metrics with the minute that ended

The publisher now ticks just after each minute boundary and stamps its
samples with the minute that ended, so a call counts in the minute it was
made instead of the minute of a startup-relative tick. A queue whose write
fails no longer stops the others, and the log names it. A queue deleted and
created again between the snapshot and the lookup is skipped instead of
reporting the old queue's depth under the new one.

* fix(sqs): bound AWS/SQS metric history and finish the tick on shutdown

The publisher now drops AWS/SQS datapoints older than the 15 days AWS keeps
one-minute data, once an hour, so the history it generates for an active
queue stays bounded. On shutdown it stops before the storage flush and waits
for a running tick, so the last minute is not written after the store closed.

* test(sqs): keep the scheduled metrics tick out of the test run

The acceptance test publishes its own ticks, but the scheduled one could
still stamp the test queue's depth into a complete period newer than them,
since a tick stamps the minute that just ended. floci.services.sqs.
cloudwatch-metrics-enabled now turns the tick off, and the test
configuration does, as it does for the S3 lifecycle sweep. It also lets a
user opt out of the AWS/SQS metric volume.

* test(sqs): build the metrics test's queue service with SqsServiceFactory
2026-10-23 06:57:51 -04:00
Priamo Germosen 63d577a245 feat(emr-serverless): tag job runs and report their attempts (#6297)
TagResource, UntagResource and ListTagsForResource now take job run ARNs
(.../applications/<id>/jobruns/<id>), which the model's ResourceArn
allows ("the supported resources are Amazon EMR Serverless applications
and job runs"). They work on the tags StartJobRun stores, so GetJobRun
reports the current set, under the same rules as an application's: at
most 50 tags, no "aws:" prefix. An ARN must be the run's own, so one of
another application or account names nothing, and once an application
is deleted its runs' ARNs name nothing, as its own ARN already does. A
session ARN, which the pattern also allows, now answers
ResourceNotFoundException rather than ValidationException, as sessions
are not emulated.

ListJobRunAttempts (GET .../jobruns/{jobRunId}/attempts) and GetJobRun's
attempt parameter report attempts. Nothing runs, so no run fails and
none is retried: every run is one attempt, number 1, created and updated
with the run. GetJobRun, ListJobRuns and ListJobRunAttempts carry it.
GetJobRun with attempt 1 or none returns the run; another attempt
answers ResourceNotFoundException, in Floci's words, as no source shows
AWS's answer for an attempt a run never made, and leaves the run as it
was.

Also from the #6202 review:

- From release emr-7.11.0 a BATCH run's executionTimeoutMinutes must be
  1 to 10080. The model: "the maximum value is 10080 minutes (7 days)
  starting with Amazon EMR release 7.11. Setting a value of 0 to disable
  the timeout is no longer supported for BATCH mode job runs." Earlier
  releases and STREAMING runs keep 0 to 1,000,000. No source gives the
  error; ValidationException, in Floci's words. The check runs before
  auto-start, under the application's lock, so a refused run leaves the
  application as it was.
- ListJobRuns refuses a state or mode that does not exist and more than
  8 states, and ListApplications a state that does not exist and more
  than 7, with the framework ValidationException. A typo listed nothing
  before. ListApplications' maxResults outside 1 to 50 now answers the
  same framework message, joined with any states violation.
- EmrServerlessRegionIntegrationTest uses EmrServerlessRequests, which
  gains tagsPath, and pins a job run ARN across Regions;
  EmrServerlessTagIntegrationTest moves onto the same helpers.

The enum and range violations are now SmithyValidationErrors.notInEnum,
notAllInEnum and outOfRange, which EMR Serverless uses.

Part of #6046 (part 9).
2026-10-22 22:22:03 -05:00
Andre Kurait 6bc598fbfd feat(lambda): add provisioned concurrency configuration APIs (#6317)
Add the requested control-plane stage: Put/Get/Delete validation, persistent desired configuration, qualified IAM resources, and cleanup on version, alias, and function deletion. Share the function concurrency lock with reservation changes. Runtime initialization and invocation routing remain separate.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
2026-10-22 23:19:11 -04:00
Alessandro Lattao 1f25fd88cf fix(dsql): take TLS started with no SSLRequest, as DSQL does (#6296)
DSQL's own connectors, and libpq's and pgjdbc's sslnegotiation=direct, start
TLS at once with no SSLRequest. The endpoint read their ClientHello as a
plaintext startup packet and refused it as not TLS.

The endpoint now reads a connection's first byte. A TLS handshake record goes
straight to the handshake with that byte handed back, and anything else takes
the SSLRequest path as before. The byte is TlsProxyServer's TLS_HANDSHAKE, now
public, the one the TLS proxy already tells TLS apart by; its peek runs on a
Vert.x socket, the endpoint's on a blocking one, so only the constant is
shared.

As DSQL does (measured, eu-west-1): the endpoint picks the ALPN protocol
postgresql whenever a client offers it, after an SSLRequest too, and none
otherwise; a direct handshake that does not end with postgresql picked
completes and the connection closes without a message.

DsqlWireClient opens TLS through one handshake helper, with an ALPN list,
after an SSLRequest (tls) or at once (direct), and signs in separately.
2026-10-22 19:47:44 -04:00
Matheus Oliveira 34f592f7e7 fix(apigateway): answer an HTTP API proxy result without a Content-Type as text/plain (#6201)
* fix(apigateway): answer an HTTP API proxy result without a Content-Type as text/plain

Measured on AWS (eu-west-1, 2026-10-19): an HTTP API answers a Lambda proxy
result that carries a body and no Content-Type header of its own with
text/plain; charset=utf-8, in both payload formats. Floci fell back to
application/json, the REST API's default, so a client that trusts the
header read a plain body as JSON.

The fallback now follows the API kind: an HTTP API answers text/plain, a
REST API keeps answering application/json.

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>

* test(apigateway): fold the Content-Type cases into the inference test

The three cases repeated the inference test's setup, route helper and
cleanup, so they join it: two results without a Content-Type in the two
payload formats, and one that names application/json. The docs say a
statusCode and a body, since a format 2.0 result without a statusCode
still takes the inferred JSON path, and the compatibility test's get
helper and parameterized name are back on one line each.

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>

---------

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-10-22 16:04:51 -04:00
Vũ Thế Huy d2f2625005 feat(redshift): add ResetClusterParameterGroup (#6230)
* feat(redshift): add ResetClusterParameterGroup

* docs(redshift): update supported operation count

* fix(redshift): validate resets and preserve legacy parameter groups

* fix(redshift): accept empty Query parameter lists
2026-10-22 15:59:54 -04:00
Priamo Germosen 1f1e5db1bc feat(emr-serverless): start, get, list and cancel job runs (#6202)
Adds StartJobRun, GetJobRun, ListJobRuns and CancelJobRun under
/applications/{applicationId}/jobruns. Job runs are metadata only, like
Glue's: a run is RUNNING from submission and settles when read. With the
new floci.services.emrserverless.job-run-duration-seconds at its default
of 0, a BATCH run is SUCCESS as soon as it starts; a positive duration
keeps it RUNNING that long, and a run that would outlast its
executionTimeoutMinutes (720 when not given) is CANCELLED at the
timeout. A STREAMING run stays RUNNING until it is cancelled.

A run on a CREATED or STOPPED application starts it, as auto-start
defaults to on; with auto-start off the run is refused. clientToken is
the idempotency token: a retry returns the original run, and the same
token with another request answers ConflictException "Request did not
match the original". CancelJobRun on a finished run answers
ValidationException "Job run is not in a cancellable state". ListJobRuns
returns the newest runs first, filtered by states, creation time and
mode, and its nextToken resumes only the listing it came from. A run
needs a jobDriver that sets exactly one of sparkSubmit and hive, as
GetJobRun's JobRun always carries one, and tags are checked before
auto-start, so a refused run leaves the application as it was.
createdBy is the caller's ARN.

Application createdAt and updatedAt now go out as epoch seconds, the
restJson1 default for the model's Date shape, as job runs do. They were
epoch milliseconds, which the Java SDK reads as the year 58774 and
botocore refuses as out of range. Auto-start rewrites updatedAt, so a
run's own submission reached the bug. Applications persisted with
millisecond timestamps read back at the same instant.

Part of #6046 (part 8).
2026-10-22 07:24:33 -05:00
Vũ Thế Huy 64718c4034 test(firehose): shorten Redshift delivery SDK test buffering interval (#6197)
* test(firehose): shorten Redshift delivery SDK test buffering interval

* test(firehose): keep Redshift delivery polling timeout at 150 seconds
2026-10-22 07:58:33 -04:00
TATSUNO “Taz” Yasuhiro da66550c70 fix(dynamodb): export the table as of ExportTime (#6132)
* fix(dynamodb): export the table as of ExportTime

* refactor(dynamodb): share the epoch seconds conversions

* fix(dynamodb): treat a table that is still being created as not found on export

* docs(dynamodb): note the writes made before point-in-time recovery is enabled

* fix(dynamodb): round timestamp inputs to milliseconds as AWS does

* fix(dynamodb): check the ListBackups time range limits

* fix(dynamodb): check the ListBackups ExclusiveStartBackupArn length

* refactor(dynamodb): reuse requireBackupSource for the export table lookup
2026-10-22 07:31:07 -04:00
Mohith f74d7a34a3 fix(sqs): page ListQueues with MaxResults and NextToken (#6222)
ListQueues ignored MaxResults and NextToken on every protocol path and
returned all matching queues without a token.

The paging now lives in SqsService, so the Query, JSON and CBOR paths
share it. It follows the API reference and the botocore model:
MaxResults must be 1 to 1000, a NextToken is returned only when
MaxResults was set and more queues remain, and without MaxResults the
response holds at most 1,000 queues and no token. Queues are ordered by
name, the token is the shared Pagination cursor under its own
namespace, and QueueNamePrefix filtering applies before paging. An
out-of-range MaxResults or an unreadable NextToken returns
InvalidParameterValue.

Fixes #6219
2026-10-22 07:13:03 -04:00
Mohith 007ac9268e fix(eventbridge): page ListRules with Limit and NextToken (#6223)
ListRules ignored Limit and NextToken and always returned every
matching rule. It now pages through the bus's rules in name order using
the shared Pagination cursor, keeping NamePrefix and EventBusName
filtering intact.

- Limit defaults to 100, the documented per-page maximum; an integral
  value outside 1 to 100, including one wider than an int, is a
  ValidationException.
- A string, boolean or fractional Limit is a SerializationException
  rather than being coerced into a page size.
- NextToken is returned only when more rules remain.
- A token Floci did not mint is rejected with HTTP 400 InvalidToken, as
  the API reference documents for a bad pagination token.

Fixes #6220
2026-10-22 07:07:10 -04:00
Alessandro Lattao 2c5415186a fix(cognito): fire the CustomMessage trigger for UpdateUserAttributes and GetUserAttributeVerificationCode (#6205)
* fix(cognito): fire the CustomMessage trigger for UpdateUserAttributes and GetUserAttributeVerificationCode

Both sent their verification codes without the CustomMessage trigger, so a
pool's function never shaped those messages and never saw the request's
ClientMetadata. They now fire it with CustomMessage_UpdateUserAttribute and
CustomMessage_VerifyUserAttribute.

Measured on Cognito, the event carries the user as stored once the request is
done: the whole update applied, and an email that must be verified before it
changes still the old one while the code goes to the new address. The message
is therefore sent once the update is stored and the user lock is released. The
trigger is synchronous, so holding the lock would also block a function that
calls the pool back for the same user until its invocation timed out, which
SignUp already avoids. Cognito keeps an update whose code it cannot deliver
and answers CodeDeliveryFailureException, and a message that cannot be sent
now does the same.

* fix(cognito): leave nothing behind when an attribute code's message is not sent

Sending an attribute code's message after the user lock opened four ways to
leave a code live that no message carried, or to fail an update already
stored. Each message is now sent on its own: one that cannot be sent has its
code withdrawn, so another can be asked for at once as on Cognito, and the
others still go out. An update that stops before it is stored withdraws the
codes it already issued. The pool, the client and a copy of the stored user
are read while the lock is held, as SignUp captures its trigger's user, so
nothing is looked up once the update is stored.
2026-10-22 06:44:54 -04:00
TATSUNO “Taz” Yasuhiro 62972c91bf feat(lambdaweb): fail a revision whose code is not a zip (#6141)
* feat(lambdaweb): fail a revision whose code is not a zip

A revision whose code is not a zip is Failed, as on AWS, and cannot be
deployed. The endpoint CreateWebFunction makes on such a revision is
Failed too and answers 409 Platform.EndpointNotActive. An empty object
is a 500 InternalServerException with an empty body, as on AWS.

* fix(lambdaweb): remove a code copy that cannot be read and name the {} body

* test(lambdaweb): upload a real zip in the compatibility tests
2026-10-21 22:56:15 -04:00
Jackson Price 7c202a8966 fix(ec2): AND repeated filter names on every Describe action (#6170)
* fix(ec2): AND repeated filter names on every Describe action

The Query handler read Filter.N into a map keyed by name, so a filter
whose name was already given replaced the earlier one: tag-key=Env with
tag-key=Team matched every resource tagged Team, and two vpc-id filters
naming different VPCs matched the second VPC's resources. AWS joins
every filter with an AND, a repeated name included.

Every Describe action that reads Filter.N now passes the filters in
request order to the service, as DescribeKeyPairs, DescribeTags and
DescribeAvailabilityZones already did, and each filter narrows the
answer the way a lone filter of that name does. The service keeps its
map overloads for the callers that build filters of distinct names in
code; they delegate to the ordered overloads, so what they get back
does not change. DescribeImages builds its lookup image from the first
name wildcard and returns it only when it satisfies every filter.

Four existing tests passed null or any() as the filters of a method
that now has a second overload. They pass Map.of() or anyMap() instead,
which is what the code under test sends.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(ec2): sweep transit gateway peering attachments for repeated filters

DescribeTransitGatewayPeeringAttachments goes through the same shared
matcher as the other actions the parameterized tag-key case covers, but
had no case of its own. It now has one: two tag-key filters find only
the peering attachment that carries both keys.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* fix(ec2): satisfy every repeated filter when building a lookup image

With a filter name given twice, DescribeImages built the image it
synthesizes for an unmatched lookup from the first name wildcard and the
first concrete value of each other filter, so a later filter of the same
name could reject it and the lookup came back empty: architecture with
x86_64 or arm64 and architecture with arm64 returned nothing. Each name
filter now offers its wildcard in turn, and each other value is the
first one that every filter of its name admits. A lone filter of each
name still yields the one image it always did.

DescribeInstanceTypeOfferings kept the types of its InstanceType.N
parameter only through the first instance-type filter, so repeating that
filter dropped them. They are now kept beside the types that every
instance-type filter names.

The docs say "an action" rather than "a Describe action", since the Get
and Search actions that read Filter.N are covered too.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* fix(ec2): let an instance-type filter without values narrow nothing

DescribeInstanceTypeOfferings looked up the types its first
instance-type filter named, so a first filter without values limited the
answer to the InstanceType.N types while a later one without values
narrowed nothing: the answer depended on the order of the filters. A
filter without values now names and narrows nothing wherever it stands,
as a lone one never added a type.

The lookup image of DescribeImages tries the first wildcard of each name
filter, which the comment now says. Every filter value the image is
built from is tested by the image matchers' own rule.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* refactor(ec2): name the per-filter checks of repeated filters

The test that every filter of one name admits a value was written out by
hand at each site. Two helpers beside everyFilterAdmits now carry it:
everyFilterContains, for exact values where a filter without values
admits anything (security group rules, prefix lists, the later
instance-type filters of DescribeInstanceTypeOfferings), and
everyFilterMatches, for values with wildcards where a filter without
values matches nothing (the location filters of offerings, and the
spot-price and timestamp filters of DescribeSpotPriceHistory). No
answer changes.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* fix(ec2): match instance-type wildcards in DescribeInstanceTypeOfferings

AWS takes * and ? in an instance-type filter value of
DescribeInstanceTypeOfferings (the CLI reference filters on c5*), but
Floci looked each value up by its exact name, so a lone t3.* found
nothing and t3.* beside t3.micro found nothing either. A first filter
holding a wildcard now looks up the whole catalog, and every filter
matches a type with the same matcher as the location filter. Exact
values give the same answer as before.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(ec2): pin an empty lookup for overlapping name patterns

Two name filters foo-* and *-bar-* overlap, but the image built from
the first wildcard of each breaks the other filter. DescribeImages
returns no image here, as AWS returns only images that exist; before
the filters were ANDed it returned one that broke foo-*.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* fix(ec2): match offerings instance-type values with the linear glob

The instance-type wildcards of DescribeInstanceTypeOfferings went
through the regex matcher, which backtracks on a caller-supplied
pattern of many stars: twenty stars took about sixteen seconds per
request. They now go through everyFilterAdmits, the two-pointer glob
the image filters already use. Value-less filters are dropped before
the check, so no answer changes. Also reword a test comment.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(ec2): name the matcher a many-star pattern goes through

The glob that matches instance-type values is a two-pointer match, not
a strictly linear one, so the test's Javadoc says that instead.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

---------

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
2026-10-21 22:44:26 -04:00
Alessandro Lattao 42fd858311 feat(dsql): speak DSQL's dialect and keep its transaction limits (#6185)
* feat(dsql): speak DSQL's dialect and keep its transaction limits

The third part of the DSQL data plane, after #6102 and #6143: the cluster's
database answers the way Aurora DSQL does, as measured on AWS.

CREATE [UNIQUE] INDEX ASYNC answers a job_id, with sys.jobs and
sys.wait_for_job; a plain CREATE INDEX is refused. What DSQL refuses is
refused with its SQLSTATE and message: what the statement shows (TRUNCATE,
DO, LISTEN, VACUUM, sequence caches, isolation levels, locking clauses,
advisory locks, ADD CONSTRAINT) in DsqlStatements, and what only the catalog
can tell (column types, a function's language, temporary and partitioned
tables, triggers) inside the database, by event triggers, since the
statement alone cannot say.

A transaction runs one DDL statement, never with DML, and modifies at most
3,000 rows, a cascade's included. Its age follows what was measured with a
client that only reads: the client's next message after 300 seconds ends it
with 54000 and closes the connection with 08P01, an idle one is ended unasked
15 seconds later, a statement running across the limit completes and then
fails with 54000, and a failed transaction left idle as long is closed with
25P03. A first model, the age checked at the next statement, was dropped once
the reading client showed DSQL's own timer.

A write conflict is DSQL's 40001 OC000, and an error's context keeps the
statement a cascade ran while dropping what sys functions ran.

* fix(dsql): close the dialect's gaps found in review, as measured on DSQL

Measured on Aurora DSQL before each change:
- set_config of default_transaction_isolation or transaction_isolation, a
  quoted SET of one and ALTER ROLE ... SET of one answer 0A000 "not
  supported"; ALTER DATABASE ... SET or RESET is AlterDatabaseSet.
- CREATE TABLE AS, SELECT INTO and materialized views are CreateTableAs,
  refused by the event trigger so a function body cannot reach them either.
- An expression key, or a domain over jsonb or bytea, is refused like the
  type itself, named as declared: the check reads the index's own columns
  and follows a domain to its base type.
- CREATE, ALTER and DROP ROLE and GRANT or REVOKE of a role are DDL.
  PostgreSQL fires no event trigger for them, so they run through
  sys.run_role_ddl, which counts them first, under PostgreSQL's tags.
- A statement past the transaction age limit fails with 54000, in a
  transaction block or not, nothing its transaction wrote is kept, and the
  rest of its query, a COMMIT included, does not run.

The age limit is reworked as the review asked. Each session has one check
scheduled at a time, on the endpoint's scheduler and by the injected Clock,
cancelled when the transaction or the connection ends; a failed
transaction's idle wait restarts after every client message. At the limit
a statement still running is cancelled with the client's own cancel
request, and its 57014 reaches the client as DSQL's 54000. DSQL lets the
statement finish and fails it then; stopping it at the limit ends the same
way. Two other ways were tried and dropped: dropping a late statement's
answer in the relay let a COMMIT in the same query commit, and a mark the
endpoint writes for the database to check is invisible to the client's
repeatable read snapshot. The age test now moves the clock and holds a row
instead of sleeping, and shares its cluster setup with the data plane test
through DsqlClusterFixture.

Also fixed: a -- comment ends at a carriage return, a quoted advisory lock
name is refused, CACHE is read from tokens rather than the raw text, a
BEGIN queued behind a long statement starts once that statement is
answered, tables that predate the counting triggers get them, and
sys.create_index_async runs one index statement and nothing else.

sys.wait_for_job with an unknown id keeps waiting, as DSQL's does.
2026-10-21 21:18:17 -04:00
Vũ Thế Huy fd37e109f8 feat(firehose): deliver staged Redshift batches with single-attempt COPY (#6006)
* feat(firehose): deliver staged Redshift batches with single-attempt COPY

A flush stages the batch in the intermediate S3 location, then runs COPY against the cluster proxy over JDBC simple-query mode without an IAM role. The load runs on its own thread so that slow COPY queries do not hold the shared flush executor or PutRecord callers, and failures are logged with the staged batch kept in S3.

* fix(firehose): address review comments on Redshift single-attempt COPY delivery

- Drain buffers before shutting down the Redshift delivery executor on Firehose shutdown and log dropped queued tasks.

- Catch RejectedExecutionException in deliverRedshiftBatch to prevent staged records from returning to the buffer.

- Extract DatabaseSecretCredentials helper in core.common to deduplicate Secrets Manager credentials parsing across RDS Data, Redshift Data, and Firehose.

- Extract RedshiftConnections test helper for waitForConnection and use DockerAvailability.isAvailable() in FirehoseRedshiftDeliveryIntegrationTest.

- Update docs and Javadocs to remove outdated references to retries and shared flush threads.

* fix(firehose): wait for queued Redshift COPY delivery before shutdown and log secret parse errors

* refactor(firehose): deduplicate dropAndLogQueuedTasks helper on shutdown
2026-10-21 13:40:53 -04:00
Jackson Price ff813c6f34 fix(ec2): create the key type and format CreateKeyPair asks for (#6112)
* fix(ec2): create the key type and format CreateKeyPair asks for

CreateKeyPair ignored KeyType and KeyFormat, so asking for an ED25519
key or a PuTTY key file returned a 2048-bit RSA key as PEM, and any
value of either was accepted. Now, as AWS answers:

- KeyType=ed25519 creates an ED25519 key, returned in OpenSSH's own
  BEGIN OPENSSH PRIVATE KEY format and fingerprinted by the padded
  base64 SHA-256 of its public key blob.
- KeyFormat=ppk returns the key as an unencrypted PuTTY version 2 key
  file whose comment is the key pair's name. An RSA key keeps the SHA-1
  fingerprint of its DER private key, taken over the key with its
  larger prime first, the order PuTTY stores.
- Any other KeyType or KeyFormat is InvalidParameterValue with AWS's
  validation message, checked before the name is found taken, and
  nothing is created.

RunInstances injects the ED25519 public key of such a key pair, and
DescribeKeyPairs reports it.

Follow-up to the review of #6093.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(ec2): keep the CreateKeyPair test helpers in one place

The launch test and the key unit tests use the Query helpers and the
ED25519 readers of Ec2CreateKeyPairIntegrationTest instead of their own,
PuttyKeyFile reads fields and RSA public keys with SshPublicKeys, the
digests come from Digests, and the RSA prime-order test takes its keys
from Ec2KeyMaterial.generateRsa instead of building them itself.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* fix(ec2): answer a CreateKeyPair DryRun before its other checks

AWS answers CreateKeyPair with DryRun=true by DryRunOperation (412)
before it looks at the name or the key type, so a DryRun with an
unknown KeyType is DryRunOperation rather than InvalidParameterValue.
Floci ignored DryRun and created the key pair; it now answers it first
and creates nothing.

The CreateKeyPair tests share their requests and key readers through
Ec2CreateKeyPairFixtures rather than an integration test class, the
launch test shares the container-backed application of
Ec2CapturedImageReclaimIntegrationTest, a described public key is
compared without the line break AWS ends it with, a created ED25519
key imports with the same fingerprint, the PuTTY comment rule is
checked for CR, tab and DEL as well as LF, and the case of a key with
its smaller prime first is skipped rather than failed under a
generator that never makes one. The orders AWS documents nowhere are
described as Floci's.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(ec2): clean up after the CreateKeyPair tests

The launch test terminates its instance and deletes its key pair, since
it now shares an application with another class, and the import test
deletes what it made even when a step before its assertion fails. A
test comment and the DryRun comment no longer claim an order AWS does
not document.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(ec2): say what the launch test's cleanup leaves behind

With the container manager mocked, TerminateInstances releases the
instance's address and volume but leaves its record pending, so the
comment says so instead of claiming the instance goes.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* fix(ec2): record the key type CreateKeyPair created

With #6093 merged, CreateKeyPair stored every key pair's type as rsa,
so an ED25519 key pair was described as rsa and the key-type filter
found it under rsa. It now stores the type it created. The guard test
now requires the reported type and checks the key-type filter.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(ec2): share Ec2KeyPairFixtures and keep the type check to what AWS does

The CreateKeyPair tests now use the key pair fixture #6093 added, which
gains the type-and-format CreateKeyPair and the ED25519 key readers, and
their own fixture class goes. The described-type check no longer looks
the key pair up with the key-type filter, which AWS answers with
InvalidParameterValue. The createKeyPair Javadoc says the name is checked
as present and valid before the values.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* fix(ec2): read a stored key pair's type from its public key

A key pair saved before its type was recorded was described as rsa
whenever it held key material, which would misreport a created ED25519
key pair. Its type is now read from its stored public key, created or
imported; a created key pair saved before Floci kept its public key is
still rsa, the only type CreateKeyPair made then.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* refactor(ec2): generate ED25519 key pairs in Ec2KeyMaterial

Ec2KeyMaterial already reads imported ED25519 keys, so the created ones
move there too and share its base64 and fingerprint rule instead of a
class of their own. Ec2PuttyKeys uses its colon-hex fingerprint, and the
PuTTY test key moves into Ec2KeyPairFixtures with the other test keys.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(ec2): check the described key type through the SDK

The SDK test now checks DescribeKeyPairs returns the type each key pair
was created with, which the hardcoded rsa would have failed. The key pair
fixture exports the region it signs for, and the legacy keyType paragraph
in the EC2 docs is re-wrapped.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

---------

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
2026-10-21 13:38:36 -04:00
Jackson Price ab0737798d fix(elbv2): answer SetSubnets with one ALB subnet with ValidationError (#6116)
* test(elbv2): expect ValidationError for SetSubnets with one ALB subnet

SetSubnets on an Application Load Balancer with one subnet answers
InvalidConfigurationRequest with a message of Floci's own, once the
subnet has been looked up. The SetSubnets API reference states the
rule CreateLoadBalancer states, subnets from at least two Availability
Zones, and since #6098 CreateLoadBalancer answers one subnet with
ValidationError "At least two subnets in two different Availability
Zones must be specified", counted before any subnet is looked up.

- ElbV2ServiceTest, ElbV2IntegrationTest (Query protocol) and the
  compatibility suite's ElbV2Test expect that error for SetSubnets
  with one subnet, in Subnets or in SubnetMappings, and for one subnet
  that does not exist, with the balancer left on its subnets.
- CloudFormationElbV2SubnetUpdateIntegrationTest: an update that keeps
  the balancer and names one subnet rolls back with that error.
- A Network or Gateway Load Balancer is still set onto one subnet, and
  a move onto no subnets, which a CloudFormation rollback makes for a
  balancer an earlier version saved without subnets, is still taken.
- setSubnetsWithMissingSubnetReturnsSubnetNotFound sends an existing
  subnet beside the missing one, so it still reaches the lookup.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* fix(elbv2): answer SetSubnets with one ALB subnet with ValidationError

SetSubnets on an Application Load Balancer with one subnet now answers
ValidationError (400) "At least two subnets in two different
Availability Zones must be specified", the answer CreateLoadBalancer
gives since #6098, instead of InvalidConfigurationRequest with a
message of Floci's own. setSubnets runs requireSubnets once it has
looked the balancer up for its type and before any subnet is looked
up, so one subnet that does not exist gets the same answer, as on
create. One SubnetMappings entry goes through the same check.

The answer follows the SetSubnets API reference, which states the
two-zone rule for an Application Load Balancer, and the answer AWS
gives CreateLoadBalancer; no public report shows what AWS answers
SetSubnets with one subnet. AWS does give a Network Load Balancer's
SetSubnets with no subnets CreateLoadBalancer's message.

A CloudFormation update that keeps an Application Load Balancer and
names one subnet moves it through setSubnets, so it now fails with
this error and rolls back. A move onto no subnets is not counted,
because a CloudFormation rollback moves a balancer an earlier version
saved without subnets back onto none. A Network or Gateway Load
Balancer can still be set onto one subnet.

resolveSubnetVpcId drops its own one-subnet refusal, which neither
caller reaches any more; its zone check still refuses an Application
Load Balancer whose subnets are all in one Availability Zone.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* docs(elbv2): say where SetSubnets' one-subnet answer comes from

Review follow-ups to the SetSubnets one-subnet fix:
- The requireSubnets Javadoc scopes what AWS is known to answer to
  CreateLoadBalancer, and says SetSubnets gets the create message and
  order because no public report shows what AWS answers there.
- The setSubnets comment says an empty list moves the balancer onto no
  subnets, rather than that the list is left alone.
- docs/services/elb.md says the same about the SetSubnets answer, and
  instead of saying a Gateway Load Balancer can be set onto one subnet,
  that Floci does not enforce AWS's rule that SetSubnets keeps every
  subnet a Gateway Load Balancer already has.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(elbv2): keep the SetSubnets tests to answers ELBv2 gives

Review follow-ups to the SetSubnets one-subnet fix:
- ElbV2CfnProvisionerTest: the update with a blank SubnetId keeps a
  Network Load Balancer, for which SubnetNotFound is still the answer
  ELBv2 gives; an Application Load Balancer now gets the subnet count
  error first. The move-and-move-back test moves the kept balancer
  onto two subnets, as ELBv2 refuses an Application Load Balancer on
  one.
- ElbV2ServiceTest: the move onto no subnets follows the rollback it
  stands for, a balancer saved without subnets moved onto subnets and
  back onto none. SetSubnets onto one subnet for a balancer that does
  not exist reports LoadBalancerNotFound before any subnet is looked
  up.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* docs(elbv2): word the SetSubnets count notes as the rules read

Second review round on the SetSubnets one-subnet fix:
- docs/services/elb.md no longer says Network and Gateway Load
  Balancers are not counted: they are, and a list that names a subnet
  cannot fail the count for them, while a SetSubnets with neither form
  is refused for every type once #6100 lands. It now says a Network
  Load Balancer can be set onto one subnet, and that AWS requires a
  Gateway Load Balancer's SetSubnets to list every subnet it is
  already on, which Floci does not enforce.
- The setSubnets comment says "an earlier Floci version", as the
  tests do.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(elbv2): give the blank SubnetId update a typed balancer

Second review round on the SetSubnets one-subnet fix: the update with
a blank SubnetId in ElbV2CfnProvisionerTest names a Network Load
Balancer in its template, and the balancer its describe stub returns
is now a network one too, so the template, the stub and the Javadoc
agree. The answer the stub gives, SubnetNotFound, is unchanged.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* docs(elbv2): scope the Gateway Load Balancer SetSubnets rule to Subnets

Third review round on the SetSubnets one-subnet fix: the SetSubnets API
reference states that a Gateway Load Balancer must include every
subnet it is already on under Subnets only, not under SubnetMappings,
so docs/services/elb.md now says the reference requires it of a
Gateway Load Balancer's Subnets, rather than of its SetSubnets as a
whole. Floci still does not enforce it.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* chore(elbv2): tidy what #6100 and the SetSubnets count both added

With #6100 merged, this branch and it each documented and tested the
same SetSubnets paths:
- ElbV2ServiceTest keeps aRollbackOntoNoSubnetsIsNotCounted, which
  models the CloudFormation rollback that needs setSubnets to take an
  empty list, and drops #6100's aMoveBackOntoNoSubnetsIsStillTaken,
  which tested the same call on a balancer that still had subnets. The
  two missing-balancer tests now say which path each pins: the
  SetSubnets action with neither form, or setSubnets with one subnet.
- The requireSubnets Javadoc names setSubnetsFromRequest beside
  setSubnets, and the setSubnets comment no longer repeats the
  empty-list reason its Javadoc gives.
- docs/services/elb.md has one SetSubnets bullet instead of two.

No behaviour changes.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* docs(elbv2): say what requireSubnets checks for SetSubnets

Review of the merge with #6100: the requireSubnets Javadoc gave the
two-zone rule as the reason setSubnetsFromRequest runs it, but that
call refuses a SetSubnets that names no subnets, for every type, and
requireSubnets only counts the list. It now says SetSubnets takes the
same subnets as CreateLoadBalancer, which of the two methods runs the
count on which list, and that the two-zone check comes after the
subnets are looked up. Javadoc only.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* docs(elbv2): say what the folded SetSubnets bullet counts like

Review of the tidy: once the two SetSubnets bullets in
docs/services/elb.md became one, "counted the same way" followed the
sentence about a SetSubnets with neither form, so it no longer read
as CreateLoadBalancer's count. It now says a SetSubnets that names
subnets is counted as CreateLoadBalancer counts them.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

---------

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
2026-10-21 10:47:07 -04:00
Jackson Price fbf3bfff84 fix(ec2): refuse key pairs AWS refuses and describe their type, create time and filters (#6093)
* fix(ec2): refuse key pairs AWS refuses and describe their type, create time and filters

ImportKeyPair stored whatever material it was given. It now reads the key
as AWS documents: RSA or ED25519 as an OpenSSH line, RSA also as RFC 4716
or base64 DER, bare or in PEM armour, and RSA from 1024 to 16384 bits.
DSA, ECDSA, security-key and certificate keys, blobs that are incomplete,
carry trailing bytes or name another type, and material with more than one
key line are refused with InvalidKey.Format. The key is stored as one
OpenSSH line, which is what RunInstances writes to authorized_keys.
CreateKeyPair and ImportKeyPair take a KeyName of up to 255 ASCII
characters with no leading or trailing space, and answer any other with
InvalidParameterValue.

DescribeKeyPairs now returns keyType and createTime, and honours Filter.N
with key-pair-id, key-name, fingerprint, key-type, tag-key and tag:<key>,
refusing any other name. Key pairs persisted before this change load as
they are: they have no createTime, and their keyType is read from the
stored key.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(ec2): describe malformed key pairs from saved records, not imports

ImportKeyPair now refuses material that is not exactly one whole key and
converts RFC 4716, so the IncludePublicKey cases that imported partial
or mislabelled blobs, trailing bytes, two key lines or UTF-16 text could
no longer create their key pairs. Such material is now held only by key
pairs saved by an earlier version, so those cases describe a stored
record through the handler instead, and the RFC 4716 case checks that
the converted key is described as its OpenSSH line.

The handler test stubs the DescribeKeyPairs overload that takes filters,
which the handler now calls. The Key Pairs docs and the javadoc of the
public-key description say what is stored now and what an older record
may still hold.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* fix(ec2): refuse a DER key whose bit string declares pad bits

A SubjectPublicKeyInfo whose key BIT STRING declares unused bits made
Bouncy Castle throw an IllegalStateException, which the key reader did
not catch. ImportKeyPair answered such base64 DER or PEM with a 500
instead of InvalidKey.Format, and a key pair saved earlier with that
material failed every DescribeKeyPairs in its region, since the key type
of an older record is read from its material.

The reader now refuses a key bit string with pad bits, and treats Bouncy
Castle's IllegalStateException like its other parse errors. A new test
sets every byte of each binary form to values that matter to DER and SSH
framing and checks that nothing escapes.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* fix(ec2): refuse an IncludePublicKey that is neither true nor false

DescribeKeyPairs read IncludePublicKey with Boolean.parseBoolean, so a
value such as "invalid" or "yes" was taken as false and the key pairs
were described without their public keys instead of the request being
refused. It now goes through the handler's strict boolean reader, the
one the block device mapping and peering options use: true or false in
any case, and InvalidParameterValue for anything else. TRUE was already
read as true, and still is.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(ec2): send each describe filter once and allow clock skew in the SDK check

The DescribeKeyPairs integration helper always sent a key-name filter of
the test's prefix, so the cases that test key-name itself sent the name
twice and Floci kept only the second. A key-name filter under test is now
sent alone. The SDK compatibility check gives createTime a minute either
side, since Floci may run in a container with another clock.

The Key Pairs docs and the RSA length test now say what AWS lists and
what Floci takes beyond it, citing the 8192-bit key AWS was seen to
import.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* fix(ec2): refuse a DER key with no key in its bit string

An rsaEncryption SubjectPublicKeyInfo whose key bit string holds no bytes
parses to no structure at all, and the reader passed that null on to a
NullPointerException: ImportKeyPair answered such DER or PEM with a 500,
and a key pair saved earlier with it failed DescribeKeyPairs for every
listing that included it. The reader now reads the PKCS#1 sequence
itself and refuses anything that is not two integers.

It reads those integers signed, as an ssh-rsa blob's are, so a modulus
missing its sign byte is refused rather than imported as a different,
positive key. And the key type of an older record no longer depends on
the reader never failing: if it does, the type is left out and the
failure logged, instead of failing the whole description.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* docs(ec2): keep key pair comments and docs true to the new checks

SshPublicKeyException's javadoc said EC2 answers an unreadable imported
key with no fingerprint; ImportKeyPair now refuses it with
InvalidKey.Format. The Key Pairs docs say that an empty IncludePublicKey
reads as false. The RSA length test links the report of an 8192-bit
import in full, and the describe test says that sending one key-name
filter is a Floci limit, not an AWS rule.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(ec2): cover the stored key-type guard on its own

The stored-record test passed even with the reader broken, because the
guard in keyTypeOf turned the reader's exception into the expected
missing type. It now checks that the reader refuses each stored material
by itself, and a new test makes the reader fail, through an inline static
mock as other tests here do, and checks that the record is still
described, with no type, and that a key-type filter passes over it.

The keyTypeOf javadoc and the docs now mention that case, the docs say a
blank IncludePublicKey reads as false and a missing or blank KeyName is
MissingParameter, and a comment no longer says every imported key is
fingerprinted with MD5.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(ec2): make the stored key-type guard test depend on its failing reader

The guard test stored text the real reader already refuses without
throwing, so it passed even if the failing reader was never consulted.
It now stores a valid ed25519 key, whose type would be ed25519 without
the failure, checks that the stubbed reader was called, and describes the
record through the handler too, where each item's type is read. A
comment on the stored-record test no longer says the reader refuses the
records it accepts.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* fix(ec2): AND a repeated DescribeKeyPairs filter name

DescribeKeyPairs read Filter.N into a map keyed by name, so a second
filter of one name replaced the first: key-name=X-prod-* with
key-name=X-*-web returned X-dev-web too. AWS joins every filter with AND.
The handler now passes the filters in request order, as
DescribeAvailabilityZones already does, and a key pair has to match each
of them, with the values of one filter still ORed.

The other EC2 describe actions share the map reader and keep its
behaviour; that is for a separate change. The describe test's helper
goes back to ANDing a second key-name filter with its prefix filter.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(ec2): show the key-type guard covers only key pairs saved without a type

With the key reader made to fail, ImportKeyPair still fails with the
error, and a key pair whose type was recorded is described and filtered
by key-type without the reader being consulted. Only a record saved
before the type was recorded goes through the guard that leaves its type
out and logs the failure.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(ec2): check repeated key pair filters in the service, and route unfiltered calls through them

A service test now passes Filter.N with a repeated name to the ordered
DescribeKeyPairs overload and checks that the two filters are ANDed, and
that a later unknown name is still refused. The unfiltered overload goes
through the ordered one too, leaving the map form as a convenience for
filters of distinct names, and the docs sentence on filters is split in
two.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(ec2): pick repeated key pair filters that each match more alone

The service check of a repeated key-name filter used `*-rsa` then `g*`,
and `g*` alone gives the same answer, so it passed when only the last
filter was kept. Each filter now matches two key pairs alone and one
together, so keeping either one instead fails the test.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(ec2): share one fixture between the key pair tests

The import, describe and public-key integration tests each had their
own CreateKeyPair, ImportKeyPair and DeleteKeyPair calls, and the same
ED25519 key was pasted into five classes. Ec2KeyPairFixtures now holds
those calls and the one key, which the handler, service and persistence
tests use too. SshKeyBlobs builds the OpenSSH blobs and lines that
SshPublicKeysTest, Ec2KeyMaterialTest and Ec2QueryHandlerTest each built
and joined themselves, and the import test reads RSA keys with
SshPublicKeys.rsaKeyOf instead of its own copy.

Test-only: every class runs the same tests as before.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(ec2): build key blobs with the SshPublicKeysTest helpers main has

SshPublicKeysTest on main already builds OpenSSH blobs with blob and
joins bytes with withTrailing. The EC2 key pair tests now call those two,
made public for them, instead of the SshKeyBlobs class the previous
commit added, which is removed.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(ec2): keep the shared throwaway keys in Ec2KeyPairFixtures

The pinned RSA key and its fingerprint, the ED25519 fingerprint, the DSA
and ECDSA P-256 keys and the truncated ssh-rsa blob were each written
out in two to four of the key pair test classes. They now live beside
the ED25519 key in Ec2KeyPairFixtures; keys only Ec2KeyMaterialTest
uses stay there. The handler test loses a comment and an import the
earlier move left behind.

The earlier move also switched Ec2KeyPairPublicKeyIntegrationTest and
Ec2QueryHandlerTest from the ED25519 key #6055 added to the shared one;
no assertion in them depends on which valid key it is.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

---------

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
2026-10-21 09:11:13 -04:00
Alessandro Lattao f2b62fbbec feat(dsql): serve each cluster's database on the DSQL endpoint (#6102)
* feat(dsql): serve each cluster's database on the DSQL endpoint

Each Aurora DSQL cluster gets a PostgreSQL 16 database in a Docker container,
set up as DSQL's (the role admin owning public, repeatable read), and every
cluster is served on one TLS endpoint where the server name picks the cluster.
A connection is admitted as DSQL admits it, measured on AWS: an IAM token for
the endpoint, DbConnectAdmin for admin, 5 seconds of grace past expiry, a
long-term key only in its own account, IAM enforcement with the account's SCPs,
and DSQL's SQLSTATE, text and hint for every refusal. A role other than admin
is refused as an unmapped one, since role mappings come with AWS IAM GRANT in
the next part. The startup is read as DSQL reads it: a dotted parameter is
refused, and of options only -c name=value counts, the first for a name.

The cluster is CREATING until its database answers; a multi-Region peer is
ACTIVE after peering only once its database answers. A start that fails after
the container exists removes it, a deletion Docker cannot finish leaves the
cluster DELETING for the next start, and whether a cluster is wanted and its
route change under one lock, so a deletion racing a start leaves no route.

The data plane was first one PR; it is split by layer at the maintainer's
request: this part (transport and admin), then AWS IAM GRANT and the other
roles, then DSQL's dialect and limits.

* refactor(postgres): speak PostgreSQL's wire protocol through one shared helper

The DSQL endpoint brought a third copy of the startup parsing, message framing
and ErrorResponse building that the RDS proxy's PostgresProtocolHandler and
Redshift's PostgresWireDecoder each carried. They now go through
core.common.PostgresWire: the startup packet and its parameters, reading and
writing a message with its checked length, and the fields of an ErrorResponse
or NoticeResponse. The length refusals keep the RDS proxy's wording, which its
tests assert; Redshift's oversized-message refusal now reads the same way.

Also from the review: the DSQL integration test makes its IAM users with
EnforcementFixtures.createUser, which removes them after the test; the service
test shares one ready-at-once provision stub; and every exception the endpoint
and session swallow is named ignored, with the reason it is safe.
2026-10-21 08:54:07 -04:00
Mario Toffia 89317831bb feat(ssm): publish parameter change events (#5262)
* feat(ssm): publish parameter change events

After a successful PutParameter, DeleteParameter, DeleteParameters,
LabelParameterVersion or UnlabelParameterVersion, SsmService publishes the
AWS-shaped aws.ssm "Parameter Store Change" event to the default EventBridge
bus, with the parameter ARN in resources. A label event carries the type and
description of the labelled version; an unlabel event lists the labels it
removed. Every event is published after the service lock is released. Failed
calls publish nothing, and a delivery failure is logged without failing or
undoing the write. CloudFormation managed parameters go through SsmService and
publish the same events.

* test(cloudformation): move CfnStackWaits into testing

CfnStackWaits was package-private in the CloudFormation tests, so the SSM
event integration test polled DescribeStacks for CREATE_COMPLETE itself.
It now lives in testing with a public API, and that test waits through
CfnStackWaits.awaitStatus and builds its CloudFormation requests with
CfnRequests.cfn instead of a private copy.

* refactor(eventbridge): build service event entries in one place

The ECS, Step Functions, Redshift Data, CodePipeline, SES and SSM publishers
each built the same Source, DetailType, Detail and Resources entry.
EventBridgeService.serviceEventEntry builds it, with Resources always
present and empty for a null or blank resource ARN. Each publisher still
calls putEvents with its own region and account. The explicit default
EventBusName and the Region that repeated putEvents' region argument are
gone; putEvents fills both the same way.
2026-10-21 07:07:39 -04:00
David 1108bc75dc feat(rds): DB proxy endpoints (#6062)
* feat(rds): DB proxy endpoints

CreateDBProxyEndpoint, DescribeDBProxyEndpoints, ModifyDBProxyEndpoint and
DeleteDBProxyEndpoint store endpoints per account and Region, checked against the
service model. Each endpoint reports its proxy's own host, so a client connects
through it as through the proxy. DescribeDBProxyEndpoints lists each proxy's
default endpoint first; it cannot be modified or deleted. Deleting a proxy
deletes its endpoints, and endpoint ARNs take tags.

Closes #5805

* fix(rds): report each proxy endpoint at the proxy's current host

A custom endpoint kept the proxy's host from when it was created, so after a
restore gave the proxy a new host, every custom endpoint still reported the
old one while default reported the new one. The host is no longer stored with
the endpoint: create, describe, modify and delete take it from the proxy when
they answer.

A missing DBProxyName, DBProxyEndpointName or VpcSubnetIds is now
MissingParameter, checked before the proxy is looked up.

* test(rds): import Executable and assertTrue instead of naming them inline
2026-10-21 06:47:06 -04:00
TATSUNO “Taz” Yasuhiro 1dce18e766 feat(dynamodb): add point-in-time recovery restores (#6110)
* feat(dynamodb): add point-in-time recovery restores

* feat(dynamodb): record a point-in-time change before the write

* feat(dynamodb): authorize RestoreTableToPointInTime on its source table

* perf(dynamodb): store each point-in-time change on its own

* feat(dynamodb): delete system backups that have expired

* chore(dynamodb): take point-in-time times from a clock in tests

* chore(dynamodb): share the duplicated test helpers and table name pattern
2026-10-21 01:09:06 -04:00
Jackson Price 883cd4f1c2 fix(elbv2): refuse SetSubnets with neither Subnets nor SubnetMappings (#6100)
* test(elbv2): cover SetSubnets with neither Subnets nor SubnetMappings

SetSubnets takes Subnets or SubnetMappings, and AWS refuses a request
with neither. These tests pin that answer, which Floci does not give
yet: a ValidationError with the CreateLoadBalancer message for the
balancer's type, with the balancer left on its subnets and in its VPC,
whether the two lists are left out or sent empty. They fail until the
fix that follows.

They also pin the paths that must keep working: a balancer that does
not exist is reported first, a CloudFormation update that names
neither leaves its kept balancer alone, and a rollback can still move
a balancer an earlier version saved without subnets back onto none.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* fix(elbv2): refuse SetSubnets with neither Subnets nor SubnetMappings

A SetSubnets that named neither Subnets nor SubnetMappings answered
success and left the load balancer in no Availability Zone, still in
its VPC. The API reference says the request takes one or the other,
and AWS answers a Network Load Balancer's with "ValidationError: At
least one subnet must be specified", the message CreateLoadBalancer
gives it.

SetSubnets with neither now answers ValidationError and leaves the
balancer on its subnets, with the message CreateLoadBalancer gives the
balancer's type: "At least two subnets in two different Availability
Zones must be specified" for an Application Load Balancer, "At least
one subnet must be specified" for a Network or Gateway Load Balancer.
A balancer that does not exist is still LoadBalancerNotFound, since
the message depends on its type, and a request that names subnets is
checked as before.

The check runs in the new ElbV2Service.setRequestedSubnets, which the
Query handler calls. ElbV2Service.setSubnets still takes an empty
list: CloudFormation moves a kept balancer through it, never onto none
on an update, and onto none on a rollback only for a balancer an
earlier version saved without subnets, which rolls back as before.

Follow-up to #6087.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* refactor(elbv2): keep the SetSubnets action check in the package

Review follow-ups, no change in behaviour:
- The action's entry point is now the package-private
  ElbV2Service.setSubnetsFromRequest, which only the Query handler
  calls; setRequestedSubnets read like a property setter. The
  CloudFormation provisioner, in another package, cannot reach it and
  keeps moving balancers through setSubnets.
- Its Javadoc says why only an empty list is refused there: a request
  that names subnets is checked by setSubnets. The setSubnets and test
  Javadocs speak of a balancer an earlier Floci version saved without
  subnets.
- The provisioner test of an update that names neither says the real
  reason the update must not call setSubnets: it would move the
  balancer onto none.
- The docs line for SetSubnets gives both messages.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(elbv2): give the SetSubnets neither test the class's last order

#6098 adds a test at @Order(79) earlier in ElbV2IntegrationTest, while
this one stays the last method in the file at @Order(78). Once both
land, whoever appends a test would read 78 and pick 79, so this one
takes 80 and the last method keeps the highest order. The two tests
are independent, so the order between them does not matter.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(elbv2): give the SetSubnets compat test its own order

setSubnetsWithoutSubnets and createLoadBalancerWithoutSubnets in the
compatibility suite's ElbV2Test both carried @Order(6), so JUnit's
order between them was left to its tie-break. The SetSubnets test now
has @Order(8), the first value not taken once #6098's @Order(7) test
is in the class, so every order in the class is unique. The test stays
where it is in the file: moving it below the create test would edit
the lines #6098 added on main. The two tests create and delete their
own balancers, so neither depends on running before the other.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

---------

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
2026-10-21 00:07:32 -04:00
Hector Ventura e5591dda32 feat(ec2): page and filter DescribeTags as AWS does (#6109)
* feat(ec2): page and filter DescribeTags as AWS does

DescribeTags ignored MaxResults and NextToken, so SDK paginators got a
single page, and matched filter values exactly: tag:<key> was dropped,
the * and ? wildcards matched literally, and a filter name given twice
kept only the last one.

It now pages with MaxResults (5 to 1000, InvalidMaxResults otherwise)
and NextToken, takes tag:<key> as the documented alternate spelling of
a key filter plus a value filter, honours wildcards, ORs the values of
one filter and ANDs separate filters. Results are ordered by resource id
so a page boundary stays put while no tags change.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(ec2): bound filter wildcards and refuse every out-of-range MaxResults

EC2 filter wildcards were translated to a regex, so a caller-supplied
pattern of many stars backtracked for seconds against a long value and
`*` skipped line terminators. They now use the two-pointer glob IAM and
S3 already share, which every EC2 Describe filter goes through.

DescribeTags treated MaxResults=0 and negative values as unpaged; any
value sent outside 5 to 1000 now answers InvalidMaxResults, and only a
missing MaxResults is unpaged. A NextToken whose offset is at or past the
end returns an empty last page instead of overflowing into a token that
fails on the next call. The compat case moves to its own @Order.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-20 23:42:14 -04:00
Suja Shaj 50e515f17a fix(ec2): give RunInstances the private address it asks for (#6099)
RunInstances ignored the private address it was given, so every instance
got the subnet's next free address. It now reads PrivateIpAddress,
NetworkInterface.1.PrivateIpAddress (Terraform), the primary
NetworkInterface.1.PrivateIpAddresses entry (AWS CLI) and a launch
template's primary interface address. The address is validated (inside
the subnet, not reserved, not in use, including by another account's
instance, interface or NAT gateway on a shared default VPC network,
single instance with its own interface, no instance-level address with
network interfaces), leased on the VPC's Docker network, and assigned to
the instance and its primary interface. A CloudFormation
AWS::EC2::Instance now launches at its declared PrivateIpAddress too.

Closes #5830
2026-10-20 17:20:51 -04:00
Jackson Price 61a42591a9 fix(elbv2): answer a single-subnet ALB with ValidationError (#6098)
* test(elbv2): expect ValidationError for a single-subnet ALB

AWS answers a CreateLoadBalancer for an Application Load Balancer with
one subnet with ValidationError (400) "At least two subnets in two
different Availability Zones must be specified", the answer it gives
one with none, and it counts the subnets before it looks them up.
Floci answers InvalidConfigurationRequest with a message of its own.

- ElbV2ServiceTest, ElbV2IntegrationTest (Query protocol),
  CloudFormationElbV2SubnetMappingsIntegrationTest and the
  compatibility suite's ElbV2Test expect that error, and no balancer,
  for one subnet in Subnets or SubnetMappings, with or without Type,
  and for one subnet that does not exist. A Network or Gateway Load
  Balancer on one subnet is still created.
- The tests that sent an Application Load Balancer one missing subnet
  to get SubnetNotFound now send it an existing subnet as well, or ask
  for a Network Load Balancer, so they still reach the subnet lookup.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* fix(elbv2): answer a single-subnet ALB with ValidationError

CreateLoadBalancer for an Application Load Balancer with one subnet
now answers ValidationError (400) "At least two subnets in two
different Availability Zones must be specified", as AWS does, instead
of InvalidConfigurationRequest with a message of Floci's own.
requireSubnets, which already refused a balancer with no subnets this
way, now refuses an Application Load Balancer with fewer than two. It
runs before any subnet is looked up, so one subnet that does not exist
gets the same answer, as on AWS. One SubnetMappings entry goes through
the same check, following the rule the API reference states for both
fields. CloudFormation creates and replacements go through it too.

A Network or Gateway Load Balancer on one subnet is still created.
SetSubnets with one subnet and two subnets in one Availability Zone
keep their InvalidConfigurationRequest answers.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(elbv2): cover a one-subnet ALB replacement

Review follow-ups:
- CloudFormationElbV2ReplacementIntegrationTest renames an Application
  Load Balancer onto one subnet: the update rolls back with
  CreateLoadBalancer's ValidationError, no balancer gets the new name,
  and the one it was to replace keeps both subnets.
- ElbV2CfnProvisioner's Javadoc no longer says a blank SubnetId is
  refused as an unknown subnet, since an Application Load Balancer
  with only that mapping now gets the subnet count error first.
- ElbV2ServiceTest says why its one-subnet test stubs a lookup that it
  then expects never to happen.
- Ec2DescribeSubnetsNotFoundTest says the missing subnet is sent
  alongside an existing one, rather than that its position matters.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(elbv2): give the one-subnet NLB and GWLB test its own order

Review follow-up: the test
createLoadBalancerOnOneSubnetIsAllowedForNetworkAndGatewayLoadBalancers
shared @Order(12) with
createLoadBalancerWithOneSubnetIsAValidationError, so JUnit ran the two
in no defined order. It now runs at @Order(78), after the other load
balancer subnet tests. Neither test depends on the other: each uses
its own load balancer names, and the network and gateway one deletes
the balancers it creates.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(elbv2): move the one-subnet NLB and GWLB test to order 79

The draft #6100 adds
setSubnetsWithNeitherSubnetsNorSubnetMappingsIsRefused at @Order(78)
in the same class, and the two branches merge without a conflict, so
whichever lands second would bring back a shared order. 79 is unused
on main and on both branches; no other order changes.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

---------

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
2026-10-20 17:19:07 -04:00
Alessandro Lattao 5fa67625c1 fix(cloudformation): refuse a template that holds a null value (#6071)
* fix(cloudformation): refuse a template that holds a null value

CloudFormation refuses a template with a null anywhere in it when
ValidateTemplate, CreateStack, UpdateStack or CreateChangeSet is
requested, before anything is created: 400 ValidationError
"[<path>] 'null' values are not allowed in templates". Floci accepted
such a template and provisioned it, so a template AWS rejects deployed
locally, and ValidateTemplate answered success without reading it.

The check runs where a change set is created, which CreateStack,
UpdateStack and CreateChangeSet share, and in ValidateTemplate. The
path is the one AWS names, measured on eu-west-1 on 2026-10-20: the
first null in document order, Type in place of a resource's Properties
below them, a null Properties named as is, list entries by index and
an intrinsic's arguments included. JSON null, YAML ~ and a YAML key
with no value are all null there.

A template that does not parse is left to the parser's error where it
is processed, as the other request-time checks do.

CognitoResourceServerCfnIntegrationTest's null Scopes cases sent such
a template and expected the resource to fail. They now expect the
request refused, as on AWS, and keep what they checked: no server is
created, and a refused update leaves the server as it was.

* fix(cloudformation): refuse null templates in stack sets and answer missing template objects

A review of the null-value check found four gaps, each measured on
CloudFormation (eu-west-1, 2026-10-20) before the fix.

- A template that is null as a whole ("null", "~", "---", a comment
  alone) parsed to no root
  and the check failed with a 500. AWS answers "Template format error:
  At least one Resources member must be defined.", which it does now.
- CreateStackSet and UpdateStackSet stored a null-valued template and
  only each instance's deployment refused it. AWS refuses the request
  and keeps the previous template, with CloudFormation's message
  followed by the service exception's details. Both now check the
  template they would keep before storing it or reserving an operation.
- ValidateTemplate reading TemplateURL reached the shared S3 fetch,
  whose failures were a 500, as they already were for CreateStack and
  GetTemplateSummary. A missing object or bucket now answers AWS's
  ValidationError texts for all three. AWS also refuses a URL that is
  not an S3 one; Floci keeps reading any host as S3, so a local URL can
  name Floci by whatever host reaches it.
- The compatibility test's cleanup swallowed every exception; DeleteStack
  of a stack that does not exist succeeds, so it no longer catches any.

CloudFormationS3VectorsTest and CloudFormationCognitoResourceServerTest
in sdk-test-java sent null values and expected them to reach the
resource. AWS refuses those templates when the operation is requested,
so the S3 Vectors cases that cannot be deployed there are dropped and
the Cognito update case now expects the request refused, with the
server left as it was.

* refactor(cloudformation): build the stack-set null refusal with sdkErrorMessage

A review pointed out that the suffix StackSets adds to CloudFormation's
message was built by hand while CloudFormationTemplateEngine.sdkErrorMessage
already builds it for this package, and that updateStackSet wrote the
template it would keep twice. The refusal now uses sdkErrorMessage, and
the kept template is one local both checks read; the answers are the
same.
2026-10-20 17:13:31 -04:00
Alessandro Lattao 95bf6df474 feat(dsql): add Aurora DSQL's control plane and AWS::DSQL::Cluster (#6048)
* feat(dsql): add Aurora DSQL's control plane and AWS::DSQL::Cluster

The first half of #6014. Aurora DSQL's REST JSON control plane, with
the answers measured on AWS (eu-west-1): CreateCluster, GetCluster,
ListClusters, UpdateCluster, DeleteCluster, GetVpcEndpointServiceName,
the cluster policy calls and tagging on cluster ARNs. Identifiers are 26
characters of lowercase base32 as DSQL's are, and malformed or unknown
ones are refused with DSQL's messages; a cluster created without
deletionProtectionEnabled is protected, and deleting a protected one is
refused. CreateCluster answers CREATING and the cluster is ACTIVE right
after.

AWS::DSQL::Cluster waits for ACTIVE, returns the identifier from Ref
and Identifier, ResourceArn, Status, CreationTime, Endpoint, VpcEndpoint
and VpcEndpointServiceName through Fn::GetAtt, and a protected cluster
makes the stack's deletion fail, as on AWS.

A cluster has no database behind it here: its endpoint is named as on
AWS, <id>.dsql.<region>.localhost.floci.io, but not served. Serving it
is the second half of #6014, its own pull request.

* fix(dsql): answer the control plane's edge cases as DSQL does

Review of #6048, each answer measured on DSQL (eu-west-1) first:
- ListClusters carries on from a page token whose cluster was deleted
  in between, as AWS does: the token now holds the sort position of the
  next page's first cluster rather than its identifier.
- deletionProtectionEnabled is read as DSQL reads it: text is false
  when it spells false in any case and true otherwise; empty text, a
  number, an object and a list fail with SerializationException.
- The tag calls refuse another account's cluster ARN with 403
  AccessDeniedException instead of reading it in the caller's account.
- A client token reused with other parameters answers 409
  ConflictException; with the same ones, the earlier cluster.
- AWS_OWNED_KMS_KEY names AWS's own key on create and update.

AWS::DSQL::Cluster reads DeletionProtectionEnabled and PolicyDocument
with AWS::NoValue as left out, and an update that drops the
multi-Region properties clears them, as it already reset the key and
deletion protection. ListTagsForResource copies the tags under the
cluster's lock, and a cluster's lock goes with the cluster.

* fix(dsql): answer errors, policies, updates and multi-Region clusters as DSQL does

A review asked for the attribute coverage, the reason ValidationException
carries, a real untag assertion and tests of the stack-update path.
Measuring them on DSQL (eu-west-1, 2026-10-20) found more that did not
match, fixed here too.

- Attributes are written with resource.getAttributes().put, which the
  schema coverage test reads; EncryptionDetails, an object an output
  refuses on AWS, is recorded as a gap.
- DSQL leaves reason out of its model-validation errors. Only the page
  token's refusal carries it, with fieldList naming next-token and its
  own text. maxResults no longer quotes the value.
- Tag calls answer what DSQL answers: 403 for an ARN that is not a
  cluster ARN, 400 BadRequestException for another Region's, 404
  NotFoundException for no cluster. The 403s name the caller.
- Policy versions are epoch milliseconds, DeleteClusterPolicy answers
  the deleted version, and the missing-policy and stale-version errors
  carry DSQL's texts and resourceType.
- Policies are checked and kept as DSQL does: its three refusal texts,
  a service principal, a principal that names no one, a public grant,
  and the lockout check when both policy actions are denied to the
  caller, unless bypassPolicyLockoutSafetyCheck. The kept form is
  Jackson's pretty printer in DSQL's element order, with condition
  operators and keys in HashMap order, as measured.
- The public check shares its condition keys with Lambda web functions
  through PublicAccessConditions, and S3 now takes its fixed-value and
  SourceIp range tests from there. Sharing the whole rule was tried and
  dropped: DSQL was measured to treat some operators otherwise than
  LambdaWeb's and S3's rules do (ForAnyValue:, ArnLike "*",
  StringEquals "*"), so the operator rules stay per service. The
  lockout check is IamPolicyEvaluator's.
- A multi-Region cluster is PENDING_SETUP and lists itself until it and
  each peer name one another, then ACTIVE; its deletion answers
  PENDING_DELETE.
- AWS::DSQL::Cluster reads its properties through CfnPropertyTypes, so
  a PolicyDocument object or DeletionProtectionEnabled "yes" fails as
  on AWS, where Boolean.valueOf made "yes" false. An update leaves a
  property the template no longer sets as it was, deletion protection,
  KMS key and multi-Region alike, and removes only the tags and the
  policy; an earlier change put them back to their defaults, which was
  not measured and is not what CloudFormation does. A policy the
  template does not change keeps its version, and create settles on
  PENDING_SETUP too.

DsqlServiceTest, DsqlClusterPoliciesTest and DsqlCfnProvisionerTest
cover these in isolation, the integration tests over the wire.

* fix(dsql): keep the public access rule to DSQL and forget a deleted policy's version

A review asked to leave S3 and Lambda web functions out of this change,
and pointed at DSQL's own block public access page. The shared helper
is dropped and S3 and Lambda web functions are as on main; folding
their copies into one helper belongs to a separate change.

DSQL now has its own keys: the trusted ones its page lists, and
aws:SourceIp, aws:SourceVpcArn and the three aws:Vpce* keys, which the
page leaves out but DSQL accepts (measured, eu-west-1, 2026-10-20). As
the page says, a policy variable never restricts: StringEquals with
${aws:PrincipalArn}, ${aws:SourceVpc} or a role/${aws:username} ARN is
public on DSQL. ArnEquals reads like ArnLike, as IAM matches both the
same way, so a value that is no ARN, ${aws:SourceArn} among them,
matches nothing and restricts, as measured.

DeleteClusterPolicy left the deleted version on the cluster, so a put
naming it went through; it is now cleared, and a put that names a
version on a cluster with no policy is refused as not found.
2026-10-20 15:34:39 -04:00
Jackson Price a434e52892 fix(elbv2): refuse CreateLoadBalancer with neither Subnets nor SubnetMappings (#6087)
* test(elbv2): give the tests' subnetless load balancers subnets

CreateLoadBalancer takes Subnets or SubnetMappings for every load
balancer type, and AWS refuses a request with neither. Tests that
created a balancer with neither, to exercise listeners, the data plane,
CodeDeploy, API Gateway or CloudFormation, now give it two default
subnets: the src/test classes through Ec2Service.defaultSubnetId, the
Java compatibility suite through a new TestFixtures.defaultVpcSubnets.

setSubnetsAfterSubnetlessCreateCanAdoptCustomVpc becomes
setSubnetsInAnotherVpcIsRefused, since a balancer created with subnets
keeps its VPC. The adoption it covered still applies to a balancer an
earlier version saved without subnets, and ElbV2ServiceTest now covers
that.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* fix(elbv2): refuse CreateLoadBalancer with neither Subnets nor SubnetMappings

A CreateLoadBalancer that named neither Subnets nor SubnetMappings made
a load balancer with no Availability Zone and no VPC, where the API
reference says every type takes one or the other. It now answers
ValidationError and creates nothing, with the message AWS gives for the
type: "At least two subnets in two different Availability Zones must be
specified" for an Application Load Balancer, "At least one subnet must
be specified" for a Network or Gateway Load Balancer. A CloudFormation
load balancer with neither fails its stack the same way.

The check runs after the duplicate-name check, because a stack update
finds the balancer it keeps through DuplicateLoadBalancerName whatever
subnets its template names. A balancer an earlier version saved without
subnets still works, and its first SetSubnets still gives it a VPC.

Follow-up to the review of #5881.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* refactor(elbv2): take a request's Subnets or SubnetMappings from ElbV2Service

The rule that Subnets and SubnetMappings are alternatives, and its
ValidationError, was written out three times: in the Query handler's
CreateLoadBalancer and SetSubnets, and in the CloudFormation
provisioner. ElbV2Service.requestedSubnets now holds it, and all three
take the request's subnets from there. Valid requests resolve the same
subnets as before, and both together are still refused with the same
error.

A new test pins the SetSubnets path, which had none.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* docs(elbv2): say when CloudFormation refuses a load balancer without subnets

The behaviour note said a CloudFormation load balancer with neither
Subnets nor SubnetMappings fails its stack the same way as the API
does. That holds when the stack creates or replaces the balancer. An
update that keeps the balancer finds it by its taken name before the
subnet check, so it leaves the balancer on its subnets, as before.
The note now says so.

The requireSubnets Javadoc no longer presents the Gateway Load
Balancer message as AWS's own. No public record of it was found; it
is the Network Load Balancer one, since a Gateway Load Balancer takes
subnets the same way.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(elbv2): give the remaining subnetless test requests subnets

Review follow-ups:
- The two duplicate-name tests, ElbV2IntegrationTest and the
  compatibility suite's ElbV2Test, sent a create with no subnets, so
  they passed only because the name is checked first. They now name
  subnets. The compatibility one also changes the scheme, because AWS
  answers a create that repeats a balancer's settings with success.
- ElbV2CfnProvisionerTest's successful creates and replacements now
  provision templates with two subnets and match them, rather than a
  subnetless create the real service refuses. The kept-balancer
  updates keep their subnetless templates.
- The CloudFormation case that leaves both properties out checks that
  its template really has no SubnetMappings, so a reformatted template
  cannot quietly turn it into the empty-list case.
- TestFixtures.defaultVpcSubnets() fails with a message when the
  region has no default VPC or fewer than two default subnets.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(elbv2): say which subnet messages are AWS's in the test docs

Second-round review follow-ups, wording only:
- The ELBv2 unit and Query-protocol tests of a create with neither
  Subnets nor SubnetMappings now say the messages are the ones AWS
  gives an Application or a Network Load Balancer, and that a Gateway
  Load Balancer gets the Network one, as the service's Javadoc does.
- The provisioner test's onTwoSubnets builds its list from TWO_SUBNETS,
  the list its stubs match, and its Javadoc no longer reads as two
  subnets for every type.
- TestFixtures.defaultVpcSubnets() says an Application Load Balancer
  needs two zones, not every load balancer.
- The ELBv2 docs say a CloudFormation update moves a balancer when it
  names other subnets, since one that names none leaves it in place.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

---------

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
2026-10-20 13:08:31 -04:00
Mohith 645c97c803 fix(cognito): return USER_ID_FOR_SRP in the SOFTWARE_TOKEN_MFA challenge (#6086)
* fix(cognito): return USER_ID_FOR_SRP in the SOFTWARE_TOKEN_MFA challenge

The SOFTWARE_TOKEN_MFA challenge carried the canonical username under
USERNAME. AWS returns it as USER_ID_FOR_SRP, the key clients read to
build USERNAME and SECRET_HASH for the challenge response, so they could
not answer the challenge.

The challenge now carries USER_ID_FOR_SRP (the sub in a pool with
UsernameAttributes) and FRIENDLY_DEVICE_NAME when one was set, matching
the InitiateAuth API reference example. VerifySoftwareToken keeps the
FriendlyDeviceName on the user and replaces it with each newly verified
authenticator. Every flow that ends in SOFTWARE_TOKEN_MFA shares the
same builder, so password, admin password, SRP, USER_AUTH,
NEW_PASSWORD_REQUIRED and SELECT_MFA_TYPE all get the new parameters.
MFA_SETUP is unchanged.

Fixes #6074

* fix(cognito): reject an over-long FriendlyDeviceName in VerifySoftwareToken

VerifySoftwareToken stored a FriendlyDeviceName of any length and later
returned it in the SOFTWARE_TOKEN_MFA challenge. The service model caps
the member at 131072 characters, and AWS rejects a longer value during
request validation, before the code is checked.

A longer name now fails with InvalidParameterException and the Smithy
length-constraint message, before any session, token or code is looked
at, so the user's authenticator, pending association and remaining
attempts are left as they were. The length counts Unicode code points,
as Smithy's length trait does, so a name of supplementary characters
such as emoji is measured in characters rather than UTF-16 units. An
absent or empty name is unchanged.
2026-10-20 13:02:17 -04:00
Mohith b8d87df054 fix(cloudwatch): reject PutMetricData datums without a MetricName (#6072)
* fix(cloudwatch): reject PutMetricData datums without a MetricName

MetricName is the one required member of MetricDatum. The JSON handler
stored a nameless datum under an empty name, and the Query handler
treated a member without MetricName as the end of the list, silently
dropping it and every later datum while still storing the earlier ones.

Both handlers now reject a missing or empty MetricName in top-level
MetricData and in EntityMetricData[].MetricData with MissingParameter
(400), the error PutMetricData declares for a missing required input,
naming the offending member. A whitespace name is still accepted, since
AWS constrains MetricName only to 1 to 255 characters. Every datum is
validated before any is stored, so a rejected request leaves no state
behind. On Query, a member index with no keys at all still ends that
MetricData list.

* fix(cloudwatch): return MissingRequiredParameterException on JSON and CBOR

CloudWatch is awsQueryCompatible. MissingParameter is the awsQueryError
code of the MissingRequiredParameterException shape, so it belongs in the
Query <Code> and the x-amzn-query-error header, while a JSON 1.0 or CBOR
body's __type names the shape. With the code in __type the AWS SDK v2
raised a generic CloudWatchException instead of the modelled one.

A package-private CloudWatchMetricsException keeps the Query code as its
error code and overrides jsonType() with the shape name, the same split
SwfException makes. The shared query-code table in AwsException is left
alone because SQS reports MissingParameter as its JSON type.
2026-10-20 10:07:57 -04:00
David 1f96bf42f1 feat(ecr): registry policy, replication and scanning configuration (#5817)
* feat(ecr): registry policy, replication and scanning configuration

PutRegistryPolicy, GetRegistryPolicy, DeleteRegistryPolicy, PutReplicationConfiguration,
DescribeRegistry, PutRegistryScanningConfiguration and GetRegistryScanningConfiguration store
the registry's own settings per account and Region and return them as written. Floci does not
replicate or scan images or evaluate the policy, as with repository policies.

- The policy must be a JSON object; a missing one is RegistryPolicyNotFoundException.
- Replication destinations, filters and rule counts are checked against the service model, and
  an empty rules list clears the configuration.
- Scanning defaults to BASIC with no rules, and CONTINUOUS_SCAN is refused with BASIC.

Closes #5803

* fix(ecr): put the registry setting writes under one lock

PutRegistryPolicy, DeleteRegistryPolicy, PutReplicationConfiguration and
PutRegistryScanningConfiguration read the registry's one settings record, change a
field and write it back. Terraform applies the three resources in parallel, so two
writers could start from the same record and the later write dropped the other's
setting. The read, change and write now happen under a lock per account and Region.

* refactor(ecr): check registry setting requests against the vendored model

The Resource Groups request walker moves to core.common as RequestConstraintCheck, so
a service can check a JSON request against botocore's constraints: member types,
required members, lengths and counts, number ranges, patterns and enums, each
answered in the service's own words. Resource Groups keeps its BadRequestException
messages.

- tools/aws/request_shapes.py gains build_constraints, which
  regen_resource_groups_shapes.py now calls; its vendored file is unchanged.
- tools/aws/regen_ecr_shapes.py vendors ecr-request-shapes.json for the seven
  registry setting actions, and aws-data-sync and aws-data-check run it.
- EcrJsonHandler checks those requests first, answering InvalidParameterException in
  ECR's form. The hand-written checks the model states are gone; a policy that is
  not a JSON object and CONTINUOUS_SCAN with BASIC stay, as the model cannot say
  them.
2026-10-20 10:03:30 -04:00
Jackson Price 9f9c16a181 fix(ec2): honor IncludePublicKey when describing key pairs (#6055)
* fix(ec2): honor IncludePublicKey when describing key pairs

DescribeKeyPairs ignored IncludePublicKey. With IncludePublicKey=true each
key pair now carries its OpenSSH public key, with the key-pair name as the
comment in place of any comment an imported key had; omitted or false
leaves it out. Imported material that is not a whole OpenSSH key, such as
PEM or RFC 4716 text, a blob missing a field its type needs, a line that
names another type than its blob, or a key type other than RSA, ED25519,
ECDSA and their security-key forms, is kept as given and described without
a public key. SshPublicKeys.carriesAKey checks the fields each type needs.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* fix(ec2): describe a key pair's key only when it is exactly one key

DescribeKeyPairs with IncludePublicKey=true still described a blob with
bytes after its key, which OpenSSH and Go's ssh package refuse, and the
first of several key lines, although an instance launched with the key
pair trusts every line. Both are now described without a public key. A
key pair stored before KeyName was required gets no comment instead of
"null". carriesAKey reads the RSA fields once through the reader.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* fix(ec2): leave a key-pair name that cannot be a comment off the key

ImportKeyPair accepts a key-pair name with a line break, and as the comment
of the described key such a name split it into lines that authorized_keys
reads as further keys. A name holding a control character is now left
off. carriesAKey names each ECDSA curve's coordinate size and reads a
security key's application field directly, and its docs say it checks
the format only.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* docs(ec2): name the key types and formats a described key pair needs

The Key Pairs section now names DER beside PEM and RFC 4716, and the two
security-key types OpenSSH has, instead of a security-key form for every
type. The SshPublicKeys class comment covers the whole-key check, and a
test comment no longer says a tab would split the described key.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* docs(ec2): list the described key types by their wire names

The Key Pairs section lists the key types a key pair is described with by
their OpenSSH names, which reads one way only, and the SshPublicKeys
comments name the two security-key types instead of implying a
security-key form for every key type.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

---------

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
2026-10-20 09:54:54 -04:00
David Phillips 689201122f fix(ec2): add opt-in Standard On-Demand vCPU admission (#6058)
* feat(ec2): enforce Standard On-Demand vCPU limits

Keep EC2 launches and restarts within regional account limits.

* fix(ec2): preserve quota lifecycle and launch semantics

Keep Spot launches independent and pending restarts recoverable.
Report incomplete CloudFormation restoration accurately.

* fix(ec2): make vCPU admission opt-in and running-only
2026-10-20 08:38:21 -04:00
David Phillips 08d5a9c742 fix(rds): retain requested storage types (#6057)
* fix(rds): retain requested storage types

Keep database storage settings across updates, copies and restarts.

* fix(rds): retain Provisioned IOPS storage types
2026-10-20 08:22:19 -04:00
Mohith 03f5730396 fix(cloudwatch): store datums sent in PutMetricData EntityMetricData (#6070)
The CloudWatch Agent sends PutMetricData with an empty top-level
MetricData and every datum nested under EntityMetricData[].MetricData.
Both the JSON 1.0 handler (also reached by Smithy RPC v2 CBOR) and the
Query handler read only the top-level list, so the agent's metrics were
silently dropped.

Both handlers now append each EntityMetricData entry's datums to the
top-level ones and store them under the request Namespace, with the same
parsing as top-level datums. Entity and StrictEntityValidation are
accepted and ignored. The per-request INFO logs of the raw request and
parsed datums are lowered to a DEBUG count.

Fixes #6066
2026-10-20 08:19:42 -04:00
David c6551a47bc feat(ecr): PutImage and the layer API (#5784)
* feat(ecr): PutImage and the layer API

PutImage, BatchCheckLayerAvailability, GetDownloadUrlForLayer, InitiateLayerUpload,
UploadLayerPart and CompleteLayerUpload now go through the registry:2 container that
docker push already writes to, so an image written through the API is the image
docker pull and BatchGetImage return.

- PutImage writes the manifest under its tag, or under its digest. It answers
  ImageDigestDoesNotMatchException, ImageAlreadyExistsException,
  ImageTagAlreadyExistsException and LayersNotFoundException as the model lists them.
- Layer uploads map onto registry upload sessions, held in memory. Parts must follow
  each other, be at most 20 MiB, and all but the last at least 5 MiB.
- GetDownloadUrlForLayer returns the blob's address on Floci's registry endpoint.
- The immutable-tag guard moves into EcrService, so a docker push and a PutImage of
  one tag cannot both succeed.

Closes #5735

* fix(ecr): refuse mixed layer digests, keep push time on retag, expire idle uploads

CompleteLayerUpload refuses a second, different layer digest instead of
ignoring it. PutImage keeps an image's first push time when it retags it.
A layer upload idle for a day is refused even when no other upload opens,
and dropping one cancels its registry upload session.

* fix(ecr): check PutImage tags, require a manifest media type, share registry error handling

- PutImage checks imageTag against the OCI tag grammar and answers
  InvalidParameterException otherwise. The tag goes into the registry's manifest URL,
  so v1?x wrote v1 and a slash wrote into another repository.
- A manifest with no mediaType needs imageManifestMediaType, as on AWS, instead of
  Floci guessing one from the manifest's shape.
- PutImage and the layer API reach the registry through one helper, callRegistry,
  in place of five copies of the same failure handling.

* fix(ecr): answer ECR's own message for a tag outside its rule

PutImage refuses a tag outside ECR's rule, [a-zA-Z0-9-_.]+ up to 300 characters,
with ECR's message. A tag ECR takes but the backing registry cannot hold, one
starting with '.' or '-' or longer than 128 characters, is refused with a message
naming that limit, which docs/services/ecr.md now notes.
2026-10-20 07:29:43 -04:00