Commit Graph
3688 Commits
Author SHA1 Message Date
Priamo Germosen 401f5ce2d7 fix(iam): name a denied S3 POST in CloudTrail (#5942)
Under IAM enforcement a denied S3 request is recorded in CloudTrail as
the operation that was refused, but a denied POST on an object was not
recorded at all. CreateMultipartUpload and CompleteMultipartUpload are
both checked as s3:PutObject and SelectObjectContent as s3:GetObject,
so the action alone could not say which operation ran, and
RestoreObject had no name.

A denied POST is now named from the sub-resource that chose its action:
?uploads is CreateMultipartUpload, an uploadId CompleteMultipartUpload,
?restore RestoreObject and ?select SelectObjectContent, with ?uploads
ahead of an uploadId as S3Controller runs them. The S3 user guide lists
all four among the object data events CloudTrail logs. A POST naming
none of them still gets no name rather than a wrong one.

SelectObjectContent and GetObjectAttributes were missing from the
read-only events, so a trail logging only reads dropped their denials
and other trails recorded them as writes. CloudTrail counts an event
that changes no resource as read-only, and neither one changes the
object.
2026-10-18 20:43:25 -05:00
Priamo Germosen f0975a9f47 fix(iam): check iam:PassRole when Lambda or EC2 is passed a role (#5938)
Under IAM enforcement no request was checked for iam:PassRole. A user
allowed only lambda:CreateFunction, or ec2:RunInstances, could give the
function or the instance any role in the account, and Floci runs the
function with that role and serves the instance its credentials, so the
user could act with the role's permissions.

A request that passes a role to Lambda or EC2 now also needs
iam:PassRole on that role, as the IAM user guide requires: "To pass a
role (and its permissions) to an AWS service, a user must have
permissions to pass the role to the service." The check offers
iam:PassedToService, the service AWS's Service Reference names for the
operation, so a grant to pass a role to one service does not cover
another. It covers Lambda's CreateFunction, UpdateFunctionConfiguration
when it sets the role, CreateWebFunction and CreateWebFunctionRevision,
and EC2's RunInstances, RequestSpotInstances,
AssociateIamInstanceProfile, ReplaceIamInstanceProfileAssociation,
CreateLaunchTemplate and CreateLaunchTemplateVersion, which pass the
roles of the instance profile they name, and CreateFlowLogs. A Spot
Instance request now takes its instance profile by name as well as by
ARN, as RunInstances does, so the role checked is the one the instance
gets.

Launching from a launch template checks nothing, as on AWS: the EC2 user
guide warns that whoever can create a template version can pass its
role without iam:PassRole. The role parameters of other services are
left for later changes.
2026-10-18 20:43:15 -05:00
Priamo Germosen 494a6725a1 feat(iam): release and exchange the delegation token (#5914)
M4a dispatched the delegation request lifecycle as far as ACCEPTED and
stopped there, so no request reached FINALIZED and the credentials the whole
feature exists to hand over could not be obtained at all. This is the token
half: IAM SendDelegationToken and STS GetDelegatedAccessToken, the last two
of the ten operations the family spans.

SendDelegationToken takes a request id, answers no output shape, and moves an
ACCEPTED request to FINALIZED. The reference says that "cannot be rolled
back", which makes it the one transition that refuses to repeat itself:
releasing twice answers ConcurrentModification, the wrong-state shape the
other four writers already use. Releasing mints the token and records the
instant it happened, both on the request, because the shape publishes neither
and nothing else is going to hold them.

Releasing is also where OnlySendByOwner is finally read. M4a stored the flag
with nothing looking at it, which was right while nothing could release;
SendDelegationToken is the one operation it speaks to. It "prevents any party
other than the owner from calling SendDelegationToken API for this delegation
request", for the case the reference spells out: the owner lacked the
permission to approve, forwarded the request to a more privileged user, and
still has to be the one who hands the token over. So the release is the one
call on this family decided per identity rather than per account, the handler
passing the caller ARN as associate and accept already do, and an approver who
is not the owner answers AccessDenied 403, which the API reference publishes
as a common error for every IAM operation.

GetDelegatedAccessToken exchanges that token for credentials in the
customer's account. The delegation period "starts when customer releases the
exchange token, not when the product provider redeems it", and "all
credentials obtained from the same exchange token expire at the same time",
so the expiry is release plus SessionDuration whenever it is redeemed and a
token can be exchanged repeatedly, each exchange buying less time than the
one before. AssumedPrincipal is the identity that approved the request rather
than the one that claimed it: accepting a request "records the details and the
state of the identity that called this API", and "this is the identity that
gets mapped to the delegated credential", which the user guide says the same
way, the provider obtaining the "approver's temporary credentials". The two
are the same identity until a request is forwarded for approval, which is the
case OnlySendByOwner serves. PackedPolicySize is left out: the model
deprecates it and states it is not populated for this operation.

Two answers had to be chosen rather than read off, both forced by the error
set. GetDelegatedAccessToken models exactly three errors, and none of them
says "no such token", so a token nothing matches is answered as an expired
one: from the caller's side the two are the same situation, and the
reference's own remedy, "Request a new token and retry the operation", fits
both. A token offered by an account that did not file the request answers
AccessDenied 403 instead, the shape this handler already uses for a caller
who may not perform the operation, because "the exchange token can only be
redeemed by the product provider account that created the delegation
request" is a refusal rather than an expiry. The account is checked before
the window so that neither guard can hide the other, and both are tested
with the other one passing.

The code is ExpiredTradeInTokenException, not ExpiredTradeInToken. The model
writes the Exception suffix into error.code for that shape and for
RegionDisabledException while PackedPolicyTooLarge drops it, so each code is
read off its own shape rather than derived from the shape's name.

What the credentials carry is the request's PermissionPolicy, the policy AWS
renders from the partner's registered template. No API registers a template,
so nothing sets it and the session carries none, which is where M4a left
PolicyTemplateArn for the same reason.

The session is filed in the customer's account with no issuing key, and as a
delegated session rather than an issued one. The delegation is the customer's
grant, so a partner key that happened to name an IAM user must not become the
session's issuer: issuingUser bounds a session by the issuer's own
permissions, which would be the partner's rather than what the customer gave
away. The approver is carried in a field of its own for the same reason the
issuer is left empty. An issued session holds its identity in the role ARN
slot, which is resolved by name, so an approver named like a role would act
with that role's permissions, one named like no role would act with none, and
GetCallerIdentity would answer for a role that does not exist. A delegated
session instead resolves its approver from what the ARN says it is: a user's
own policies and boundary, the account's access where the root approved the
request, the role behind a session assumed from one, and nothing where that
identity is gone. The account is the owner's either way, a request being
visible only from the account that claimed it. The request's PermissionPolicy
still bounds it on top wherever one exists, which is where the registered
template would land.

One gap this step cannot close on its own. AWS publishes the exchange token
only in the ExchangeToken notification on the partner's SNS topic, and no
operation on the family answers it. Floci sends no notification yet, so the
token is minted onto the record and nothing hands it back over the wire. The
integration test reads it from the service for that one step and drives
everything either side of it over the wire.

Twenty-one tests: eight on the service covering the release, the owner-only
flag either way, the repeated exchange, both refusals and the window, with a
clock the test owns, eight over the wire across the two accounts, one on the
handler holding the session to the customer's account and to its approver, and
four under IAM enforcement on what the credentials may then do: an approver
allowed to read and not write, whose delegated credentials do exactly that, a
request forwarded to an administrator who approved it, whose credentials write
where its owner can only read, a role carrying the approver's name that lends
them nothing, and a request approved by the account root. Four probes, each
reverting one thing: mapping the credentials to the owner fails the forwarded
case and the handler test and nothing else, anchoring the expiry at the
redemption instant fails the two tests that describe it, filing the session
against the partner fails the one that holds it, and dropping the owner-only
guard fails the one that asks for it.
SendDelegationToken joins the delegation family in ResourceArnBuilder, AWS
giving it the delegation-request type, so it is authorized against the
request rather than the wildcard. Routing needs nothing added since #5879
reads each service's actions from its botocore model, which names both of
these, so the matrix rows in docs/services/index.md are the only counts this
moves: IAM 174 to 175 and STS 7 to 8.
2026-10-18 20:43:05 -05:00
Jackson Price 9099cec5e8 fix(cloudformation): check S3 ownership rules against the resource schema (#5834)
* fix(cloudformation): check S3 ownership rules against the resource schema

#5712 made AWS::S3::Bucket apply OwnershipControls, with the
provisioner answering a wrong type and a rule without ObjectOwnership,
and S3 answering two rules, no rule and an unknown mode with
MalformedXML. Two constraints of AWS's published resource schema were
still missing. A key the schema does not define was dropped unread: next
to a valid rule the stack reached CREATE_COMPLETE, and a misspelt
ObjectOwnership was reported as missing. A rule listed twice was
refused by S3 for the rule count, not by the schema for the repeat.

Both now fail the resource before the bucket is created or changed, in
the provisioner's "Model validation failed (#/OwnershipControls...)"
form: "extraneous key [<key>] is not permitted" on OwnershipControls and
on each rule, and "array items are not unique" on Rules, compared once
intrinsic functions are resolved. Every other case keeps #5712's
answer: two different rules, no rule and an unknown mode still get
MalformedXML, and a rule without ObjectOwnership still reports the
missing key. Its type checks get tests for the shapes it did not cover.

docs/services/cloudformation.md gains an S3 ownership controls section.

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

* fix(cloudformation): check each ownership rule before the repeat

The uniqueness check ran before each rule's own checks, so a repeated
rule that is malformed by itself, such as {"Rules": [{}, {}]} or two
string rules, was refused as "array items are not unique" rather than
for its own fault, which is the answer #5712 gives the same rule alone.
The repeat is now checked once every rule passes on its own, still
before S3's rule count.

Tests now pin the order and the key each level allows: an extra key
beside a Rules of the wrong type, ObjectOwnership on OwnershipControls,
Rules on a rule, and a repeat that is not adjacent. The update test
checks the error it gets.

The previous commit's "Every other case keeps #5712's answer" holds
from this commit on. Where the schema and S3 disagree, a missing Rules
key and a mode outside the enum still get S3's MalformedXML.

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

* docs(cloudformation): correct the S3 ownership controls section

Say which key each level allows, that S3 rather than the resource
schema requires ObjectOwnership, and that a repeated rule is checked
once every rule passes its own checks. Name the two cases, a missing
Rules and a mode outside the enum, where Floci keeps S3's answer and
the schema would refuse the template itself. Describe the reason a
stack reports rather than error codes it never shows, and flatten the
nested list, which Python-Markdown renders as siblings at a two-space
indent.

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

* test(cloudformation): pin the repeat check after every ownership rule

A repeat ahead of a malformed rule, as in [A, A, {}], must still fail
for the third rule's missing ObjectOwnership, as a single malformed
rule does. Without this row, checking each rule against the earlier
ones inside the rule loop passed every test.

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

* docs(cloudformation): say S3 ownership rules are checked in turn

The section said that what the resource schema refuses is reported
first. The provisioner checks each rule in turn, so a rule without
ObjectOwnership, which only S3 requires, is reported ahead of a schema
fault in a later rule. Give the order the checks run in, and say that
CloudFormation's reason can differ for such a rule, since the schema
accepts it.

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

---------

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
2026-10-18 21:32:06 -04:00
TATSUNO “Taz” Yasuhiro b6bc3032f1 fix(lambdaweb): report init failures as AWS does (#5960)
* fix(lambdaweb): tell why a Web Function app failed to start as AWS does

An app that exits at start with a status other than 0 now gets Runtime.ExitError, and an app that cannot find a module at import gets Runtime.ImportCodeError. A failed import writes the one ERROR event AWS writes in place of Node's stack.

* fix(lambdaweb): read the init error type from a file so any exit status keeps its meaning

* fix(lambdaweb): write the init error type where any user can

* fix(lambdaweb): clear an init error type left in the runtime image
2026-10-18 21:21:28 -04:00
Andre Kurait 9ceedde585 fix(lambda): drain warm containers across functions concurrently (#5899)
Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-18 21:14:29 -04:00
Jackson Price 94288dadd9 fix(cloudformation): move a kept load balancer onto the template's subnets (#5881)
* fix(cloudformation): move a kept load balancer onto the template's subnets

An update that changed an ELBv2 load balancer's Subnets (or SubnetMappings)
kept the balancer on its old subnets, so it went on listing subnets the
template had dropped or replaced, which the update cleanup then deleted.
The provisioner now moves a kept balancer onto the template's subnets, as
SetSubnets does, and keeps the prior list in a hidden attribute so a
rolled-back update moves it back. A failed move back is reported as the
rollback failure and keeps the prior list for another try. SubnetMappings
gives the subnets when Subnets is absent.

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

* fix(cloudformation): refuse a load balancer subnet mapping without a subnet

SubnetId is required in an ELBv2 SubnetMapping, but the provisioner
skipped a mapping without one, or with a blank one, so a template whose
mappings named no subnet created or kept a load balancer with no subnets.
A mapping without SubnetId now fails the resource with the schema error
before anything is created or moved, and a blank SubnetId is passed on
for ELBv2 to refuse as an unknown subnet.

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

* fix(cloudformation): leave out a subnet mapping an Fn::If drops

SubnetMappings was resolved with AWS::NoValue kept as an empty value, so
a mapping an Fn::If dropped read as a mapping without SubnetId and the
new required-key check failed the stack, and a SubnetId an Fn::If dropped
failed as an unknown blank subnet. SubnetMappings is now resolved with
those values left out, as CloudFormation does: a dropped mapping is
skipped and a dropped SubnetId is reported as the missing required key.

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

* test(cloudformation): read stack event reasons decoded

The subnet mapping test matched the raw DescribeStackEvents body, where
ResourceStatusReason is XML-escaped, so the blank SubnetId reason with
its quotes never matched. It now reads the reasons with XmlParser.

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

* fix(cloudformation): refuse a load balancer with subnets and subnet mappings

With both Subnets and SubnetMappings set the provisioner quietly took
Subnets, where the resource allows one or the other and CreateLoadBalancer
refuses both. Both together now fail the resource with the same
ValidationError before anything is created or moved, and the mappings are
checked for a SubnetId even when Subnets is set.

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

* test(cloudformation): pin an empty subnet mapping list beside subnets

An empty SubnetMappings beside Subnets, as an Fn::If that drops every
mapping leaves, is allowed; a test now holds that. The templateSubnets
Javadoc says how a blank SubnetId counts, and the integration test class
says it also covers both properties together.

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

---------

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
2026-10-18 21:07:26 -04:00
Jackson Price d273d4f4e0 fix(cloudformation): delete dependents first on update rollback (#5943)
The update rollback deleted what a failed update added in map order, so a
resource could go before the resources that depend on it. It now walks
the template's dependency order in reverse, as stack delete and the
cleanup of committed replacements do. Those walks ignore resource
conditions and count every Fn::If branch, since a failed rollback
restores the parameters while a resource can stay on the branch the
failed update chose; where counting every branch would close a cycle,
the branches chosen now decide just those edges. A resource the template
no longer names is deleted before the held resources its attributes
name, leftovers included, and a NAT gateway records its subnet and
Elastic IP under hidden attributes for this, restored with the public
ones when a replacement is reverted.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
2026-10-18 21:06:53 -04:00
TATSUNO “Taz” Yasuhiro 3b7782e583 fix(dynamodb): measure item size and UpdateItem statements like DynamoDB (#5934)
* fix(dynamodb): measure item size and UpdateItem statements like DynamoDB

DynamoDB sizes a list or map at 3 bytes plus 1 per element, and a string
or binary set by its members alone.

An UpdateExpression is also measured as a statement. Each SET or ADD costs
19 bytes and each REMOVE or DELETE 1, on top of 3 for the update. Target
paths count once per shared prefix, 4 bytes per parent plus each key or
index digit. A SET also pays for every operand it reads: a value by its
size, a path at 1 plus 14 per element, list_append 37, if_not_exists 39,
plus 34 and minus 37. An ADD pays for its value. AttributeUpdates is
measured by the finished item only.

Closes #4339

* fix(dynamodb): refuse an unclosed call in an UpdateExpression

An UpdateExpression that ends inside a function call or a group, such as
"SET a = list_append(l, :v", reached the statement size check and failed
with a 500. DynamoDB refuses it before the table lookup with a syntax error
at <EOF>, near the raw text from the last token on. UpdateItem wraps the
message in the validation envelope and TransactWriteItems does not.
2026-10-18 20:56:48 -04:00
Matheus Oliveira 5306e0e470 fix(cloudfront): honor origin connection timeouts and attempts, answer 504 (#5802)
* fix(cloudfront): honor origin connection timeouts and attempts, answer 504

CloudFront ignored a custom origin's ConnectionTimeout, OriginReadTimeout and
ConnectionAttempts and answered 502 for any origin failure. Apply the origin's
connect and read timeouts to the origin request, retry a timed-out GET/HEAD up
to ConnectionAttempts, and answer 504 with the AWS message when the last
attempt times out. A refused connection or an unknown host still answers 502.

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

* fix(cloudfront): retry a connect timeout for every origin method

Review follow-ups on the origin timeout work:

- Connection attempts count for every method, not only GET and HEAD: a
  connect timeout or a refused connection is retried up to the configured
  ConnectionAttempts whatever the method is. Apache HttpClient 5's
  ConnectTimeoutException extends SocketTimeoutException, so it is caught
  first to keep the split: a response timeout is still retried only for an
  idempotent method and still answers 504, while a refused connection
  propagates unchanged as a bad gateway.
- The origin read and connection timeout bounds moved into
  CloudFrontOriginTimeouts, shared by CloudFrontController,
  CloudFrontServingController and CloudFrontOriginHttpClient instead of
  being repeated in each.
- The slow-origin tests hold the origin open on a CountDownLatch with
  millisecond client timeouts rather than sleeping out a fixed delay, so an
  attempt ends by the client's own timeout and the suite finishes in
  seconds.

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

---------

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-10-18 20:56:42 -04:00
Aniket Shukla 916e72570e fix(logs): resolve trailing-colon query ARNs (#5954)
* fix(logs): resolve trailing-colon query ARNs

* fix(logs): constrain trailing-colon ARN normalization
2026-10-18 20:46:27 -04:00
David Phillips 678c5b82a6 fix(rds): require database role grants for PostgreSQL IAM login (#5945)
* fix(rds): require database role grants for PostgreSQL IAM login

* fix(rds): preserve standard proxy IAM authentication

* fix(rds): report PAM refusal for IAM member passwords
2026-10-18 20:44:10 -04:00
Niels Kootstra e9154fb928 fix(logs): require the policy type's own permission for PutAccountPolicy (#5956) 2026-10-18 20:37:16 -04:00
Matheus Oliveira a57c20943a feat(cloudformation): provision AWS::WAFv2::IPSet (#5950)
* feat(cloudformation): provision AWS::WAFv2::IPSet

Serve AWS::WAFv2::IPSet from WafV2CfnProvisioner instead of the
dispatcher stub, so stacks with IP sets no longer fail in strict mode
and Web ACL rules can resolve a real IP set ARN.

Name and Scope are create-only: a change replaces the set with a new
name|id|scope physical id (Ref) and deletes the prior one the same way
a Web ACL replacement does, tolerating a cleanup failure so the new set
is still tracked. Addresses, Description and Tags update in place
through UpdateIPSet; IPAddressVersion is never passed to the update,
matching the real API, so a template that flips it fails address
validation and reports UPDATE_FAILED. Fn::GetAtt resolves Arn and Id
from the backing set, and DeleteStack removes it, tolerating a set
already gone.

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

* fix(cloudformation): defer IPSet replacement cleanup and honor its optional name

Review follow-ups on the AWS::WAFv2::IPSet provisioner:

- A renamed or re-scoped set now records the displaced one with
  ReplacementCleanup, so a failing delete of the prior set is reported
  by completeUpdate instead of being tolerated, and rollbackUpdate
  restores the prior set and deletes the replacement, the same contract
  the S3 bucket replacement follows.
- IPAddressVersion is validated against IPV4/IPV6 on every provision.
  An in-place update never sends it to UpdateIPSet, so an unknown value
  would otherwise be accepted without ever reaching WAFv2.
- Name is optional in the CloudFormation schema, matching what the Web
  ACL arm in the same provisioner already does: an omitted Name
  generates one on a create and reuses the existing set's name on an
  update.

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

* fix(cloudformation): mark AWS::WAFv2::IPSet Name and Scope create-only

Name and Scope are create-only in the registry schema, so without an entry
in create-only-properties.json a Scope change fell to the name-based
default and showed Replacement: False in the change set. A resource that
reads the set's Ref or Arn was then skipped by the update and kept the ARN
of the set that replacement cleanup deletes.

Also share the IPV4/IPV6 rule between the provisioner and
WafV2Service.validateAddresses, which repeated it, so an unknown
IPAddressVersion is rejected in one place.

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

---------

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-10-18 20:32:42 -04:00
andrehoong-px 06bd8c2207 fix(s3vectors): preserve resource configuration and serialize writes (#5892)
* fix(s3vectors): preserve resource configuration and serialize writes

* fix(s3vectors): match index configuration response contracts

* fix(s3vectors): stabilize legacy metadata and query validation

* fix(s3vectors): use an injectable clock for resource timestamps
2026-10-18 15:15:06 -04:00
David 7dc514b52f feat(emr): ListReleaseLabels, DescribeReleaseLabel and ListSupportedInstanceTypes (#5748)
* feat(emr): ListReleaseLabels, DescribeReleaseLabel and ListSupportedInstanceTypes

None was served, so Terraform's aws_emr_release_labels and
aws_emr_supported_instance_types data sources failed against Floci.

A curated catalogue of EMR releases (emr-7.5.0, Floci's default, and
emr-7.4.0, emr-6.15.0, emr-6.14.0 and emr-5.36.2) carries each
release's applications and versions from the EMR Release Guide and its
recent Amazon Linux releases, with common instance types and their EC2
sizes. The three actions filter and page it as the API documents, and
answer InvalidRequestException for an unknown release, a bad token or
an out-of-range MaxResults. A configured default release outside the
catalogue is still listed.

Closes #5734

* fix(emr): report EMR architecture values and match application versions without regard to case

ListSupportedInstanceTypes returned the EC2 spellings x86_64 and arm64; the EMR model gives X86_64 and AARCH64 for Architecture. The ListReleaseLabels application filter matched the name without regard to case but not the version, so phoenix@4.14.3-hbase-1.4 missed emr-5.36.2.

* refactor(emr): page the release catalogue with the shared Pagination

ListReleaseLabels and ListSupportedInstanceTypes now page through
core.common.Pagination, with the filters in the token namespace so a token
replayed with other filters, or altered, is refused. DescribeReleaseLabel
answers every application, as AWS reserves its MaxResults and NextToken.
The EMR integration tests share one request helper.
2026-10-18 15:11:42 -04:00
Joel Klint e3e06a1122 feat(iot): add RegisterCertificateWithoutCA and the V2 principal lists (#5772)
* feat(iot): add RegisterCertificateWithoutCA and the V2 principal lists

RegisterCertificateWithoutCA registers a certificate from any issuer in
SNI_ONLY mode. ListThingPrincipalsV2 and ListPrincipalThingsV2 page the
thing principal attachments and report each one as NON_EXCLUSIVE_THING,
because Floci does not model exclusive attachment.

* fix(iot): validate the principal and page size of the V2 principal lists

ListPrincipalThingsV2 requires a principal, and both V2 lists accept 1 to
250 results per page, as on AWS. Tests cover these checks and the
RegisterCertificateWithoutCA rejection of a missing PEM and an unknown
status.

* fix(iot): refuse a device certificate registered in more than one account

AWS selects the account from the server name, which Floci does not do
yet. The MQTT TLS listener therefore refuses a certificate that more
than one account registers, instead of admitting it under the lowest
account ID. RegisterCertificateWithoutCA drops the cached location, and
the lookup runs under compute, so a connect cannot cache a stale account.

* fix(iot): make the RegisterCertificateWithoutCA duplicate check atomic

A lock holds the duplicate check and the store write together, as
CreateAuthorizer does, so two identical registrations at the same moment
store one certificate and the other caller gets the 409. The 409 carries
resourceId and resourceArn, as AWS lists for this call.
2026-10-18 14:50:15 -04:00
david lee 4204ee2ea5 fix(bedrock-runtime): return errors when upstream error bodies stall (#5527)
* fix(bedrock-runtime): cancel abandoned calls and bound stalled error bodies

Close the upstream request when the caller disconnects, including a
stream stalled between tokens, and read streaming error bodies under a
one-second deadline so a backend that stalls mid-error still returns
ModelErrorException. Warnings keep the upstream status but omit the
response body.

* fix(bedrock-runtime): bound stalled error bodies on non-streaming converse

Non-streaming Converse read the upstream body with ofString, so an error
status followed by a stalled body hung until the caller gave up: the
request timeout stops at the headers. Both Converse paths now share one
send step that reads error bodies under the collection deadline.

The deadline is configurable (error-body-timeout-millis, default 1000) so
the tests run against a short one, and the raw-socket upstream fixture is
shared between the cancellation and logging tests.

* fix(bedrock-runtime): declare the error-body timeout in application.yml

* fix(bedrock-runtime): schedule the error-body cut instead of polling for it

The cancellation poll checked the deadline every 100 ms, so a stalled
error body was cut 100 to 200 ms after it started. A timer armed when
the error status arrives cuts it exactly, and the poll goes back to
watching only for a caller disconnect. The test deadline drops to 10 ms.

* fix(bedrock-runtime): validate the error-body timeout and tighten its tests

Refuse a non-positive error-body-timeout-millis at startup, list the
setting in the configuration table, and restore the non-streaming
"Proxy request interrupted." wording.

The complete-error-body tests now send headers and body in one write
through StallingUpstream, so the 10 ms test deadline cannot race them,
and the 8 KiB test asserts that the read ended at the cap rather than
at the deadline. A shared ConverseRequests helper replaces the three
hand-built Converse requests.
2026-10-18 14:50:09 -04:00
Alessandro Lattao 1f4a46804c fix(cloudformation): refuse a list property that a parameter or an intrinsic makes a string (#5949)
* fix(cloudformation): refuse a list property that a parameter or an intrinsic makes a string

The follow-up asked on #5923. The engine kept parameter values but not
their types, so the Lambda provisioner's list readers could not tell a
Ref to a CommaDelimitedList parameter, which the engine resolves to the
comma-joined text, from a Ref to a String parameter: both read as lists,
where CloudFormation refuses the second.

Measured on CloudFormation (eu-west-1, 2026-10-18), Layers and
Architectures of AWS::Lambda::Function:
- a Ref to a CommaDelimitedList, AWS::SSM::Parameter::Value<List<String>>
  or AWS::SSM::Parameter::Value<CommaDelimitedList> parameter, Fn::Split,
  an Fn::If choosing a Ref to a list, and Ref AWS::NotificationARNs are
  lists;
- a Ref to a String or Number parameter, Ref AWS::Region, Fn::Select,
  Fn::Join, Fn::Sub and an Fn::If choosing a literal string fail the
  template's validation with "Property [Architectures] expected type:
  JSONArray, found: String";
- a resource's Ref and Fn::GetAtt fail only when the resource is
  provisioned, with "Properties validation failed for resource Fn with
  message: #/Architectures: expected type: JSONArray, found: String".

CloudFormationTemplateEngine now takes the declared parameter types, which
executeTemplate reads from the template (stacks, change sets, stack sets
and nested stacks all deploy through it), and yieldsString tells the
forms of the second group. The list readers refuse such an intrinsic
with the validation message, as they refuse a literal of the wrong type.
The third group is left as it was: the engine cannot tell a list-valued
attribute from a string one before provisioning, and a resource's own
message format is not modelled.

parameterType gives a declaration's Type, String when it is left out, for
the new reader and for GetTemplateSummary, which had its own copy.

Tests: CloudFormationTemplateEngineTest for yieldsString over every
measured form; CloudFormationLambdaObjectPropertyIntegrationTest for each
refused form, an Fn::If choosing a list, and a nested stack whose own
parameter types decide; CloudFormationLambdaObjectPropertyTest in
sdk-test-java for a String parameter through the SDK. The integration and
SDK tests fail on main.

* fix(cloudformation): take Fn::Base64 as a string where a list is expected

Review of #5949 (Qodo). Measured on CloudFormation (eu-west-1,
2026-10-18): Architectures: {"Fn::Base64": "x86_64"} fails validation with
"Property [Architectures] expected type: JSONArray, found: String", like
Fn::Sub. yieldsString left it out, so the Lambda reader split the encoded
text into a list and the function got an invalid architecture instead.

Tests: CloudFormationTemplateEngineTest and
CloudFormationLambdaObjectPropertyIntegrationTest gain the case; both fail
on the previous head.
2026-10-18 14:32:04 -04:00
David Phillips 7ce4b6bd23 feat(autoscaling): describe suspended process reasons (#5941)
* feat(autoscaling): describe suspended process reasons

* fix(autoscaling): record suspended process dates
2026-10-18 14:24:58 -04:00
Hector Ventura 317074e303 fix: keep MSK configurations and RDS events in the request region (#5940)
* fix(msk): keep configurations in the region that created them

MSK clusters became regional in #3353, but configurations did not:
ListConfigurations returned every region's, DescribeConfiguration and the
tag operations answered for another region's ARN, and a configuration name
used in one region could not be reused in another. Each now considers only
configurations whose ARN names the request region. The ARN has always
carried that region, so no record needs migrating.

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

* fix(rds): list only the request region's events in DescribeEvents

DescribeEvents took no region and scanned the whole event store, so each
region saw the events of instances and clusters in the others. The handler
now passes the request region, and an event is listed in the region its
source ARN names; an event recorded without a source ARN stays visible, as
before.

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

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-18 14:12:51 -04:00
Alessandro Lattao dd832b45dc fix(apigatewayv2): apply an HTTP API's CORS configuration to its actual responses (#5935)
* fix(apigatewayv2): apply an HTTP API's CORS configuration to its actual responses

An HTTP API with a CorsConfiguration answered the preflight from it, but the
responses of its integrations went out with no Access-Control-Allow-Origin, so
a browser refused to hand the page any answer of the API. AWS documents both
halves ("Configuring CORS for an HTTP API"): for a CORS request API Gateway
adds the configured headers to the integration's response, and once an API
has a CORS configuration it ignores the CORS headers the integration returns.

Measured on HTTP APIs (eu-west-1, 2026-10-16 and 2026-10-18):
- API Gateway's own refusals on a matched route get the same headers: a JWT
  authorizer's 401 and its 403 for a missing scope, an unsigned call to an
  AWS_IAM route's 403, a Lambda authorizer's 401 (no identity) and 403
  (isAuthorized false); so does a function that is gone, which answers 500
  Internal Server Error (Floci answered 404 "Function not found" without
  them).
- A preflight a route matches (an OPTIONS or ANY route, $default) goes
  through that route, its authorizer and its integration, and gets the
  preflight headers on whatever answers; only a preflight no route matches
  is answered 204 by API Gateway. Floci answered every preflight itself, so
  a route behind an authorizer looked open to a browser's preflight.
- A preflight gets the preflight headers only when its origin, its method
  and every header it asks for are allowed, and never the exposed headers;
  otherwise, or for an OPTIONS without Access-Control-Request-Method, no CORS
  header at all. An actual request gets them whatever its method. Lists are
  joined with a bare comma.
- A preflight that gets the headers always carries
  Access-Control-Allow-Headers, empty when none are configured, and
  Vary: origin unless AllowOrigins is a single exact origin or "*" (two
  origins, the "https://*" prefix, and "*" beside an exact origin all
  vary). No other response gets a Vary; an integration's own is kept.
  Floci sent no Allow-Headers when none were configured, and Vary: Origin
  on every preflight that echoed the origin.
- A route without a target answers 404 Not Found with no CORS header, as an
  unmatched route does (Floci answered 500).

The configuration is now applied once, by withHttpApiCors, on whatever the
matched route answers, so no response path can miss it: it drops the six
headers the configuration owns from the response and, when the Origin is
allowed (exactly, by "*", or by a prefix wildcard such as https://*), adds
Access-Control-Allow-Origin, plus Credentials and Expose-Headers when
configured, or the preflight's set for a preflight. An API without a
configuration still leaves CORS to its integrations.

Tests: ApiGatewayExecuteControllerTest for the headers withHttpApiCors
sets and when a preflight varies, HttpApiCorsIntegrationTest for the
routing, the refusals and the custom domain;
HttpApiJwtAuthorizerScopesTest and HttpApiRequestAuthorizerTest for the
measured refusals of a JWT scope and of a Lambda authorizer, on their own
fixtures; ApiGatewayV2CorsTest in sdk-test-java for the refusals, an
unmatched preflight and a two-origin API's Vary through the SDK;
ApiGatewayV2UnsignedAccountRoutingTest now tells a route found in its
account by AWS's 500 instead of Floci's "Function not found".

* fix(apigatewayv2): answer a failed invocation with API Gateway's own status and CORS headers

Review of #5935 (Qodo). Measured on an HTTP API with a CORS configuration
(eu-west-1, 2026-10-18), with an allowed Origin:
- a Lambda integration API Gateway may not invoke, and a function that
  raises, answer 500 {"message":"Internal Server Error"}; a function Lambda
  throttles (reserved concurrency 0) answers 503 {"message":"Service
  Unavailable"}; each carries Access-Control-Allow-Origin and
  Access-Control-Expose-Headers;
- an OPTIONS request no route matches is answered 204 with no CORS header
  whether or not it carries Origin or Access-Control-Request-Method, so the
  unmatched OPTIONS answer stays as it is, now pinned by a test.

Any AwsException from the invocation now becomes API Gateway's answer
inside the matched route, so the CORS configuration reaches it: 503 for
Lambda's throttling, 500 otherwise. Only the function that is gone did
before; the others escaped to the exception mapper without the headers.

A configured list with a null entry no longer fails a preflight: the
entry matches nothing and is left out of the header.

Tests: HttpApiCorsIntegrationTest gains a throttled function's 503 and an
unmatched OPTIONS that is not a preflight, ApiGatewayExecuteControllerTest
a null entry, and ApiGatewayV2CorsTest in sdk-test-java both new cases
through the SDK; the throttled and null cases fail on the previous head.

* test(apigatewayv2): share the HTTP_PROXY API fixture and the Lambda zip helper

Review of #5935. HttpApiCorsIntegrationTest.createProxyApi repeated the
API, stage, HTTP_PROXY integration and route sequence of
HttpApiHttpProxyMultiValueIntegrationTest.createProxyApi: both now call
HttpProxyApiFixtures.createProxyApi, which takes the API's extra fields,
the stage, the backend port and the path. The stage is auto-deployed for
both, as an API needs to be served on AWS.

The throttled function is a Node.js one built with
WebSocketTestSupport.createLambdaZip; it never runs, so its runtime does
not matter.
2026-10-18 12:05:07 -04:00
Hector Ventura fc1488d17a fix(core): read an ARN's resource after its fifth colon, not its last (#5939)
* fix(core): read an ARN's resource after its fifth colon, not its last

Four places cut an ARN by hand and got the wrong resource for a legal name:

- A VPC flow log's S3 destination took everything after the last ':' as
  the bucket, so a prefix with a colon (arn:aws:s3:::bkt/logs:2024/) named
  bucket 2024. It now takes the S3 resource through AwsArnUtils.
- Glue's TagResource and UntagResource split the ARN on every ':', so a
  job, table or other name containing one was looked up by the text before
  it and answered EntityNotFoundException. The split stops at six parts.
- KMS resolved an alias ARN at its last ':', so alias/team:payments
  resolved as payments. The alias name is now the ARN's resource.
- A Kinesis event source mapping read the stream name after the last '/',
  so a stream-consumer ARN gave the consumer segment. It now reads the
  segment after stream/, as KinesisJsonHandler does.

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

* fix(core): parse only KMS alias ARNs and drop only a consumer suffix

Review follow-ups:

- KMS read the alias name from any ARN containing ":alias/", so another
  service's ARN naming the same alias resolved a local KMS alias. Only a
  KMS ARN is now read that way; anything else keeps the old reading and
  finds no alias.
- The Kinesis poller dropped everything after the stream segment, so a
  malformed suffix (stream/orders/not-a-consumer) still named stream
  orders. It now drops only a /consumer/ suffix, so a malformed ARN names
  no stream.

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

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-18 11:56:32 -04:00
Aniket Shukla d951fd532c fix(docker): retry core and EKS archive uploads (#5916)
* fix(docker): retry core and EKS archive uploads

* fix(docker): fail fast on local host archive errors

* test(docker): skip backoff in archive retry regressions

Allow package-private caller entry points to select the archive backoff while production retains the shared defaults. Remove the unused user-data tar builder requested in review.

* test(resourceexplorer2): isolate empty-query count assertions

The shared integration fixture can contain exactly 1000 resources, where a capped total does not imply incomplete results. Search a tracked single-resource view and cover 999, 1000 and 1001 matches with deterministic service tests.
2026-10-18 11:53:50 -04:00
mrjusepelo f5811c3a07 fix(cloudwatch): publish SNS actions on alarm state transitions (#5918) 2026-10-18 11:15:34 -04:00
Aniket Shukla 3a44e19e36 fix(elasticache): preserve member security group metadata (#5937)
Keep CreateReplicationGroup SecurityGroupIds in persistent group metadata and report active memberships on every DescribeCacheClusters member. Cover both topologies and Query list spellings with SDK regressions, plus legacy JSON defaults.
2026-10-18 11:13:30 -04:00
TATSUNO “Taz” Yasuhiro 301ac79c6e feat(lambdaweb): write the platform events of Web Function environments (#5936)
* feat(lambdaweb): write the platform events of Web Function environments

Each environment now writes the platform.* events AWS writes, filtered by the revision's systemLogLevel. CPU time and memory come from the container's cgroup. The output of an environment that fails before it listens reaches its stream too. Node runs under Docker's init, so a server without a SIGTERM handler stops at once, as on AWS where it is not PID 1. The server has 9 seconds to listen, as the AWS TimeoutListenError message says.

* fix(lambdaweb): settle the platform events of an environment that ends early

The last reports wait for the requests the exit failed, so they are counted. A periodic summary comes no more after the last report. An exit right after the app listens is handled as an exit. The CPU time counts on a host without memory.peak. The listen failure event is dropped at applicationLogLevel FATAL, as on AWS.
2026-10-18 11:09:24 -04:00
David Phillips 356c79e78e fix(ssm): parse and bound command delivery timeouts (#5908)
* fix(ssm): limit public command delivery time

* docs(ssm): describe command delivery timeouts

* fix(ssm): deserialize delivery timeouts before checking bounds

Handle numeric delivery timeouts consistently without bypassing limits.

* fix(ssm): report member-specific deserialization errors

Name the expected scalar type and explain malformed structures.

* refactor(ssm): keep delivery timeout errors consistent
2026-10-18 11:03:48 -04:00
David Phillips 1a80884f40 feat(servicequotas): configure applied EC2 vCPU quota (#5926)
* feat(servicequotas): configure applied EC2 vCPU quota

Report configured EC2 vCPU quotas separately from AWS defaults.

* fix(servicequotas): reject negative applied quota settings

Reject invalid quota settings before serving local requests.

* docs(servicequotas): clarify negative quota settings

* fix(servicequotas): reject invalid settings at startup
2026-10-18 11:03:06 -04:00
Matheus Oliveira 8298779ead fix(cloudformation): replace AWS::S3::Bucket when BucketName changes (#5762)
A change to BucketName is a replacement: CloudFormation creates the new
bucket first and then deletes the old one, unless UpdateReplacePolicy is
Retain. S3CfnProvisioner created the replacement but never removed the
displaced bucket, so a successful rename left both buckets, and a rename
that a later resource failed ended in UPDATE_ROLLBACK_FAILED, with
DescribeStackResources still naming the new bucket.

Record the displaced bucket with ReplacementCleanup and delegate the
replacement lifecycle to it, so the committed update deletes the old
bucket, honouring UpdateReplacePolicy: Retain, and a rollback points the
resource back at the original bucket and deletes the replacement. Route
the bucket delete through CfnDeletes.safeDelete so a bucket already gone
is tolerated while a real failure such as BucketNotEmpty still propagates
and reaches the stack as DELETE_FAILED.

Fixes #5678

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-10-18 10:52:00 -04:00
Priamo Germosen 5dcddc9dfa feat(codeartifact): bridge CopyPackageVersions to every sidecar format (#5888)
CopyPackageVersions only covered the generic format; maven, npm, pypi, and
nuget each publish straight to their own sidecar and keep no
packageVersions record this action could read from or write to. Bridges
all four, each confirmed live against a real container: maven reuses
Reposilite's existing mvn-deploy write path, while npm/pypi/nuget each
speak their own real wire protocol directly (Verdaccio's packument PUT,
pypiserver's twine-shaped multipart upload, and BaGetter's NuGet push),
the same protocol each format's own data-plane proxy already forwards
unmodified for a native client. CopyPackageVersions now supports every
format CodeArtifact does, matching real AWS, which places no format
restriction on this action at all.

An overwrite deletes a conflicting existing asset immediately before
rewriting it for every format, since each sidecar rejects a plain
overwrite of differing content; a best-effort compensating cleanup
restores or removes whatever one version's write itself touched if a
later step in that same version fails, preserving the original error. A
copied Maven version is also merged into the destination's
maven-metadata.xml so real clients can discover it, and copied bytes feed
the same byte-accounting mechanism native publishes already use. A copied
npm or pypi version's readme is propagated from this service's own
captured-at-publish-time record, since neither sidecar can answer for one
after the fact. The synthesized revision for every container-backed
format is truncated to fit versionRevisions' own 50-character limit, so a
revision obtained from DescribePackageVersion can be handed straight back
into a revision-pinned copy.

Also closes a cross-version batch-write gap: source assets are verified
against the real sidecar before any destination write in the same batch,
the same split the generic path already uses.

Fixes two more real-sidecar quirks found on review: pypiserver's own
delete call removes every file sharing a release's exact name and
version, not just the one asset name it was asked to delete, so a release
carrying both an sdist and a wheel lost one of them on overwrite when
assets were deleted one at a time, interleaved with the writes. Every
destination asset a version already holds is now deleted up front, in its
own phase, before any new content is written, which changes nothing for
Maven/npm/nuget since their own deletes are already scoped to exactly the
asset (or, for npm/nuget, the single asset a version ever holds) being
removed. An npm copy also used to rebuild a minimal version document from
scratch, dropping dependencies and anything else npm's own protocol
carries beyond dist; it now reuses the source's own version entry
verbatim, with only dist itself rewritten to point at the copy.
2026-10-18 09:28:42 -05:00
Priamo Germosen c17bd49096 fix(s3): check bucket policies for the actions IAM checks (#5913)
S3's own access check under floci.services.s3.enforce-auth, which
evaluates bucket policies and ACLs, lagged behind IAM enforcement. It
checked a version's tagging, ACL and annotation requests as the base
actions, an object created with tags, an ACL or Object Lock settings as
s3:PutObject alone, GetObjectAttributes without the read, and a write
carrying If-Match without the read IAM checks for it. It offered a
bucket policy none of the request's condition keys, and asked for
s3:BypassGovernanceRetention on an annotation delete, which the user
guide says the permission "does not apply to".

The bucket-policy check now checks the actions IAM does: the version
counterpart when a request names a versionId, the tagging, ACL,
retention and legal-hold actions an object creation's settings need, a
copy of a tagged source included, s3:GetObject beside
s3:GetObjectAttributes and beside an If-Match write, and no bypass
permission on an annotation delete. A signed request's bucket policy is
offered the tag and Object Lock keys the request sets: an object
creation's headers and the tagging, retention and legal-hold bodies,
read by the same S3ObjectActions helpers IAM's condition resolver now
uses.

s3:BypassGovernanceRetention is asked for only by a request that
overrides a governance lock, by IAM and by the bucket policy. The user
guide's permissions table requires it "if you want to delete an object
that's protected by governance mode" and to "bypass the governance mode
of an Object Lock retention configuration", and DeleteObjects already
asked for it only then. DeleteObject and PutObjectRetention asked for
it whenever the header was sent; they now ask only for a delete that
removes a version under a governance lock, not one that only adds a
delete marker, and for a retention change that shortens or removes one.

The IAM condition resolver now reads the object key from the path as
it arrived, as S3Controller does, through the new S3ObjectKeys: the
normalized path drops a key's leading slash, so the lock and the
s3:ExistingObjectTag tags of "/doc" were looked up on "doc". A CopyObject
replacing its source's tags reads x-amz-tagging from the query as well,
as PutObject does, so it applies the tags both checks saw. An anonymous
creation that a public bucket ACL's WRITE grant admits may still apply
its ACL, tags and Object Lock settings, unless a public bucket policy
decides their actions, since an ACL grant names no actions.

The creation checks are told whether a request is a CopyObject rather
than guessing it from x-amz-copy-source, which a CreateMultipartUpload
ignores while it applies its own tags, so those tags are always
checked, by IAM and by the bucket policy. With an access check on, a
DeleteObject, a DeleteObjects entry and a PutObjectRetention hand
S3Service the bypass only when they override a lock whose bypass
permission the checks approved, IAM's decision travelling in
RequestContext, so a lock set after the checks is refused rather than
bypassed unchecked.

Refs #5716
2026-10-18 09:28:33 -05:00
Alessandro Lattao a90482f030 fix(apigatewayv2): trust Floci's own CA when fetching a JWT issuer's keys (#5933)
With TLS on, an issuer Floci serves itself, a Floci Cognito user pool for
one, presents a certificate of Floci's local CA. The JWT verifier fetched
its discovery document and JWKS with the JVM's default trust store, which
does not hold that CA, so every token of a Floci pool was refused with 401
by an HTTP API JWT authorizer (and by an AppSync OIDC provider), where the
same authorizer on a Cognito pool verifies on AWS.
FLOCI_SECURITY_ALLOW_PRIVATE_JWT_TARGETS only lets the fetch reach the
private address; the handshake still failed.

The verifier now trusts the CA bundle Floci already writes for the
containers it launches: the JVM's roots followed by Floci's own trust
anchor (the local CA, or the user's certificate file). ContainerCaBundle
gains sslContext(), an SSL context over that bundle, empty when TLS is off
or the bundle cannot be read, in which case the JVM's roots alone are
trusted as before. A readable bundle with no certificate in it is refused
the same way, since a trust store over it would trust nothing, public
issuers included. The warning for a missing bundle now also says that JWT
authorizers will refuse an issuer Floci serves.

The TLS server context of a certificate this CA issues moves from the RDS
proxy into FlociCertificateAuthority.serverSslContext, so the proxy and
the test that serves an issuer over HTTPS build it one way.

Tests: JwtSignatureVerifierTest serves an issuer over HTTPS with a
certificate Floci's CA issues, the bundle written by ContainerCaBundle and
the verifier built through its injected constructor, as in production:
refused by the JVM's roots, verified with the bundle (it fails on main).
ContainerCaBundleTest pins that the bundle's context still trusts every
JVM root and the anchor, and that an empty bundle falls back.
OidcAuthValidatorTest's mocked config now answers tls().
2026-10-18 09:46:40 -04:00
Kenshin Okinaka 83bc2bd2bf refactor(ses): keep single-caller SesV2Json member helpers private (#5932)
parseSuppressedReasons moves into SesConfigurationSetController, its
only caller. structureMemberOrAbsent and typedStringMemberOrAbsent are
now used only by stringMapMemberOrAbsent, so they become private and
their unit tests go through that method instead. The dropped unit test
was the only check that an explicit null SuppressedReasons clears the
override, so that case moves to an integration test. No behaviour
change.
2026-10-18 09:41:37 -04:00
Alessandro Lattao 8db159761c fix(cloudformation): refuse every Lambda property of the wrong type (#5923)
* fix(cloudformation): refuse every Lambda property of the wrong type

The follow-up asked on #5912. Environment, ImageConfig, Layers,
Architectures and FileSystemConfigs, and a layer's CompatibleRuntimes
and CompatibleArchitectures, went through readers that took a value of
the wrong JSON type as absent, so a malformed property reset the
function's setting instead of failing; FileSystemConfigs alone refused
one, with a message of Floci's own, and also refused an AWS::NoValue
chosen by Fn::If, which AWS accepts.

Measured on CloudFormation (eu-west-1, 2026-10-18): each fails the stack
before the resource is touched, "Property [Layers] expected type:
JSONArray, found: JSONObject", "Property [Environment] expected type:
JSONObject, found: JSONArray", "Property [Variables] expected type:
JSONObject, found: String" for Environment's Variables, a number or a
boolean reading as a String; and Ref AWS::NoValue, directly or through
Fn::If, leaves any of them out.

Every reader of the provisioner now resolves through one resolveTyped,
which omits AWS::NoValue and refuses another type with that message.

Tests: every measured case on create, AWS::NoValue on the list
properties and through Fn::If, and through the SDK a Layers object; the
FileSystemConfigs test reads the measured message. They fail on main.

* fix(cloudformation): read a list property from a CommaDelimitedList Ref as a list

Review of #5923. Layers: !Ref LayerArns, with LayerArns a
CommaDelimitedList, was refused with "Property [Layers] expected type:
JSONArray, found: String", because the engine resolves that Ref to the
comma-joined text; AWS reads it as a list.

Measured on CloudFormation (eu-west-1, 2026-10-18), Layers and
Architectures of AWS::Lambda::Function:
- a Ref to a CommaDelimitedList parameter, and Fn::Split over a String
  parameter, create the stack with the list;
- a Ref to a String parameter, and Fn::If choosing a literal string, fail
  validation with "expected type: JSONArray, found: String".

The string-list readers (Layers, Architectures, and a layer's
CompatibleRuntimes and CompatibleArchitectures) now go through one
resolveStringList: a literal of another type is still refused, and an
intrinsic is read through engine.resolveStringList, which splits the
comma-joined text and expands Fn::Split, Fn::GetAZs and Fn::If. The
engine keeps parameter values, not their types, so a Ref to a String
parameter reads as a list too, where AWS refuses it.

Tests: CloudFormationLambdaObjectPropertyIntegrationTest creates a
function with Layers and Architectures from CommaDelimitedList Refs and
with Layers from Fn::Split; CloudFormationLambdaObjectPropertyTest in
sdk-test-java does the CommaDelimitedList case through the SDK. Both
fail on the previous head.
2026-10-18 09:25:59 -04:00
TATSUNO “Taz” Yasuhiro 8067ecf1de feat(lambdaweb): send what a Web Function writes to its log groups as AWS does (#5919)
* feat(lambdaweb): send what a Web Function writes to its log groups as AWS does

* chore(lambdaweb): write the Web Function runtime as an ES module

* fix(lambdaweb): create a log group or stream only when an event finds it missing

* fix(lambdaweb): cut a log line by its UTF-8 size after replacing bytes that are not UTF-8

* test(lambdaweb): wait for the last log line instead of a fixed sleep
2026-10-18 09:23:06 -04:00
Kenshin Okinaka 8972b21e1b fix(docker): let the daemon pick dynamic host ports (#5928)
A dynamic port binding sent a port Floci picked with ServerSocket(0), probed
where Floci runs. On Docker Desktop the daemon binds it inside the VM, whose
ephemeral range lies inside the Mac's, so a VM socket on that number failed
the start with "address already in use" and CreateDBInstance returned 500.
The binding now leaves the host port empty and the endpoint is read back from
inspect, as before.
2026-10-18 09:20:50 -04:00
Vũ Thế Huy e38dba5f11 feat(cognito): support Google identity provider federation (#5868)
* feat(cognito): support Google identity provider federation

* fix(cognito): synchronize federated provisioning, support linked users and retain discovery endpoints

* fix(cognito): preserve stored provider identity for standard OIDC federation

* fix(cognito): refuse disabled users during federated sign-in
2026-10-18 09:20:48 -04:00
Kenshin Okinaka 0f5260417f refactor: build the remaining one-violation validation messages through SmithyValidationErrors (#5927)
The "1 validation error detected: ..." messages still written out by hand
outside SES now go through the helper's single-violation overloads:
validationException, validationError and badRequest for their codes, and
exception(code, violation) for InvalidParameterException,
InvalidParameterValueException and ClientException. No message changes.
2026-10-18 09:16:44 -04:00
Niels Kootstra 1ee87fc4e9 fix(stepfunctions): end an Express execution at its maximum execution time instead of letting it run on (#5864)
* fix(stepfunctions): end a synchronous execution at its maximum execution time instead of letting it run on

* test(stepfunctions): build AslExecutor in tests through a shared fixture

* fix(stepfunctions): keep the first outcome of a timed-out Express execution and limit asynchronous Express executions too

* fix(stepfunctions): time out an execution a late runtime error reaches, and measure its deadlines on an injectable clock

* test(stepfunctions): test the synchronous caller's timeout step directly instead of on the real clock
2026-10-18 09:10:25 -04:00
Alessandro Lattao d425e2d884 fix(lambda): refuse a log level under Text as Lambda does (#5920)
Floci accepted ApplicationLogLevel and SystemLogLevel under Text and
dropped them, which a test pinned and the docs described as Floci's own
call rather than probed behaviour. Measured on Lambda (eu-west-1,
2026-10-18): CreateFunction and UpdateFunctionConfiguration refuse either
level under Text, whether LogFormat names Text or is left to that
default, with InvalidParameterValueException "LogLevel is not supported
when LogFormat is set to "Text". Remove LogLevel from your request or
change the LogFormat to "JSON" and try again." In a stack, a valid level
under Text passes the template's validation and fails the resource with
Lambda's message. Floci now refuses it in validateLoggingConfig, so the
API and the CloudFormation update check, which validates through
loggingSettings, both do; and its enum errors list the levels in Lambda's
order: [FATAL, TRACE, WARN, ERROR, INFO, DEBUG] and [WARN, INFO, DEBUG].

The default format is worked out in one place, logFormat, for the
validation and for loggingSettings.

Tests: a level under Text refused on create and on update through the API
(LambdaVpcSnapStartLoggingIntegrationTest, replacing the test that pinned
the old behaviour) and through the SDK (LambdaFunctionConfigTest), by
loggingSettings (LambdaServiceTest), and by a stack update
(CloudFormationLambdaLoggingConfigIntegrationTest); the enum messages'
order. They fail on main.
2026-10-18 08:10:40 -04:00
Aniket Shukla 5a4413d63a fix(ec2): detach Floci before deleting VPC networks (#5869)
* fix(ec2): detach Floci before deleting VPC networks

* refactor(ec2): share VPC endpoint disconnection
2026-10-18 08:03:14 -04:00
Kenshin Okinaka c68cc7694f fix(cloudformation): report a failed resource in the stack's rollback reason the way AWS does (#5904)
* fix(cloudformation): report a failed resource in the stack's rollback reason the way AWS does

The stack's ROLLBACK_IN_PROGRESS / UPDATE_ROLLBACK_IN_PROGRESS reason and
event now name the failed resource, "The following resource(s) failed to
create: [X]. Rollback requested by user." on a create and "failed to
update: [X]." on an update, and the resource's own message stays on its
event. A nested stack's parent resource and a stack set instance still
report that message, read from the stack's events.

* fix(cloudformation): tell a stack's own events from a resource that shares its name

failureCause matched the stack's own events by logical ID alone, so a
resource whose logical ID equals the stack name ended the backward walk
and the nested stack parent and stack set instance got the rollback
summary instead of the resource's message. Match the stack ID as well.

* fix(cloudformation): give a nested stack's parent the child's own reason

AWS puts the child stack's reason on the parent's nested stack resource,
"Embedded stack <arn> was not successfully created: The following
resource(s) failed to create: [X].", so the parent reads the child's
status reason again instead of the failed resource's message. A stack
set instance keeps the resource's message.
2026-10-18 01:10:38 -04:00
Alessandro Lattao 30d2bf03d9 fix(cloudformation): refuse a Lambda function property that is not an object (#5912)
* fix(cloudformation): refuse a Lambda function property that is not an object

The AWS::Lambda::Function provisioner read an object property that
resolved to a scalar or a list as absent, so a malformed VpcConfig,
DeadLetterConfig, TracingConfig or EphemeralStorage reset the function's
setting to its default instead of failing. Measured on CloudFormation
(eu-west-1, 2026-10-18): such a value fails the stack before the function
is touched, on create and on update, with "Property [VpcConfig] expected
type: JSONObject, found: String"; a list reads "found: JSONArray", and a
number or a boolean reads "found: String" too.

resolveMapOrDefault, which reads every object property of the function,
now refuses such a value with that message. AWS reports it from its
pre-deployment validation, with the detail in DescribeEvents, which Floci
does not model; the message is on the resource's failed event.

Tests: CloudFormationLambdaObjectPropertyIntegrationTest (a number VpcConfig
and a list DeadLetterConfig on create, a string TracingConfig on update that
keeps the setting) and, through the SDK, CloudFormationLambdaObjectPropertyTest;
both fail on main. The compatibility suite gains TestFixtures.awaitStackTerminal,
the same helper #5902 adds.

* fix(cloudformation): leave out a Lambda property that resolves to AWS::NoValue

Floci's template engine resolves Ref AWS::NoValue to an empty text node,
which the new type check refused as a String, so a valid template that
leaves VpcConfig, TracingConfig, DeadLetterConfig or EphemeralStorage out
through AWS::NoValue, directly or chosen by Fn::If, failed. Measured on
CloudFormation (eu-west-1, 2026-10-18): both stacks are created.
resolveMapOrDefault now resolves with resolveNodeOmittingNoValue, as other
provisioners do for optional properties, and reads what it leaves out as
the default.

Test: a direct Ref AWS::NoValue on VpcConfig and TracingConfig, and an
Fn::If choosing it for DeadLetterConfig, each create the stack; it fails
on the previous head.
2026-10-18 00:56:25 -04:00
TATSUNO “Taz” Yasuhiro 61102a7c4e fix(dynamodb): match AWS for unprojected GSI attributes in Query, Scan and PartiQL (#5911)
* fix(dynamodb): use the AWS wording for unprojected GSI attributes in Query and Scan

* refactor(dynamodb): share the unprojected GSI attribute error with PartiQL

* fix(dynamodb): check PartiQL GSI columns after the WHERE clause

AWS reports a key type mismatch, overlapping ranges, too many reads and an
unprojected filter attribute before an unprojected column. It also lists
each column root once.

* fix(dynamodb): keep rejecting a projection path that starts with a list index
2026-10-18 00:55:47 -04:00
Kenshin Okinaka b55014ddef refactor(core): build every Smithy validation error through SmithyValidationErrors (#5910)
SmithyValidationErrors gains named factories for the three common codes
(validationException, validationError, badRequest) and a single-violation
overload of each. The "N validation errors detected" builders outside SES
(CloudFormation, Cognito, DynamoDB, EventBridge, Firehose, IAM, IoT, KMS,
Lambda, Rekognition, SSM) and the remaining hand-written
"1 validation error detected" messages in SES move onto it. No message
changes.
2026-10-18 00:47:55 -04:00
Alessandro Lattao 63af5cd299 fix(cloudformation): pass a function's LoggingConfig to Lambda (#5902)
* fix(cloudformation): pass a function's LoggingConfig to Lambda

The AWS::Lambda::Function provisioner never read LoggingConfig, so every
function a stack created logged in Text to /aws/lambda/<name>, whatever
the template said, and an update to it was never applied.

Measured on AWS (eu-west-1, 2026-10-16): the function reads back the
LogGroup the template names; a change to JSON with an ApplicationLogLevel
updates it in place, SystemLogLevel reading back INFO; and removing the
property from the template puts the function back on Text and
/aws/lambda/<name>, again in place. So the provisioner always sends a
LoggingConfig, empty when the template has none, which Lambda resolves to
the function's defaults (JSON for a durable function, which refuses
Text).

The update check compares what Lambda would store, through the same
LambdaService.loggingSettings that UpdateFunctionConfiguration applies,
so an unchanged LoggingConfig is still a no-op redeploy and the two
cannot drift apart.

Tests: the stack lifecycle in CloudFormationLambdaLoggingConfigIntegrationTest
and, through the SDK clients, CloudFormationLambdaLoggingConfigTest, both
failing on main; the normaliser in LambdaServiceTest. The compatibility
suite gains TestFixtures.awaitStackTerminal for the new test rather than
another private copy of the stack wait.

* fix(cloudformation): refuse an invalid log level before comparing LoggingConfig

The update check compared normalised logging settings, and the normaliser
dropped both log levels under Text before anything validated them. An
update whose only change was an invalid level, ApplicationLogLevel VERBOSE
on a Text function, then looked unchanged, never reached
UpdateFunctionConfiguration, and the stack went UPDATE_COMPLETE where
AWS fails the update. LambdaService.loggingSettings now runs
validateLoggingConfig before it normalises, so the comparison refuses
what Lambda refuses, and applyLoggingConfig validates once, through it.

The integration test registers its stacks' deletion with PartitionCleanup,
and the compatibility test's cleanup no longer swallows a failed
DeleteStack, which succeeds for a stack that is already gone.
2026-10-18 00:47:18 -04:00
TATSUNO “Taz” Yasuhiro 0dd443478c fix(appsync): answer a failed AWS_IAM request with AppSync's errors (#5901)
* fix(appsync): answer a bad AWS_IAM signature with AppSync's error and wording

AppSync answers 403 IncompleteSignatureException when the Authorization
header misses a part or the date, and 400 BadRequestException when the
signing time, the signed headers, the scope or the signature are wrong.
The checks run in AppSync's order, and the signature is checked before
the session token.

* fix(appsync): answer an AWS_IAM policy deny with Permission denied

AppSync answers 401 UnauthorizedException "Permission denied" when the
caller's policies do not allow appsync:GraphQL.

* fix(appsync): check a missing signed header and the credential parts in AppSync's order

AppSync checks that every signed header is in the request after the
signing time, then that host is signed, then the credential parts. It
names the header as the request signed it.

* test(appsync): expect BadRequestException for a wrong secret on the GraphQL endpoint

* test(appsync): pin the clock to check the whole signing time message

* chore(appsync): read the Authorization parts with the shared parser
2026-10-18 00:30:48 -04:00
Andre Kurait ae285fc3a8 fix(docker): bound concurrent container teardown (#5860)
Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-17 22:31:47 -05:00
Priamo Germosen 377c09733a fix(s3): check a presigned copy's source read against its credential (#5891)
Under IAM enforcement, CopyObject and UploadPartCopy also need
s3:GetObject on the copy source, or s3:GetObjectVersion for a version,
and S3Controller checks it itself, since the source appears only in the
x-amz-copy-source header. It passed IAM the Authorization header, which
a presigned request does not have, so IAM skipped the check. A user
allowed to write one place could presign a copy of any object they
cannot read into it.

The check now uses the request's credential, the header's or a
presigned URL's query credential, as the copied-tags check next to it
already does. The S3 user guide says "The capabilities of a presigned
URL are limited by the permissions of the user who created it."

The test signer's presignedQuery also signs the parameters already in
its URI's query, such as an UploadPartCopy's upload id, so a presigned
part copy verifies, and refuses a URI that is already presigned. docs/services/iam.md lists the copy source check.
2026-10-17 22:31:36 -05:00