Commit Graph
5100 Commits
Author SHA1 Message Date
Tyler Webb 8eaf5bf59c feat(apigatewayv2): support IntegrationSubtype and invoke SQS-SendMessage on HTTP APIs (#7969)
CreateIntegration, UpdateIntegration, GetIntegration(s), OpenAPI import and
AWS::ApiGatewayV2::Integration now carry IntegrationSubtype. A subtype is
accepted only on an HTTP API AWS_PROXY integration with payload format 1.0
(the default when a subtype is set), and its RequestParameters must map every
required member of the action and nothing it does not take. SQS-SendMessage is
the supported subtype. The JSON 1.1 path keeps RequestParameters keys as sent,
since subtype parameters are PascalCase member names.

An HTTP API route whose AWS_PROXY integration has an IntegrationSubtype now
runs that AWS service action instead of resolving a Lambda function from the
integration URI. RequestParameters are mapped at invoke time: static values,
whole expressions such as $request.body, $request.body.<JSONPath>,
$request.header/querystring/path, $context and $stageVariables, and
expressions embedded as ${request.header.X}. Region selects the action's
region. A required parameter that maps to nothing answers 400
MissingParameter. The response is 200 with the action's result in the
<Action>Response/<Action>Result envelope; an action error keeps its status.
Lambda AWS_PROXY and HTTP_PROXY dispatch are unchanged.

Every subtype AWS defines is now known, with its required and optional parameters from the AWS reference, so create and update validate all of them instead of rejecting the ones Floci does not invoke. Only SQS-SendMessage carries a service action.

The subtype check is a package-private static method, and OpenAPI import and reimport run it over every x-amazon-apigateway-integration while planning, before any route or integration is deleted or created.

$request.body.<path> read a scalar through json-path as a JsonNode and threw ClassCastException, which escaped as a 500. The value is now read as an Object and converted, and resolution runs inside the dispatch error handling.

MessageAttributes and MessageSystemAttributes are parsed as JSON templates first and expressions are resolved only inside their string values, so a header holding quotes or braces stays one literal string instead of adding attributes.

Subtype parameters also resolve accountId, apiId, domainName, httpMethod, path, requestTime, requestTimeEpoch, routeKey and stage from $context. A subtype without a service action answers 500 at invoke.

UpdateIntegration keeps a field the request leaves out, so an AWS::ApiGatewayV2::Integration update that drops IntegrationSubtype kept the old one. The provisioner now clears it explicitly, records the prior subtype in the rollback snapshot and restores it when the update fails.

A number or boolean value is read as its text, and an object or array value is a 400 BadRequestException instead of an unchecked conversion error.

Adds invoke cases for $request.body.<field>, a header that tries to break out of its MessageAttributes value, and $context variables; a stored-but-not-invoked SQS-PurgeQueue integration; a reimport with an invalid subtype that leaves the API unchanged; and number and object RequestParameters values on the JSON protocol. Queue creation now sits inside the cleanup block.

A MessageAttributes or MessageSystemAttributes value that does not parse as a JSON object was interpolated as raw text, so a request value could add or change members of the attributes object. It is now an InvalidParameterValue 400; whole source expressions such as $request.body.attributes or ${request.body.attributes} still resolve as before.

- A required parameter mapped to null or a blank string is rejected like a missing one.
- A MessageAttributes or MessageSystemAttributes value must be a JSON object or a source expression.
- Number and boolean RequestParameters values sent to the REST endpoints are read as text, and object or array values are a 400 instead of a ClassCastException.
- UpdateIntegration that adds a subtype to an integration without one, and sends no PayloadFormatVersion, stores 1.0 as CreateIntegration does.
- The create, update and OpenAPI import paths share one payload format default.

- $context.requestId is the request's gateway id, honouring a valid x-amzn-RequestId override, instead of a fresh UUID.
- $context.domainName is the Host the request arrived on, falling back to the execute-api host, and $context.domainPrefix, extendedRequestId and protocol resolve.
- $context.path carries the stage prefix for a named stage, as HTTP API authorizer identity sources do.
- An integration without a Region parameter calls the service in the API's region, or the default region when the request carried none.

An x-amazon-apigateway-integration in an AWS::ApiGatewayV2::Api Body dropped integrationSubtype and requestParameters, so the API was created with a plain AWS_PROXY integration that never reached the service action. Both are now passed to CreateIntegration, which validates them as it does for every other caller. The PayloadFormatVersion default for AWS::ApiGatewayV2::Integration uses the shared helper.

The rollback snapshot restored the subtype only when the integration had one, so a failed update that added a subtype left it in place. The snapshot's subtype is now restored as recorded, null included, and a subtype change no longer marks the update as one whose other fields cannot be rolled back.

The template reader now fails on trailing tokens, so a value such as {"a":1} trailing no longer passes CreateIntegration and then has its tail dropped. The call-time check on a resolved JSON parameter uses the same reader instead of the application ObjectMapper, so create and invoke accept the same values.

A parameter value starting with $ was taken as an expression even when it named no source, such as "$5 off" or the typo $request.heder.x, so it passed CreateIntegration and resolved to nothing on every call. CreateIntegration, UpdateIntegration and OpenAPI import now answer it with a BadRequestException. The accepted sources are $request.header., $request.querystring., $request.path., $request.body and $request.body., $context. and $stageVariables., checked for a whole-value expression, each embedded ${...} expression, and the string values of a JSON parameter's object. A $ elsewhere in a value stays static text, so mixed templates are unchanged.

UpdateIntegration replaced RequestParameters wholesale, so an update that
set one optional parameter on an SQS-SendMessage integration dropped
QueueUrl and MessageBody and then failed the required-parameter check.
AWS merges: a named key is added or replaced, a key sent as an empty
string is removed, and an omitted key is kept. The merge applies to every
HTTP API integration, and the subtype check runs on the merged map.

The AWS::ApiGatewayV2::Api Body path passed requestParameters through as
objects, so an object-valued MessageAttributes was rejected as not a
string. It now reads every value with the importer's own conversion: a
number or boolean as its text, and an object or array as its JSON text.

A whitespace-only value is a valid SQS message body, and how API Gateway
treats one is unmeasured, so create now applies the same isEmpty check
invoke does instead of rejecting blank values.

ApiGatewayV2Service.stringParameters already reads number and boolean values as text and rejects object and array values, so the handler no longer converts them too.
2026-11-11 08:44:22 -04:00
TATSUNO “Taz” Yasuhiro a3a718bf55 perf(sts): build the query parameter map only for a request with a query string (#7987) 2026-11-11 08:36:41 -04:00
TATSUNO “Taz” Yasuhiro 809c003614 fix(dynamodb): list every CreateTable constraint error in one message (#7974)
* fix(dynamodb): list every CreateTable constraint error in one message

DynamoDB checks the members of a CreateTable request in a fixed order,
whatever order the request gives them: GlobalSecondaryIndexes,
BillingMode, SSESpecification, KeySchema, ProvisionedThroughput,
StreamSpecification, AttributeDefinitions and LocalSecondaryIndexes.
It lists every constraint error in one ValidationException and reports
the first 10. An index name gets its length error before its pattern
error.

* fix(dynamodb): count null list members in CreateTable constraint positions

DynamoDB skips a null list member in the CreateTable constraint checks,
but it still counts it in the positions and in the list length. So
[null] is not an empty list. A quoted NonKeyAttributes list shows the
member as null.

* fix(dynamodb): refuse an empty CreateTable KMSMasterKeyId

DynamoDB refuses a KMSMasterKeyId outside 1 to 2048 characters, counted
in code points, though the API reference gives no length for it.

The billing mode and SSE type checks now print their enum sets from the
same ordered lists as the CreateTable constraint checks.
2026-11-11 08:30:07 -04:00
Suja Shaj 3d3e94dcc6 fix(cloudformation): give a DB instance its security groups and encryption (#7867)
An AWS::RDS::DBInstance created through CloudFormation never received
its VPCSecurityGroups or StorageEncrypted, so describe-db-instances
showed neither. Both now reach the instance on create.

A stack update that changes the groups moves the instance to them in
place, and one that drops them puts a standalone instance on its VPC's
default group, as AWS does; a cluster member keeps its groups. A
rollback puts the previous groups back. StorageEncrypted can only be
set at create, so changing or dropping it replaces the instance: the
old one is deleted once the update commits and kept when it rolls
back. A custom-named instance refuses the change, as on AWS.

Part of #7603

The rollback test of a security group change now starts from two groups
and from none, as well as from one, so a saved list that kept only its
last group, or saved nothing for an instance that had none, fails it.
The line that saves the list now creates the array first, which reads
more plainly.

The docs and the encryption record's Javadoc now say that an instance
created before StorageEncrypted was applied, whose template sets it
through a parameter, does not see a change made only through that
parameter on its first update, as Ec2Tags.ownedKeys already notes for
tags.

The DB instance and DB cluster arms refuse a custom-named replacement
through CfnExceptions.customNamedReplacement, and the private copy is
gone.

The DB cluster's createOnly record and the AssociatedRoles record are
CreateOnlyInputs constants now, beside the DB instance's encryption
record, so all three are read, written, put back on a rollback and
cleared on commit through it. The attribute names are unchanged, so a
stack created before keeps its records, and an update that leaves the
cluster record as it was still saves no copy of it.

One thing changes with it: the roles record an update overwrites is now
saved every time, where it used to be saved only when no saved copy was
there. A committed in-place update used to leave that copy on the
resource, so a stack from then could have its roles record rolled back
to an older one by the first update that fails; a test covers it.

The encryption record's Javadoc and the docs now say that the previous
template resolves on the update, so a change made only through a
parameter, or anything else the update changes, is not seen.

An update whose template changed a cluster member's VPCSecurityGroups
moved the member to the new groups. On AWS the handler sends that change
to ModifyDBInstance and RDS refuses it for a member, whose groups are
its cluster's, so the update fails. It now fails the same way, with
InvalidParameterCombination and RDS's message, before anything on the
instance changes.

The change is read from the template, as AWS's handler reads it, so a
member whose list stays the same still updates, including one a stack
created before Floci applied the groups. Refusing the property outright
would fail a list that matches the cluster's, which the schema allows.
2026-11-11 00:49:50 -04:00
Priamo Germosen 3270066923 test(compat): avoid coarse Redshift stack waiter polling (#7933) 2026-11-10 22:48:11 -06:00
Priamo Germosen 173141c5f2 fix(emr): give Hive one AWS SDK on emr-6.x images (#7921)
A Hive step or an EMR Serverless Hive run on a table in S3 failed on
emr-6.15.0 with NoSuchFieldError: AWS_S3_DISABLE_EXPRESS_SESSION_AUTH as
soon as S3A built its client.

Those images' Hive lib folder has the stock AWS SDK v2 modules, and the
S3 client is only in Tez's plug-in, EMR's own build of the SDK, later on
the class path, so that client ran on the stock sdk-core.

The modules the plug-in also holds now go, by name, before Hive starts,
while the container is still root: in a Hive run's wrapper, and in the
primary node's script, as the metastore service opens a table's S3
location with S3A too. An image with no loose sdk-core, as emr-7.5.0 and
emr-7.10.0 have, or without the plug-in keeps every jar.
2026-11-10 22:48:01 -06:00
Priamo Germosen 9eb3ba38ed ci: weigh the two slow EMR Docker classes when partitioning test shards (#7901)
partition.sh balances shards by class count, which says nothing of how
long a class runs. EmrDockerRunnerDockerIntegrationTest and
EmrHiveStepsDockerIntegrationTest take about 540s between them, so the
shard holding them ran 1246s of Surefire's 1500s while the others ran
641s to 869s, and one run has already been cut at the limit.

- SLOW_CLASSES gives the seconds of those two, by class name, so a
  package rename leaves them alone. A class counts for that many average
  classes, and every other class counts as one, so with none listed the
  assignment is what it was.
- Groups are packed heaviest first by that weight rather than by their
  number of classes, and a slow class without a profile goes before the
  others, so the rest are placed around them.
- A name that no longer matches a class is an annotation, not a failure,
  as a stale key is for the image prefetch: the shards are only uneven.

Summing the 2026-11-09 run's class timings over the classes at this
commit, the slowest shard goes from 1136s to 989s. A profile of its own
for the EMR classes gave 1321s and a sixth shard 1117s, as neither tells
the partition that those classes are slow.
2026-11-10 22:47:50 -06:00
Priamo Germosen dfec9737a6 feat(iam): check Lake Formation, Macie and Inspector by their REST routes (#7869)
Under enforcement a REST route no rule maps and no vendored model names
runs unchecked. Lake Formation, Macie and Inspector were among those:
of their 33 served routes only Inspector's Disable had a rule, added by
hand. AWS's Service Reference gives 32 of those 33 actions no resource
type, so each is authorized on "*", which is what the route join added
in #7461 already checks when the model is vendored.

Vendors the three models, so all 33 are checked as their operation's
action. A caller holding no grant for them is now refused where the
request used to pass; that is the behaviour change.

The 33rd is Macie's CreateMember, on the POST /members it shares with
Security Hub, which AWS authorizes on the member it makes and with the
tags it carries. A correction fills the member from account.accountId,
so a grant or a deny scoped to one member holds, and Macie joins the
tag-on-create table, so a request with tags needs macie2:TagResource
and its tags are what aws:RequestTag and aws:TagKeys see.

Inspector's Disable rule goes, since the vendored route gives the same
action. Macie and Inspector move into the table of request resources,
their reason for staying out (no model vendored) no longer being true.
Lake Formation has no resource type at all, so that table does not
list it.

Regenerating the tables also brings in es:UpdateClone, which AWS has
added since. Floci does not serve it.
2026-11-10 22:47:39 -06:00
Priamo Germosen 0197723641 fix(iam): simulate a principal without the policies the request excludes (#7865)
`SimulatePrincipalPolicy`'s `PolicyExclusionList` was read by nothing, so a caller
excluding a policy was given a simulation that still counted it, which is the
decision it had asked not to be given. The member is read now: each
`PolicyIdentifier` drops a policy from the set this one simulation evaluates and
from nothing else, the attachment and every listing left as they were.

The reference states both answers an entry gets, and those are the answers here:
"Syntactically invalid identifiers, such as malformed ARNs or wildcards in
disallowed positions, cause the request to fail with an InvalidInput error.
Syntactically valid identifiers that don't match any attached policy are
ignored." The constraints ahead of the operation already hold each member of an
entry to the shape the model declares, so an unknown `PolicyType` is the
`ValidationError` it always was; what the vendored data does not carry is the
union marker, so the rule that an entry names exactly one of the three is held
where the entry is read.

A `PolicyArn` is held to the one position the member admits a wildcard in, the
resource name, so a wildcard in the resource type an ARN carries ahead of it is
refused rather than matched: a `poli?y/reader` reads like the `policy/reader` it
would reach. It is held to carrying the fields every ARN carries too, its
partition, its service and its resource, a blank one being a malformed ARN rather
than an identifier that matches nothing. The region and the account are not among
those, an AWS managed policy carrying no region.

`PolicyType` reads as the part a policy plays rather than the kind of document it
is, which is what keeps `permission-boundary` in a value set beside
`user-managed`: a boundary is itself a customer managed policy, so a type meaning
the kind would match it twice. `scp` matches nothing, this simulation carrying no
SCP ceiling, and `rcp` is published as ignored. An ARN names the policy itself,
so it reaches that policy in whatever part it plays, the boundary included. The
account-level grant an account password policy carries is attached to nothing and
reached by nothing.

The wording of the two refusals no source gives, and the reading of a wildcard in
`AttachmentName`, which the member documents and its own declared pattern admits
no character for, are recorded under Policy Simulation in docs/services/iam.md.
2026-11-10 22:31:21 -06:00
Priamo Germosen 874493c446 feat(emr): run a cluster's Spark steps on YARN on its primary node (#7864)
A docker cluster's Spark steps ran in local mode, in one container, so a
script's own spark-submit --master yarn failed and a step's --deploy-mode
was dropped. On EMR "the primary node runs the YARN ResourceManager
service" and a core node "YARN NodeManager daemons, Hadoop MapReduce
tasks, and Spark executors".

- On a Docker network of the cluster's own, the primary node's container
  also runs a ResourceManager and a NodeManager, whose capacity is
  yarn-node-memory-mb and yarn-node-vcores.
- The node needs Spark, Python and what the bootstrap actions installed,
  so it runs from the image the steps run in: the bootstrap's, else the
  release's EMR Serverless image with its Hive image's HDFS, MapReduce
  and YARN, and Hive on a cluster with Hive. A cluster without Hive gets
  no hive, so its Hive step still says "Hive isn't installed.".
- Spark steps submit with --master yarn, keeping the step's own --master
  and --deploy-mode; a command's own spark-submit reads the same from its
  spark-defaults. Executors and a cluster-mode driver are sized for the
  NodeManager, which the cluster's spark-defaults replace, get the step's
  AWS environment, and reach Floci at its address on the cluster's
  network; a client-mode driver is reached at its container's name there.
- A YARN application's container logs go to
  <LogUri>/<cluster-id>/containers/<application>/<container>/ when a step
  ends, as a cluster-mode driver's output is there and not in the step's,
  without launch_container.sh, which holds the step's session.

A node that does not become ready leaves the last of its output in
Floci's log, as the container goes with its cluster.

YARN's Java 17 options go through JDK_JAVA_OPTIONS, which the Java 8 of
an emr-6.x image ignores.

An emr-spark-* release has no Hive image, and emr-7.5.0's HDFS and YARN
do not run on its newer Hadoop, so its image holds the whole of
emr-7.5.0's Hadoop in /opt, which only the node's daemons run from, and
Spark keeps the release's own. Those daemons are Hadoop 3.4.0's, where
the Release Guide lists 3.4.2 for these releases.

Clusters in a namespace the steps share or with no network stay in local
mode, as do MapReduce and Tez, and core and task instances get no
NodeManager yet.
2026-11-10 22:22:16 -06:00
TATSUNO “Taz” Yasuhiro ba28970a94 perf(core): build the query parameter map only for a request with a query string (#7978)
* perf(core): build the query parameter map only for a request with a query string

RESTEasy builds the query parameter map on the first read and wraps it in a
new map on every read. The protocol claim, the account filter, the signing
service lookup and the Query protocol entry point read it on every request of
every service, even when the request has no query string. Such a request now
gets a shared empty map.

* perf(core): read the Query protocol query string only without an Authorization header

The injected request context in the Query POST entry point is a CDI proxy, so
the shared helper could not see the server request and built the map anyway.
The query is only needed when the Authorization header is absent.
2026-11-11 00:17:52 -04:00
mrfelek bfea1bec1c fix(ssooidc): name the modeled exception in x-amzn-ErrorType (#7919)
SSO OIDC errors carried the OAuth error code in the body but no
x-amzn-ErrorType header. AWS sends both, and the SDKs resolve the modeled
exception from the header, so a pending device authorization surfaced as
an unmodeled 400 instead of AuthorizationPendingException: `aws sso login`
stopped polling and failed with "An error occurred (400) when calling the
CreateToken operation".

Every OIDC error now names its exception, derived from the OAuth code
(authorization_pending -> AuthorizationPendingException, slow_down ->
SlowDownException, invalid_grant -> InvalidGrantException, ...).

Address review on #7919: server_error is the one SSO OIDC error whose
modeled exception is not named after its OAuth code, so it mapped to
ServerErrorException, which the SDKs cannot resolve. It now maps to
InternalServerException. A unit test pins the header name for every OAuth
code Floci returns.
2026-11-10 19:10:55 -04:00
Andre Kurait 464e32fff4 test(elbv2): avoid a scheduler-dependent timeout assertion (#7944)
Keep the stopped-listener timeout assertion without requiring multiple polls within 350 ms. Dedicated refusal and handshake tests still assert the retry behavior.

Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-11-10 18:52:34 -04:00
Aditya Upadhye 2d8cdeb343 feat: add CloudWatch OTLP metrics ingestion (#7781) 2026-11-10 18:39:55 -04:00
mrfelek 00d2ab3207 fix(eks): scope clusters to the request Region (#7936)
EKS clusters are stored per account by name, and ListClusters returned every
cluster of the account whatever Region the request named. DescribeCluster and
every other cluster-scoped call also reached a cluster created in another
Region. On AWS cluster names are Regional: ListClusters only lists the
requesting Region's clusters, and the others answer ResourceNotFoundException.

ListClusters now filters on the cluster's Region (from its ARN), and the
cluster-scoped handlers answer ResourceNotFoundException for a cluster in
another Region. The ListClusters pagination token is bound to the Region
too. Floci's own restore and node-join paths still act on any Region.

requireClusterInRequestRegion now returns the cluster it checked, so handlers that looked the cluster up again with describeCluster use it directly. DeleteCluster checks the Region on the cluster it reads under its capacity lock, so the check and the delete act on the same cluster.

IAM resolved an EKS route's resource from the cluster EKS holds under that name in any Region. Clusters are Regional, so a request signed for another Region is now checked against that Region's cluster ARN, as a create there would mint it, and EKS then answers ResourceNotFoundException. IamRestRouteEnforcementIntegrationTest and ResourceArnBuilderTest relied on the cross-Region lookup and now check both sides.
2026-11-10 18:38:29 -04:00
James McMahon fe24f7736a feat: support one-off ECS scheduled scaling (#7895)
* feat: support one-off ECS scheduled scaling

* chore: cover application auto scaling scheduled actions with SDK

* fix: preserve scheduled action ordering and report failures

* test: cover scheduled suspension through the AWS SDK

* fix: validate scheduled action inputs and preserve explicit UTC

* test: tick explicitly when checking scheduled action rescheduling

* fix: reuse schedule parser and tighten scheduled scaling tests

* test: poll ECS cluster cleanup for late arriving tasks
2026-11-10 18:28:30 -04:00
Andre Kurait da5c0d8b36 fix(codepipeline): serialize stop publication with completion (#7939)
Serialize stop metadata and completion while keeping event publication outside the execution monitor. Preserve ordinary stop and abandon regressions.

Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-11-10 18:17:16 -04:00
Andre Kurait bad32b3598 test(elbv2): keep the original backend port occupied (#7934)
Keep the original listener bound instead of racing another listener to its released port. Verify the replacement registers a distinct port and retains forwarding. Separate fixture fix requested in upstream #7910.

Require a greeting sent only by the replacement backend while retaining the original occupied port, SDK target registration and binary echo checks. Name the non-closing mock for its retained listener.

Reuse the greeting backend setup and read-before-write check in both TCP forwarding fixtures. Preserve their distinct payloads, occupied-port and target-registration assertions.

Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-11-10 17:12:18 -04:00
Rashen Anupama b3de4b3179 fix(cloudformation): honor DynamoDB on-demand billing mode (#7931) 2026-11-10 17:06:48 -04:00
TATSUNO “Taz” Yasuhiro 77cb014f9d fix(dynamodb): refuse a query with more conditions than the key schema has (#7935)
DynamoDB counts the conditions of a KeyConditionExpression or KeyConditions
after it finds the table and index. When there are more conditions than key
attributes in the table or index key schema, it gives "The number of query
conditions (n) exceeds the number of key attributes defined in the schema (k)".
This comes before the missing key, unsupported condition and key type checks.
2026-11-10 16:53:08 -04:00
mrfelek fddd6b4d83 fix(ssoadmin): return CreatedDate on permission sets (#7918) 2026-11-10 16:37:46 -04:00
TATSUNO “Taz” Yasuhiro 57e4e3fe19 perf(core): parse the request URI only when the Cognito or S3 filter needs it (#7932)
The Cognito custom domain filter and the S3 virtual host filter run on every
request of every service. Each read the full request URI first, which parses
it and allocates about 340 bytes. RESTEasy keeps the first parse for the
request, so both filters had to change.

The Cognito filter now checks the routed path before it reads the URI. The S3
filter reads the URI only when the Host header is missing or a bucket matched.
2026-11-10 16:20:54 -04:00
Mario Toffia f37afdad81 fix(logs): support or in Logs Insights filters (#7924)
* fix(logs): support or in Logs Insights filters

A filter or where stage now keeps rows matching any or-joined comparison, case-insensitive, with parenthesized and nested groups. Syntax the engine does not model (and, not, ||, escapes, backtick fields, expressions in place of a field, empty stages) fails the query instead of returning a silently wrong result set.

Closes #7907

* fix(logs): limit Insights bare filter values to numbers and enforce the queryString length

An unquoted filter value is now a number compared by value, as on AWS (n = 2 matches 2 and 2.0).
Other unquoted values, such as a word or 1+1, fail the query instead of being read as text.
StartQuery rejects a queryString over 10,000 characters with InvalidParameterException, which
also bounds the nesting the or parser walks.

* fix(logs): keep Insights field parsing stack-safe and count queryString in code points

A long dotted field such as a.a.a... overflowed the stack in the field regex, which repeated a
group recursively; the repetition is now possessive and runs in a loop. The queryString limit
uses the shared Smithy length check, which counts code points as AWS does, so a query of
emoji under 10,000 code points is no longer rejected.

* refactor(logs): share one quote-skipping scanner across the Insights parser
2026-11-10 16:18:56 -04:00
Andre Kurait 0e244e5724 feat(ec2): delete launch template versions without reusing numbers (#7910)
Preserve default versions and the highest issued version across deletion, persistence and CloudFormation rollback.

Reject invalid DryRun values before deletion, tolerate only already-deleted versions during CloudFormation rollback, and preserve the resolution race fixture without reflective field mutation.

Reuse presence checks to retain name-specific disappearance errors and existing service-test factories.

Reuse existing EC2 test factories and the shared blocked-or-done wait while preserving all race assertions.

Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-11-10 15:50:33 -04:00
Matheus Oliveira 5b7468af43 fix(backup): add pagination to ListBackupJobs and ListRecoveryPointsByBackupVault (#7541) 2026-11-10 15:29:53 -04:00
Niels Kootstra 1da8982950 fix(athena): report each result column's SQL type in GetQueryResults (#7926)
* fix(athena): report each result column's SQL type in GetQueryResults

GetQueryResults read the result CSV back and reported every column as varchar,
so clients that build typed results from ColumnInfo got strings for numbers,
booleans and dates. After the query runs, ask floci-duck to DESCRIBE it, map
the DuckDB types to Athena type names, keep them with the query execution and
use them when the result set is built. A statement DuckDB cannot describe
keeps varchar.

Closes #7897

* fix(athena): report decimal precision and scale and time types in GetQueryResults

Keep the type DuckDB describes and map it when the result set is built, so a
decimal column reports its precision and scale in their own fields. Time and
the timestamp variants map to their Athena names, and a failed DESCRIBE is
logged at warn with its cause.
2026-11-10 14:04:34 -04:00
Koushik Dutta d97574207b feat(s3vectors): support vector bucket policy operations (#7825)
* feat(s3vectors): implement vector bucket policy management (create, get, delete)

* fix(s3vectors): validate bucket name length and ARN account in policy operations

* refactor(s3vectors): share bucket selector validation and use partitionForRegion
2026-11-10 13:58:19 -04:00
Charles Swanberg a5ab677d6b fix(pipes): apply an enrichment on a DynamoDB stream source and deliver its events as AWS does (#7055)
* fix(pipes): apply an enrichment on a DynamoDB stream source and deliver its events as AWS does

A pipe with a DynamoDB stream source, a Lambda enrichment and an event bus target put nothing on the
bus a rule could use: the stream path skipped the enrichment, an array answer reached the target as
one payload, Source and DetailType written as JSON paths went out as the literal text, and a template
of one placeholder naming a string put that string on the bus in quotes.

- The stream path runs the enrichment through the SQS path's step, once per filtered batch. Disposal
  stays each source's: SQS deletes its messages, a stream commits its position.
- An array answer reaches an event bus, SQS queue or SNS topic one element at a time. A Lambda or a
  state machine takes it whole. EventBridge User Guide, "Amazon EventBridge Pipes batching and
  concurrency": "Input transformers are applied separately on each individual JSON record in the
  array", and a target with no batch API, "such as Lambda and Step Functions", gets "the entire JSON
  array". https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes-batching-concurrency.html
- An event bus target's Source and DetailType, written as a JSON path, are read off the event before
  the template renders. "Amazon EventBridge Pipes event bus target": they "support dynamic JSON path
  syntax" and "can't reference new or transformed values resulting from input transformation". A path
  naming nothing fails the delivery, so no event reaches a rule under a literal or empty type.
  https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes-event-target.html
- A template of exactly one placeholder renders a string verbatim, which is what AWS does with
  <$.Detail> naming a serialized object; quotes added here made PutEvents refuse it as MalformedDetail.
  A placeholder inside a larger template renders as before.

Kinesis and Kafka sources still deliver straight to the target, as docs/services/pipes.md says.

Test: PipesStreamEnrichmentDockerIntegrationTest runs a real function behind a table's stream, with a
filter, and a rule on the bus matching a field of the detail reaches a queue. Without the fix it times
out with no event on the queue. PipesPollerTest and PipesTargetInvokerTest pin each rule.

* fix(pipes): fail an enrichment batch past the target's limit, and share the dynamic parameter resolver

An enrichment answering more than 10 events for an event bus, queue or topic
fails the batch without invoking the target, as AWS does, since 10 is what
those targets take in one request; the batch goes to the dead-letter queue
or is read again. The event bus Source and DetailType resolve through the
same method as a Redshift parameter, so a value counts as a path only when
the whole of it is one. pollSqs deletes a delivered batch's messages in one
place, and the Docker test uses SqsTestQueue and DynamoDbRequests.

* fix(pipes): deliver an enrichment array to Redshift whole, and skip the target on an empty string

Redshift has no batch API, so an enrichment's array reaches it in one BatchExecuteStatement as
before; only an event bus, queue or topic takes one event per element under the limit of 10. An
enrichment Lambda answering "" is an empty response, as AWS lists it, and invokes no target.
2026-11-10 13:49:49 -04:00
galsuchetzky-act 6038fe7fc9 refactor(rds): share numeric record paging (#7915) 2026-11-10 12:22:06 -04:00
Saim Zaib 9f94fcc974 feat(eventbridge): trust extra CAs from FLOCI_TLS_EXTRA_CA_PATH for API destinations (#7850)
Add floci.tls.extra-ca-path (FLOCI_TLS_EXTRA_CA_PATH): a PEM file of CA
certificates that Floci's own outbound HTTPS clients trust on top of the
JVM's default roots, and Floci's CA when TLS is on. It applies whether or
not TLS is enabled.

ContainerCaBundle.sslContext(config) merges the extra CAs and is now also
built with TLS off. floci-ca-bundle.pem and its .p12 are unchanged, so
containers Floci launches are unaffected in both modes. EventBridge API
destination delivery uses the context, and JwtSignatureVerifier already
shares it, so HTTP API JWT authorizers and AppSync OIDC providers trust
the extra CAs too.

TlsExtraCaStartupValidator refuses to start when the file is missing,
unreadable, or holds no certificate, from any config source. A private
key in the file is ignored.

Closes #5259

With floci.tls.extra-ca-path set and TLS on, a bundle that could not be
read or parsed made outboundTrustAnchors throw. sslContext(config) then
logged the extra CA file as the unreadable one, fell back to the bundle
alone, failed on it again and returned empty, so the valid extra CAs
were dropped.

The bundle is now read on its own: on failure Floci warns with the
bundle's path and trusts the JVM roots plus the extra CAs, as the
sslContext(config) Javadoc already describes.

ContainerCaBundle builds every SSL context and trust manager array from a
KeyStore, so sslContext(Path), trustManagers(Path) and the extra-CA
context no longer repeat the JCA calls.

Tests share LocalHttpsServer in testing for the localhost HTTPS server
issued by a CA, the two JWT issuer-trust cases share one helper, and the
JVM roots check in ContainerCaBundleTest is written once.

outboundTrustAnchors and trustStore(Path) now read a certificate file
through one method, which also refuses a file with no certificate.

In the tests added for the extra CA file, the certificate-and-key file
comes from one helper in TlsTestSupport, the two missing-file cases are
one parameterized test, and the refused EventBridge delivery is checked
by one helper.

TlsExtraCaStartupValidator now calls ContainerCaBundle.certificates
instead of reading the file and checking for a certificate on its own.
outboundTrustAnchors reads the bundle through the same method, and
ContainerCaBundle.extraCaFile is the one place that decides whether the
setting is set, for both the SSL context and the startup check. The
startup message still names the path and gives the reason.

Both EventBridgeInvoker constructors now get the API destination
HttpClient from one method, which adds Floci's outbound SSL context
when there is one.
2026-11-10 11:56:34 -04:00
Niels Kootstra 65b09d0aac fix(lambda): stream the body of a RESPONSE_STREAM function URL (#7885)
* fix(lambda): return the streamed body from a RESPONSE_STREAM function URL

A function URL in RESPONSE_STREAM mode parsed only the HttpResponseStream
prelude and dropped the body written after its eight NUL bytes, so callers got
the status and headers with an empty body. Split the stream at the delimiter
and return the rest as the body; a stream without a prelude is a 200
application/octet-stream, as on AWS. The stream is still buffered.

Closes #7837

* fix(lambda): stream the body of a RESPONSE_STREAM function URL as it is written

The runtime API now hands a streamed response to the invocation chunk by chunk,
ahead of the BodyHandler that buffers every other response, and completes the
invocation only when the stream ends, so the timeout, the concurrency permit
and the container stay held for the whole stream. The function URL answers as
soon as the head is known and writes each chunk as it arrives. The prelude is
read only when the stream's content type is
application/vnd.awslambda.http-integration-response; any other stream keeps
the content type the handler set.

* fix(lambda): check the streamed function URL response without timing it

The runtime API and controller tests pin chunk-by-chunk delivery, so the
end-to-end test only checks the status, content type and body.
2026-11-10 11:54:40 -04:00
Matheus Oliveira 8d95688eec fix(pipes): build flat Kinesis record shape with correct field values (#7554)
buildKinesisRecordNodes previously used valueToTree + PascalCase key
reads, losing all values and producing a nested kinesis object. Now
reads KinesisRecord getters directly and builds the flat Pipes shape,
with eventVersion, kinesisSchemaVersion, invokeIdentityArn and a
shardId-000000000000:<sequence> eventID.

- Fix PipesTargetInvoker base64 decoding for flat shape
- Decode base64 Kinesis data in PipesFilterMatcher before JSON parsing,
  through a helper shared with PipesTargetInvoker

Refs #7481

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-11-10 11:48:03 -04:00
galsuchetzky-act baa834101d test(rds): reuse the shared client for secret opt-out (#7909) 2026-11-10 11:31:26 -04:00
TATSUNO “Taz” Yasuhiro 77242aaceb fix(dynamodb): put UpdateItem expression errors in the validation envelope (#7882)
DynamoDB gives an empty UpdateExpression, a reserved word in it, and
AttributeUpdates with an UpdateExpression in the
"1 validation error detected: " envelope, before the table lookup. It
checks the ConditionExpression before the first two.
2026-11-10 11:04:11 -04:00
Nikola Genčić 43ad134107 fix(cognito): fire PreTokenGeneration for client_credentials tokens (#7891)
* fix(cognito): fire PreTokenGeneration for client_credentials tokens

The token endpoint issued client_credentials access tokens without ever
invoking the pool's pre token generation trigger, so claims and scopes a
V3_0 function returned never reached M2M tokens.

As on AWS, the trigger now fires with triggerSource
TokenGeneration_ClientCredentials when PreTokenGenerationConfig's
LambdaVersion is V3_0, and is skipped for V1_0 and V2_0. The event
matches the one AWS documents for the token endpoint: userName
ClientCredentials, the granted scopes, empty userAttributes, a null
groupConfiguration, the request's aws_client_metadata, and a response
whose claimsAndScopeOverrideDetails is null. Only accessTokenGeneration
applies to the token; claims that identify the client (sub, client_id,
token_use, version, iss, exp, iat, jti and the cognito: namespace)
cannot be changed, and an added aud must equal the client ID.

Fixes #7792

* fix(cognito): protect username and scope in client-credentials tokens

Addresses review feedback on the client-credentials pre token generation
trigger.

A V3_0 trigger could add a username claim to a machine access token, and
could replace or suppress the granted scope through claimsToAddOrOverride
and claimsToSuppress. As on AWS, username (along with device_key and
at_hash) is now protected in machine tokens, and scope changes only
through scopesToAdd and scopesToSuppress.

aws_client_metadata with a null value is now refused with
invalid_request, like any other value that is not a string.

* fix(cognito): send version 3 and accept only string metadata for client credentials

The client-credentials pre token generation event now carries version "3",
as in the AWS token endpoint example. aws_client_metadata is read as a JSON
tree and refused unless it is an object whose values are all JSON strings,
so numbers and booleans are no longer coerced to strings.
2026-11-10 11:01:14 -04:00
Vũ Thế Huy 2964140717 feat(redshift): prune Spectrum partitions for bind parameters (#7758) (#7863)
A prepared statement with a predicate on a bound value (WHERE day = $1) loaded every Glue partition, because the pruner read only literals. The Bind message now carries its text-format values, and the pruner reads each $n as the value bound to it.

A statement that is only being parsed has no values yet, so it loads no partition, enough for PostgreSQL to plan it; each Bind loads the partitions its values select. A NULL, binary-format or unreadable value leaves its predicate out and the query loads every partition. A malformed Bind parameter section leaves the values unknown instead of failing the connection.

Parse of a parameterized Spectrum statement no longer deletes partitions by cast key,
which could remove rows of overlapping partitions that stay recorded as loaded; the
Bind reconciles the table. Bind parameters are decoded only when a Spectrum statement
needs them, and binary values are skipped instead of copied.
2026-11-10 10:57:23 -04:00
Andre Kurait 9dae9f8036 test(stepfunctions): reuse client for remaining IAM task setup (#7840)
Complete the separate follow-up requested in upstream #7783. Preserve account-bound names, role paths, task definitions and cleanup while delegating to the existing StepFunctionsTestClient.

Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-11-10 10:52:11 -04:00
Andre Kurait ef1e00fba7 fix(controltower): generate IAM routes and request resources (#7872) 2026-11-10 10:46:59 -04:00
galsuchetzky-act c2aba45553 refactor(bedrock): reuse guardrail profile resource prefix (#7902) 2026-11-10 10:44:21 -04:00
TATSUNO “Taz” Yasuhiro 2e158f7d1d fix(dynamodb): refuse a nested or repeated key condition attribute before the table lookup (#7883)
* fix(dynamodb): refuse a nested or repeated key condition attribute before the table lookup

DynamoDB reports a KeyConditionExpression condition on a nested attribute,
or a second condition on the same attribute, with the
"Invalid KeyConditionExpression: " prefix. It checks both after the
expression walk and before the Select enum, the table lookup and the key
schema checks.

* fix(dynamodb): read key conditions grouped in parentheses as one list

DynamoDB reads AND groups in parentheses in a KeyConditionExpression as
if the parentheses were not there. This holds for the nested and
repeated attribute checks and for the key schema checks.

* fix(dynamodb): read grouped key conditions as one list for dynamodb:LeadingKeys

The IAM condition key reader now flattens AND groups the same way as the
key condition checks. A grouped condition like
"(h1 = :a AND h2 = :b) AND r1 = :c" on a multi-attribute index gave no
leading key, and a ForAllValues condition passes when that key is absent.
2026-11-10 09:33:07 -04:00
Andre Kurait 4512de1402 fix(rds): omit empty terminal pagination markers (#7900) 2026-11-10 09:16:40 -04:00
jwoa95 9c989d7457 fix(eventbridge): match numeric comparison patterns (#7695) (#7700)
Add numeric comparisons to the shared matcher used by TestEventPattern and PutEvents. Validate all numeric filters before testing events or mutating rules, including nested patterns and every $or branch. Match numeric and literal filters against event array elements without splitting range bounds across different values.

Add service and AWS SDK success/error regressions.

Validation: 293 focused tests pass; zero Checkstyle violations.

Fixes #7695

The validator accepted arbitrary operator/number pairs, allowing repeated bounds, equality mixed with bounds, and unordered ranges. Restrict filters to a single comparison or a lower bound followed by a strictly greater upper bound.

Add SDK rejection and rule-preservation regressions and valid range boundary controls. All 386 focused tests, Checkstyle, docs-check, and partition-check pass.

Keep the new range boundary cases aligned with the surrounding parameter tables. This also requests fresh CI checks on the verified PR history.

Use one testing fixture for valid comparisons and invalid patterns in both the service and SDK suites. Preserve the union of existing cases, including nested and matching alternative branches, so both layers exercise the same matrix.

Validation: 402 focused EventBridge tests pass with no skips and zero Checkstyle violations.

Expose PipesFilterMatcher.matchesNumeric and use it from EventBridge instead of maintaining a second comparison loop. Retain the null and numeric-form guards.

Use AwsTestClients.create directly in the EventBridge SDK tests and remove the custom SDK client builder and injected endpoint.

Validation: all 463 EventBridge service, EventBridge SDK, and Pipes matcher tests pass, with no skips and zero Checkstyle violations.
2026-11-10 09:08:43 -04:00
galsuchetzky-act 09ac552cf7 feat(cloudformation): provision AWS::CloudFormation::StackSet (#7244)
Create, update and delete StackSet resources and their instances through the existing StackSet service. Preserve current main's asynchronous automatic deployment and stable tag reads while reconciling the resource's declared account and organizational-unit targets and Regions.

Return StackSetId for Ref and Fn::GetAtt and cover the provisioner lifecycle with integration tests. OperationPreferences, CallAs and ParameterOverrides remain unsupported.
2026-11-10 08:54:32 -04:00
Priamo Germosen 128e4e6227 test(elbv2): avoid scheduler waits in backend TLS tests (#7876)
* test(elbv2): avoid scheduler waits in backend TLS tests

* test(elbv2): name probe-driven health waits
2026-11-10 06:51:45 -06:00
Tyler Webb e607b1a790 fix(eventbridge): match nested patterns against arrays of objects (#7849)
Narrow the change to the two array cases that element-by-element matching
of scalar arrays does not cover, and drop the scalar handling in
matchesSingleElement.

A nested pattern such as {"detail":{"items":{"id":["a"]}}} never matched
{"items":[{"id":"a"}]}, because matchesDetailNode looked the field up on
the array itself. A nested pattern now matches an array when any element
matches it, as PipesFilterMatcher.matchesNested does.

An empty array is treated as an absent field, so {"exists":false} matches
it and {"exists":true} does not.

The per-case TestEventPattern requests are replaced by one parameterized
test in EventBridgeServiceTest.
2026-11-10 08:51:06 -04:00
Priamo Germosen 8e4c1994b7 feat(codeartifact): retain pypi packages from the public:pypi external connection (#7741)
Adds the public:pypi external connection: a repository configured with it now
lists and, on a real download miss, retains packages from the live pypi.org
registry, the same promise-now/fetch-later miss-then-fetch behavior
CodeArtifact already has for npm's, NuGet's and Maven's own external
connections.

AWS documents Python's own retention as importing every asset of a resolved
version together ("CodeArtifact will import all the assets in that package
version", "some contain over 100 assets"), unlike npm/NuGet's one asset per
version; CodeArtifactPypiExternalConnectionImporter#tryImportAsset mirrors
that, fetching every real file the registry lists for the resolved version in
one claim episode, not just the one requested.

PypiExternalConnectionClient speaks the registry's real PEP 691 JSON Simple
API. A real PyPI file's download URL is not deterministic from its
coordinate (files.pythonhosted.org serves it under an opaque per-file hash
path, unlike NuGet's flat-container route), so the URL is read directly off
the trusted index response rather than built, with an explicit host
allowlist so this client never follows a URL to a host it does not actually
trust for that connection.

CodeArtifactPypiController#packageIndex merges in unretained external
filenames (listing-only, fetched lazily on an actual download miss), the
same split every other format's own importer here already uses, and now
also lists a package pypiserver has never heard of at all, as long as the
external connection does.

A file's version is resolved by checking its filename against the real
index's own versions list, reusing the existing
PypiserverSidecarClient#filenameEmbedsVersion rather than re-deriving it.
ensureRetainedPackageOriginDefaultIfCurrentRepository is used rather than
the plain variant, matching the stricter check
CodeArtifactNuGetExternalConnectionImporter already uses.

Deliberately out of scope, noted in the importer's own javadoc: refreshing a
retained version's yanked metadata on every later install (also
AWS-documented) -- pypiserver has no such concept in its wire protocol at
all.
2026-11-10 06:37:43 -06:00
Priamo Germosen 90a4455905 chore(iam): sync the tag-on-create table with what AWS has added (#7852)
make iam-tag-on-create-sync has failed since AWS listed three more
operations with a tagging action, because the generator found no request
member carrying tags on any of them and asks for a reason.

SSM's StartExecutionPreview has no such member at any depth, so it is
not read for that reason. Athena's CreateSystemTableConfiguration and
SageMaker's CreateClusterExtension do take Tags, but the pinned botocore
predates both, so their requests cannot be read yet. They get a reason
of their own, which the generator refuses once the pinned botocore has
the operation, so a bump cannot leave their tags unread. Floci serves
none of the three.

The sync also lists the new applicationinsights namespace, and iam.md's
count of operations read with their tags follows the table.
2026-11-10 06:37:23 -06:00
Niels Kootstra 14c3004240 fix(s3): return every bucket when ListBuckets has no max-buckets (#7886)
Paging ListBuckets capped a request without max-buckets at 10000 buckets with
a continuation token, so a caller that reads only the first response, like
the Floci UI, lost every bucket after that. Without max-buckets, return the
whole list on one page again.
2026-11-10 08:26:24 -04:00
Andre Kurait 6565225234 perf(rds): wake PostgreSQL initialization on startup logs (#7877) 2026-11-10 08:25:25 -04:00
Mario Toffia 8b48aafd44 fix(cloudformation): update the tags of an AWS::Events::EventBus in place (#7799)
* fix(cloudformation): update the tags of an AWS::Events::EventBus in place

A tag-only UpdateStack of an event bus was refused with "Updating
AWS::Events::EventBus Description, Tags, or Policy is not supported until
transactional rollback is available." and rolled back, so a template that
bumps a version tag could not be deployed.

The bus the stack already owns now takes the template's tags: a key the
stack set and the template dropped is untagged, a tag added outside the
stack stays, as measured on AWS. The tags of the keys the update touches
are snapshotted first, and rollbackUpdate puts them and the tracked keys
back when a later resource fails the update. Description and Policy
changes are still refused.

Closes #7796

* fix(cloudformation): keep a failed event bus tag update for its rollback

A tag call that fails after the bus's tags started changing left the
engine restoring the previous resource and marking it rolled back, so
the half-applied tags stayed. retainsFailedUpdateState now keeps an
attempt that carries the tag snapshot, and the rollback walker restores
it through rollbackUpdate, as the SSM parameter provisioner does.

* test(cloudformation): read EventBridge answers through callEventBridge

* refactor(cloudformation): share the tag snapshot of an update with SSM

The event bus recorded and read back the tags of an update the same way
the SSM parameter does. CfnRollback now holds that pair, putTagSnapshot,
snapshotTagKeys and snapshotTags, in the same tagKeys and tags fields, so
a snapshot an SSM update already stored still reads. The bus reconciles
its tags from the managed keys and the desired tags, as SSM's
reconcileTags does, so its update and rollback no longer each work out
the keys to remove.

* fix(cloudformation): read a null tag value back as null from a tag snapshot

* refactor(cloudformation): read the event bus update snapshot through CfnRollback

rollbackEventBusUpdate parsed its snapshot by hand, which is what
CfnRollback.updateSnapshot does; it now uses that and still reports
false when the bus carries no snapshot. The CloudFormation docs say
event bus tags now update in place on UpdateStack, keeping tags added
outside the stack, and go back when a later resource fails the update.
2026-11-10 08:17:17 -04:00