Commit Graph
1715 Commits
Author SHA1 Message Date
Allen Sanborn d68876edcc fix(ec2): ignore ports when revoking an all-traffic rule (#6895)
* fix(ec2): ignore ports when revoking an all-traffic rule

Revoking an "all traffic" (-1) rule compared ports literally. Terraform's
aws_security_group revokes AWS's default egress rule as -1 with FromPort=0
and ToPort=0, which never matched the stored rule (it has no ports), so
every new group kept allowing all egress and the next plan wanted to
remove it again. AWS ignores ports for -1.

Protocols are now compared after the same normalization the security-group
evaluation uses, so a revoke naming protocol 6 also matches a tcp rule, as
on AWS.

* test(ec2): name the all-traffic revoke test a service test

* test(ec2): move the all-traffic revoke tests into Ec2ServiceTest

Use Ec2ServiceTest's existing mockModeService() instead of a copied
mock-mode harness, as requested in review.
2026-10-29 00:32:59 -04:00
Matheus Oliveira 1356cbbc84 fix(core): bind the DB proxies and EC2 port forwards with a 4096 backlog (#6744) 2026-10-29 00:20:54 -04:00
lex00 5a84d08383 fix(iam): read iam:PermissionsBoundary from the stored role or user an action names (#6897)
On the 15 actions where the Service Reference lists iam:PermissionsBoundary and the request carries no boundary, such as AttachRolePolicy, PutUserPolicy and GetRole, the key is the boundary stored on the role or user named by RoleName or UserName. The generator writes these pairs to a fromTarget section, and IamConditionContextResolver looks the boundary up through IamService. A role or user without one carries no value for the key.
2026-10-29 00:07:50 -04:00
Matheus Oliveira 9ce1b1755e fix(ecr): delete only the named tag in BatchDeleteImage (#6597) 2026-10-29 00:06:36 -04:00
Vũ Thế Huy da8e22744b feat(redshift-data): implement ListSessions (#6892) 2026-10-28 23:49:07 -04:00
Jimmy Liu Jia 5ffe6d1123 fix(lambda): attach code signing configs to functions (#6857)
* feat(lambda): attach code signing configs to functions

* fix(lambda): align code-signing IAM function names

* fix(lambda): preserve code-signing config on CreateFunction

* fix(lambda): align code-signing attachment response paths
2026-10-28 23:00:50 -04:00
Priamo Germosen 407ac4e210 fix(iam): check CodeBuild and Kinesis Data Analytics on the resources their requests name (#6884)
Under IAM enforcement, CodeBuild and Kinesis Data Analytics (Amazon
Managed Service for Apache Flink) requests were checked on `*`, so a
grant scoped to a project, a report group or an application was
refused, and a deny scoped to one never applied.

The generated table of the resources requests name now reads them, 92
operations, from AWS's Service Reference and botocore as it reads the
first two batches: their namespaces move from the generator's
NOT_COVERED to NAMESPACES and the table is regenerated, nothing in it
edited by hand; 614 operations over 12 namespaces. Each resource type's
ARN format is the one Floci's handler mints, which the tests check
against the ARN each create returns: `project/<name>`,
`report-group/<name>`, `build/<project>:<number>` and
`application/<name>`.

Kinesis Data Analytics v1, the KinesisAnalytics_20150814 target of SQL
applications, is not read: Floci serves v2 only, and v1's operations
share v2's names with other members. It joins EventBridge V2 in the
generator's CLIENTS_NOT_READ, with its reason.

CodeBuild authorizes a build on its project: the CodeBuild User
Guide's permissions reference gives BatchGetBuilds, StopBuild,
RetryBuild and BatchDeleteBuilds the resource project/project-name.
Their requests name builds by id, which is `<project>:<id>` (its
CODEBUILD_BUILD_ID example is codebuild-demo-project:b1e6661e-...), so
four corrections read the project from the id up to its `:`. For them
the table may read a member filling a variable up to a character
`before`, as it already read an ARN member, in the generator, the
loader and the reader. Without them a policy granting StartBuild and
BatchGetBuilds on a project, as a pipeline's CodeBuild action role
has, allowed starting a build and refused watching it.

A list filling a type's one variable may mix names and ARNs: CodeBuild's
BatchGetProjects takes either for each of `names`. Each value that is
an ARN of the type now names that resource and the others are read as
names, where the reader took ARNs as given only when every value was
one, and otherwise put an ARN inside the name's format, refusing a
caller granted both projects.

Not in this change: a build batch, whose id the documents give no
format for and which Floci does not serve, and a report, named by a
report ARN where AWS checks its report group, stay on `*`.
2026-10-28 21:59:51 -05:00
Priamo Germosen 591d5f533b feat(emr): run a cluster's bootstrap actions in the docker runner mode (#6878)
In the docker runner mode a cluster's BootstrapActions were stored and
listed but never run, so a step that needed what they install, such as
a Python library a PySpark step imports, failed where on AWS it would
run. Now a cluster with bootstrap actions is BOOTSTRAPPING while they
run, one after the other, in one container of the release's EMR
Serverless image, and that container is then kept as the image the
cluster's steps run in.

- Each action's script is read from Floci's S3 (s3n:// and s3a:// name
  the same bucket) and runs with its Args in /home/hadoop through
  docker exec, with the credentials of the cluster's instance profile
  in that exec's environment alone, so they never become part of the
  image.
- "Bootstrap actions execute as the Hadoop user by default. You can
  execute a bootstrap action with root privileges by using sudo", but
  the image has no sudo: an action runs as root, with a sudo that runs
  its command as it is, and what it leaves in /home/hadoop is the
  hadoop user's. The kept image runs as the user of the image the
  container ran, as the steps do, and the steps get it by its id, which
  runs as it is whatever image-registry-base Floci pulls images from.
- An action that exits with another code than 0 ends the cluster
  TERMINATED_WITH_ERRORS, with BOOTSTRAP_FAILURE and "On the master
  instance (<instance-id>), bootstrap action <n> returned a non-zero
  return code", as a real cluster gave it
  (hashicorp/terraform-provider-aws#4378) and the Management Guide
  quotes it. A script that cannot be read ends it the same way, in
  Floci's words; a bootstrap that cannot run, or that a restart cut
  short, with INTERNAL_ERROR. TerminateJobFlows stops it at once.
- With a LogUri, each action's stdout.gz and stderr.gz go under
  <LogUri>/<cluster-id>/node/<instance-id>/bootstrap-actions/<n>/, the
  instance the master as ListInstances gives it. An action's output
  goes to Floci's log line by line as it runs, and to those files
  gzipped as it arrives, through a file on disk, so however much it
  writes, Floci keeps no more than a line of it in memory.
- The image goes once the cluster has ended and its last step is done,
  and the cluster names it until it is gone, so a removal Docker
  refuses is tried again the next time the cluster is read; a reset
  removes them all, and the startup sweep, before any restarted cluster
  can move on, the ones of clusters that are gone or have ended.

ContainerExec gets an overload that sets an environment for one
command alone. What the bootstrap has in common with the Spark runner
and the rest of Floci is shared rather than copied:

- core.common.docker.ContainerLaunches: the runs in progress and their
  containers, which a stop, a reset or a shutdown removes; both EMR
  runners keep theirs in it.
- ContainerLifecycleManager.commit and removeImage.
- ContainerLogStreamer.consoleLines, a stream that logs each line as it
  arrives through the line logger its attach methods now share.
- S3Uri.isS3 and parseAnyScheme, which read s3n:// and s3a:// as s3://.
- EmrServerlessSparkRunner.putLogs, the runner's S3 log writing, which
  now reads each file from a stream.
2026-10-28 21:59:40 -05:00
Allen Sanborn 8ececd84b4 fix(ec2): keep the tags CreateFlowLogs is given (#6890)
* fix(ec2): keep the tags CreateFlowLogs is given

CreateFlowLogs dropped its vpc-flow-log TagSpecification, and
DescribeFlowLogs had no tagSet, so Terraform's aws_flow_log tags never
read back and every plan after apply wanted to add them again. The tags
are now stored with the flow log and returned.

* test(ec2): read a flow log's tags back through the AWS SDK
2026-10-28 22:58:24 -04:00
Vũ Thế Huy c0d1767ec0 feat(redshift): send zero-ETL integration events to EventBridge (#6822) 2026-10-28 22:41:04 -04:00
TATSUNO “Taz” Yasuhiro a682400d45 fix(lambdaweb): check the endpoint quota after the revisions an endpoint routes to (#6888)
Lambda refuses a missing or Failed revision, a Failed latest revision and
a connector revision on a PerRegion or MultiRegion endpoint before it
refuses an endpoint past the maxEndpointsPerFunction quota.
2026-10-28 22:35:14 -04:00
Allen Sanborn 043664471b fix(apigateway): default a REST custom domain to EDGE when no endpoint type is given (#6885)
* fix(apigateway): default a REST custom domain to EDGE when no endpoint type is given

* docs(apigateway): state the CreateDomainName endpoint type default; cite its source

* test(apigateway): seed the legacy base path mapping test with a REGIONAL domain

The test reads its mappings through the v2 API, which refuses EDGE domains,
and a domain created with no endpoint type now defaults to EDGE.
2026-10-28 22:08:18 -04:00
Kenshin Okinaka 4dbe3731a9 feat(ses): add SES v2 ListRecommendations (#6817) 2026-10-28 21:55:19 -04:00
Allen Sanborn 0e87e6f1de fix(ec2): let a systemd guest's init start sshd (#6882)
Floci started /usr/sbin/sshd itself in every guest, including systemd ones
whose image starts sshd from its own unit at boot. The two raced for port
22: if Floci's won, ssh.service failed, and the stray daemon outside systemd
kept the port, so a later `systemctl restart ssh` (to apply an
sshd_config change, as user data commonly does) failed too. On EC2 the AMI's
init alone starts sshd; systemd guests now work the same way.
2026-10-28 21:11:09 -04:00
TATSUNO “Taz” Yasuhiro 177f8e9360 fix(lambdaweb): accept a policy Action of "*" or any case of lambda (#6883)
Lambda takes "*" or "<service>:<action>" with a service of letters,
digits, dots and dashes. Each action names lambda in any case, unless the
list also holds "*", which lets actions of other services through.
2026-10-28 21:07:10 -04:00
Allen Sanborn 3f36c4e99e fix(ec2): record EbsOptimized from RunInstances (#6875)
* fix(ec2): record EbsOptimized from RunInstances

RunInstances dropped EbsOptimized, so an aws_instance with
ebs_optimized = true read back false and Terraform replaced it on every
plan. The request's value, else the launch template's, is now recorded on
each launched instance.

It is applied after the launch on the RunInstances API path only;
instances launched by CloudFormation, Auto Scaling or Fleet still report
false (documented).

* test(ec2): clean up the launch template and each instance if a launch fails

The launch-template case launched both instances before its cleanup scope
opened, so a failed launch leaked the template and, on the second launch,
the first instance.
2026-10-28 21:05:31 -04:00
Vũ Thế Huy e820414f22 feat(redshift-serverless): execute scheduled actions on cron and at schedules (#6851) 2026-10-28 21:05:15 -04:00
Priamo Germosen 6606657434 fix(iam): name the member without the offending value in a validation error (#6811)
IAM's constraint violations read `Value at 'roleName' failed to satisfy
constraint: Member must have length greater than or equal to 1`, with no
value beside the member, which is where the recorded messages point: the two
IAM messages in LocalStack's AWS-validated snapshot from 2025-03-06, a 2026
capture of a `UserName` over 64 characters, and the messages the Identity
Center guide lists as the ones that commonly appear in CloudTrail events.
The two captures that carry the value are from 2019 and 2024, so they read
as stale rather than as wrong when written. STS keeps the value, which its
own 2024 capture carries and which is the same split this package already
records for pattern and enum messages.

It is a reading rather than a published rule, so `docs/services/iam.md` says
so and names the captures behind it. A direct capture that shows IAM
carrying the value again moves it back in one edit.

The form is chosen in one place. `SmithyValidationErrors.Violations` writes
each sentence once and carries both forms; the statics stay the quoting one,
so every other service answers exactly what it answered before.
`IamValidationErrors` names IAM's side of the split for the handler, the
service and the service-last-accessed check, and the shared Query walk is
loaded with the form of the service reading it, IAM without the value and
STS with it.

Two messages are left alone, neither being this question: a list checked as
a whole carries the list as its value, which is what AWS does elsewhere, and
a required member the request leaves out keeps `Value null at '<member>'`,
which no capture covers in either form.

Two checks built the message by hand rather than through a helper and so are
swept here too: `GenerateOrganizationsAccessReport` and the delegation
request operations each composed the quoted value inline, which is why
neither shows up in a search for the literal form. Their entity path and
request id now assert the whole message rather than only the error code,
since asserting the code alone is what let that drift sit unnoticed.

The vendored shapes file carries 52 operations now rather than 13, so the
members the paging wave opted in answer in the shorter form as well, and the
table sweep over every paged operation asserts it that way.
2026-10-28 19:51:54 -05:00
TATSUNO “Taz” Yasuhiro 9217533e76 fix(lambdaweb): give the container the memory the process sees on AWS (#6869) 2026-10-28 20:15:38 -04:00
Matheus Oliveira 347e8f63a9 fix(opensearch): scope domains to the request's region (#6682)
* fix(opensearch): scope domains to the request's region

Domain records were keyed by the bare name, so a domain created in one
region could be described, updated and deleted from another, and the
same name conflicted across regions. Key the store by region and name,
resolve every operation inside the region the request is signed for,
and migrate pre-scoping records onto the scoped key taking the region
from their ARN. Region-scope the legacy host-path data directory per
account and region, keeping the bare directory for records that predate
the region marker while it still exists.

Closes #6081

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

* fix(opensearch): reject a tag ARN naming another account as not found

findByArn resolved the account named in the ARN, where every fixed
lookup only reached the caller's account through the account-aware
storage backend, so a caller could read and change another account's
domain tags under the default settings. An ARN naming a foreign account
now answers ResourceNotFoundException the way Lambda layers, EventBridge
and Redshift answer theirs, and the RegionScoping suite pins it for the
three tag operations.

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

---------

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-10-28 20:09:22 -04:00
TATSUNO “Taz” Yasuhiro fc1388da6f fix(lambdaweb): accept a policy Resource in any partition, region or account (#6863) 2026-10-28 20:04:40 -04:00
Priamo Germosen 096d336fab fix(iam): check five more services on the resources their requests name (#6810)
Under IAM enforcement, Amazon Data Firehose, Cognito identity pools,
Cloud Map, ACM and CodePipeline requests were checked on `*`, so a
grant scoped to a delivery stream, an identity pool, a namespace or a
service, a certificate, a pipeline or a webhook was refused, and a deny
scoped to one never applied.

The generated table of the resources requests name now reads them, 149
operations, from AWS's Service Reference and botocore as it reads the
first batch: their namespaces move from the generator's NOT_COVERED to
NAMESPACES, and the table is regenerated, nothing in it edited by hand.
Each resource type's ARN format is the one Floci's handler mints, which
the tests check against the ARN each create returns:

- `deliverystream/<name>`, `identitypool/<id>`, `namespace/<id>`,
  `service/<id>`, `certificate/<id>` and a pipeline's bare name.
- A CodePipeline webhook: AWS's is `webhook:<name>` (the Service
  Reference's format, and the CodePipeline User Guide's
  "arn:aws:codepipeline:eu-central-1:ACCOUNT_ID:webhook:my-webhook"),
  where Floci minted `webhook/<name>`; it now mints AWS's.

Corrections, each with its reason:

- StartPipelineExecution and GetPipelineState name their pipeline by a
  bare `name` ("The name of the pipeline to start"), which the rule
  reads only for an operation named after the type, as Step Functions'
  StartExecution names its execution, not its state machine, by `name`.
- CreatePipeline and UpdatePipeline name it by `pipeline.name`, and
  PutWebhook the webhook by `webhook.name` and the pipeline it connects
  to by `webhook.targetPipeline`. `pipeline.roleArn` holds the role
  CodePipeline assumes, an IAM role's ARN by botocore's pattern, and
  names no pipeline: read as one, a pipeline-shaped value there was the
  only resource an UpdatePipeline was checked on, so a grant on one
  pipeline let a request change another.
- CreateCustomActionType and DeleteCustomActionType are checked on
  `actiontype:Custom/<category>/<provider>/<version>`: a custom action
  type's owner is Custom, which the request does not give, and AWS's
  CreateCustomActionType example answers "owner": "Custom".
- Cloud Map's CreateService names its namespace by NamespaceId or,
  when it gives none or a JSON null, by DnsConfig.NamespaceId, which
  botocore keeps ("Use NamespaceId in Service instead") and the handler
  reads then; read by NamespaceId alone, a deny on the namespace did
  not hold for a request giving it in DnsConfig. A member given a JSON
  null now counts as absent in a resource's `when` and `unless`, as a
  handler reading it with asText(null) takes it, unless the table reads
  it as a value through `absent` (EventBridge's bus, `default`).

For those, the table may fill a variable from a structure's field
(`pipeline.name`), and give a variable no member gives the one value
its handler uses (`fixed`), in the generator, the loader and the
reader.

A create that names another resource beside the one it makes has its
tags checked on the one it makes alone, which the table marks `made`:
the resource of the type, or with an ARN format's leading resource
word, related to the operation's name past its verb. PutWebhook's tags
go on the webhook, not the pipeline it connects to, and CreateService's
on `service/*`, not the namespace; no other operation in the table is
marked.

Application Auto Scaling stays unread, its reason in NOT_COVERED: a
scalable target's ARN ends in an id the service mints, while requests
name the target by ServiceNamespace, ResourceId and ScalableDimension,
and read as a member ResourceId would fill that id.

RequestResourceMembersTest's test of every resource in the table now
expects, with the resource a request names, the resources of its
operation that every request names: Cloud Map's CreateService names
the service it creates with every variable open.
2026-10-28 17:18:11 -05:00
berce 6abd9d7ffb fix(sqs): reject DelaySeconds outside 0-900 (#6852)
* fix(sqs): reject DelaySeconds outside 0-900

* fix(sqs): don't let a json DelaySeconds outside the int range wrap around

* docs(sqs): document the DelaySeconds range
2026-10-28 16:57:56 -04:00
lex00 52eb4b9a9c fix(iam): read condition keys a request carries in a member under another name (#6858)
BY_HAND in tools/aws/regen_iam_condition_keys.py names the member for four pairs: iam:ServiceSpecificCredentialServiceName from ServiceName and iam:ServiceSpecificCredentialAgeDays from CredentialAgeDays on CreateServiceSpecificCredential, and iam:DelegationDuration from SessionDuration and iam:TemplateArn from Permissions.PolicyTemplateArn on CreateDelegationRequest. --check fails when a BY_HAND member leaves botocore, its type no longer fits the key, or the reference stops listing the pair. The other notRead pairs now say where AWS takes the value from.
2026-10-28 16:42:22 -04:00
Allen Sanborn 3212ce3c15 fix(iam): page ListUsers, ListGroups and policy lists with MaxItems and Marker (#6267)
* fix(iam): page ListUsers, ListGroups and policy lists with MaxItems and Marker

ListUsers, ListGroups, ListAttached{User,Group,Role}Policies and
List{User,Group,Role}Policies read neither MaxItems nor Marker and always
answered IsTruncated=false with every entry. They now go through the same
paginate helper ListRoles and ListPolicies use: an omitted MaxItems returns
100 items as the API reference documents, a MaxItems outside 1 to 1000 is a
ValidationError, a Marker the handler did not issue is InvalidInput, and a
Marker appears only on a truncated page.

Users, groups and inline policy names are listed in name order and attached
policies in ARN order, so a Marker keeps pointing at the same place between
calls even when the entry it names is removed in between.

* fix(iam): resume the newly paged IAM lists only from their own markers

ListUsers, ListGroups and the attached and inline policy lists read a
Marker they could not verify as a list offset, so Marker=1 silently
skipped the first entry, and a marker issued for one role's list resumed
another role's list after the same policy. These lists have only ever
issued signed markers, so their cursor now carries the action and, for a
per-principal list, the principal, and any other marker is InvalidInput.
ListRoles, ListPolicies and the other readers keep their existing marker
handling.

Also covers the omitted-MaxItems default on ListUsers and ListGroups with
101 entries: 100 on the first page, IsTruncated and a Marker that fetches
the last one.

* fix(iam): bind the newly paged IAM lists' markers to the request account

IAM entities are stored per account, but the marker cursor named only the
action and principal, so a marker issued in one account resumed the same
listing in another account after the same name and skipped its earlier
entries. The cursor now carries the account the request reads from, and a
marker from another account is InvalidInput.

* feat(iam): generate the IAM paginator table from botocore

tools/aws/regen_iam_paginators.py writes src/main/resources/aws/iam-paginators.json
from botocore's iam/2010-05-08 model, as the other tools/aws generators do: every
operation whose request models Marker, with its input and output token, limit
key, truncation flag and result keys, the MaxItems bounds of maxItemsType
(1 to 1000), the default page size the limit's documentation states ("defaults
to 100"), and markerType's bounds.

The 34 operations botocore's paginators-1.json lists take their tokens and
result keys from it. The six that model Marker without a paginator
(GetServiceLastAccessedDetails, GetServiceLastAccessedDetailsWithEntities,
GetOrganizationsAccessReport, ListServiceSpecificCredentials,
ListDelegationRequests, ListPoliciesGrantingServiceAccess) are read from
their request and response shapes and marked paginator: false.
ListServiceSpecificCredentials documents no default and
ListPoliciesGrantingServiceAccess models no MaxItems; the table records
both as such rather than inventing a value.

make aws-data-sync regenerates it and make aws-data-check fails when it is
stale against the pinned botocore.

* fix(iam): page every IAM list through one path driven by the paginator table

IamQueryHandler paged eight lists by hand through paginateScoped, a few more
through paginate, and left the rest (the tag readers, ListAccessKeys,
ListInstanceProfiles, ListPolicyVersions, GetGroup, ListGroupsForUser,
ListEntitiesForPolicy, GetAccountAuthorizationDetails, the simulations and
others) ignoring MaxItems and Marker with IsTruncated=false. Every operation
the generated aws/iam-paginators.json lists now pages through one paginate
path that reads its entry: the limit's bounds and default, the members that
resume and continue it, and the result keys pagedList and pagedLists write
under. paginateScoped, paginateByMarker and the hardcoded 100/1000 are gone.
ListEntitiesForPolicy and GetAccountAuthorizationDetails page their several
lists as one, in the paginator's order.

Marker semantics, chosen deliberately: a Marker is opaque and resumes only the
listing that issued it, on every paged operation. AWS documents it as "the
value of the Marker element in the response that you received", so a value
Floci did not issue, a bare number included, is InvalidInput; ListRoles,
ListPolicies and the report readers no longer read one as an index. The
marker names the last item of its page, so a deletion or creation ahead of
it skips nothing and repeats nothing, and it is signed (not prefixed) over
the account, the operation and every request member except Marker and
MaxItems, so a marker from another operation, principal, filter or account
is refused while the page size may change between calls. Signing the scope
instead of carrying it keeps issued markers short. markerType's 320-character
bound is not checked separately: every other value is refused as unissued,
and a long ARN key could otherwise push an issued marker past it.

MaxItems is now checked before Marker, as a malformed request is rejected
before anything is read from it. An omitted MaxItems is the documented 100;
ListServiceSpecificCredentials, which documents no default, returns its whole
list.

IamListPaginationIntegrationTest.everyPaginatedOperationHonoursMaxItemsAndMarker
iterates the table's 34 paginated operations, each with a fixture listing two
items, and checks the MaxItems bounds, a one-item page, resumption without
loss or repetition, the default page, and refusal of an unissued, bare-index
or other operation's marker. Its fixture map must name exactly the table's
operations, so one AWS starts paging later fails until it has one.
ListAccountAliases can hold one alias, so it is checked for everything but a
cut page. The tests the table test subsumes are removed; the ordering, anchor,
cross-listing and cross-account tests stay. Two ServiceLastAccessed tests
that walked by bare index now use issued markers.

* fix(iam): hold paged requests to the model through IamRequestShapes

MaxItems and Marker are request constraints, and main now checks a
request against the model before it runs. Every operation the paginator
table pages joins that wave in regen_iam_shapes.py, and the bounds leave
iam-paginators.json (which keeps only defaultItems, the documented page
size) and limit(), which now only parses the number and applies the
default. A pytest pins that every operation the paginator table carries
is in the wave, so a list AWS starts paging later cannot slip past the
bounds.

Six paged operations join with Marker and MaxItems alone: the three
report readers, whose JobId is answered by hand as "length equal to 36"
and whose SortKey enum is checked by hand; ListPoliciesGrantingServiceAccess,
whose empty ServiceNamespaces is answered InvalidInput; and the two
Simulate operations, whose ContextEntries nest a list inside a list of
structures, which the walk refuses. Vendoring their whole request would
reword answers main already settled; vendoring nothing would leave their
paging unbounded (SimulateCustomPolicy with MaxItems=0 was a 500).

Markers fit markerType's 320 characters. A marker embeds the key of the
item its page ended on, so a policy ARN with a long path produced one
of 610 characters, which the model check would now refuse on the way
back. SignedMarkers takes a maximum length: a cursor that would exceed
it is carried as a SHA-256 digest (119 characters once signed and
encoded), and the instance keeps the digest -> key mapping. That keeps
the existing resume semantics exactly: the marker still resolves to the
full key, so a deleted anchor resumes at the first key after it, and
the signature still binds account, operation and filter. Two stateless
alternatives were rejected: a truncated key prefix plus digest cannot
order a deleted anchor against items sharing the prefix, and a position
index skips or repeats when items ahead of it are deleted. The cost is
one map entry per distinct long key a page has ended on, never evicted
(marked ponytail in the code); markers already do not survive a
restart, as the signing key is per instance. Keys short enough to embed
are carried as before.

Checkstyle (./mvnw checkstyle:check) reported six errors in files this
PR touches: javax import order and two inline org.w3c.dom.Node in the
pagination test, and an inline java.util.Base64 in SignedMarkersTest.
The test now parses through XmlParser.parseDocument instead of its own
DocumentBuilderFactory. The switch statements in ListEntitiesForPolicy
and the test's holder fixture are switch expressions.

Tests: aMarkerEndingOnALongPolicyArnFitsTheModelAndResumesPastItsDeletion
attaches three policies under a 391-character path, pages with
MaxItems=1, deletes the anchor and resumes through the model check.
Constructing SignedMarkers without the limit fails it (610 characters);
restoring the pre-wave iam-request-shapes.json fails the table-driven
test (MaxItems=0 answered 500, MaxItems=1001 answered 200).

* fix(iam): bind a caller-resolved list's marker to the resolved user

ListAccessKeys, ListMFADevices, ListSSHPublicKeys, ListSigningCertificates
and ListServiceSpecificCredentials default an omitted UserName to the
caller. The marker was signed over the raw request members, so two users
in one account who both omitted UserName shared a scope and one's marker
resumed the other's listing. These handlers now page over the request
with UserName set to the resolved user, so the marker is bound to the
user the list was read for, named or implicit.

* fix(iam): bound the SignedMarkers digest map and trim the pagination test

SignedMarkers held every long cursor it had issued a digest for, in a map
that never shrank. It is now an access-ordered LinkedHashMap capped at
10,000 entries, the idiom CloudWatch Logs uses for its Insights queries. A
marker whose digest was evicted resolves to null, the same as an unknown
digest, so callers refuse it as an invalid marker.

IamListPaginationIntegrationTest spent most of its time in RestAssured's
per-request overhead on the hundred-item fixtures. Those creates and
deletes now go concurrently through java.net.http. The users and groups
default test keeps its first-page checks of the default of 100 and drops
the second page, which the roles default test and the every-operation test
already cover. The SSH public key fixture is generated once per run.
2026-10-28 16:37:49 -04:00
Jackson Price d7763fff8e fix(ec2): honor DryRun when creating VPCs, subnets and security groups (#6823)
* fix(ec2): honor DryRun when creating VPCs, subnets and security groups

CreateVpc, CreateSubnet and CreateSecurityGroup never read DryRun, so a
dry run created the resource it asked about. A real CreateVpc that
followed left a second VPC, and the real create of a subnet or group
failed: InvalidSubnet.Conflict for the subnet's CIDR block,
InvalidGroup.Duplicate for the group name.

Each handler now answers DryRunOperation (HTTP 412) and creates
nothing. It answers after parsing the tag specifications and, for
CreateSecurityGroup, reading the required GroupName and
GroupDescription. Ec2Service makes every other check, so a dry run is
answered before the VPC id, the VPC, the CIDR block, the tenancy,
overlap with other subnets or a taken group name are checked. AWS
documents no order for those checks.

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

* fix(ec2): look up the VPC before answering a subnet or group dry run

A DryRun CreateSubnet or CreateSecurityGroup naming a VPC that does not
exist answered DryRunOperation, "would have succeeded", while the real
create fails with InvalidVpcID.NotFound. CreateSubnet without a VpcId
answered DryRunOperation too, where the real create gives
MissingParameter.

The handlers now require the VpcId and look up the VPC, the default one
for a security group without a VpcId, before they answer the dry run.
A RunInstances dry run already keeps the error of a missing subnet or
group, and the Service Authorization Reference lists the VPC, with its
tags and tenancy, in both actions' permissions.

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

* fix(ec2): share the security group VPC lookup with its dry run

The CreateSecurityGroup handler and Ec2Service each picked the group's
VPC, the named one or the region's default, so the two copies could
drift. Ec2Service.requireSecurityGroupVpc now does it for both, and the
CreateSubnet handler looks up the VpcId it has just required.

New tests cover a group dry run with an absent or empty VpcId, which is
answered for the default VPC, and a group dry run in a missing VPC
through the SDK. The comments and docs now name every check a dry run
skips, the zone and the IPv6 block included, and link the Service
Authorization Reference.

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

* docs(ec2): list the errors a create dry run still returns

The CreateVpc, CreateSubnet and CreateSecurityGroup rows said which
checks a dry run skips but not which errors it keeps. They now say that
a tag specification error, and a missing VpcId, GroupName,
GroupDescription or VPC, comes back on a dry run too, and that an empty
VpcId also puts a security group in the default VPC.

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

* test(ec2): keep tag errors ahead of the create dry-run answer

CreateVpc, CreateSubnet and CreateSecurityGroup read their tag
specifications before they answer DryRun, so a reserved aws: key is
still rejected on a dry run, as the EC2 docs page says. A handler test
now pins that for all three actions; it fails if the dry-run answer is
moved ahead of the tag parsing.

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

* test(ec2): use the shared EC2 request helper in the dry-run test

Ec2CreateDryRunIntegrationTest now calls Ec2Requests.ec2 with "test"
and "us-east-1" instead of its own copy of that helper. The comments
in the CreateSubnet and CreateSecurityGroup handlers shrink to one
line each; docs/services/ec2.md already explains the order.

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

---------

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
2026-10-28 16:26:07 -04:00
Aniket Shukla 3c391a06fb fix(lambda): paginate code signing configurations (#6832)
* fix(lambda): paginate code signing configurations

* fix(lambda): reuse signed service pagination
2026-10-28 13:46:14 -04:00
Aniket Shukla 8a19c3024b fix(sqs): reject invalid receive message counts (#6827) 2026-10-28 13:19:19 -04:00
galsuchetzky-act f926968167 fix(s3control): take TagResource and UntagResource tag condition keys from generated data (#6677)
The Service Authorization Reference lists aws:RequestTag/${TagKey} and
aws:TagKeys as condition keys for s3:TagResource, and aws:TagKeys for
s3:UntagResource. botocore's s3control model says where the request
carries them: TagResource's Tags list in the body, UntagResource's
TagKeys in the tagKeys query parameters.

With IAM enforcement on, Floci checked both S3 Control actions with no
request tag keys. A policy that allows TagResource only for certain tag
values, or UntagResource only for certain keys, matched no request, so
a request it allows was denied, and a ForAllValues condition on
aws:TagKeys allowed UntagResource whatever keys it named.

tools/aws/regen_s3control_tag_condition_keys.py now generates
s3control-tag-condition-keys.json from the two sources, as the DynamoDB
condition key table is generated: every s3 action the reference gives
either key, and every S3 Control operation's request members that feed
them, found as the tag-on-create table finds tag members.
IamConditionContextResolver reads it for a request on an S3 Control
route. The make targets check the members offline against the pinned
botocore in CI and the actions online against AWS in the IAM data drift
workflow. S3's own bucket and object tag keys stay as written, since
they were measured against AWS and do not all match the reference.
2026-10-28 10:14:26 -04:00
TATSUNO “Taz” Yasuhiro c55cb887d5 fix(lambdaweb): check resource policy statements in the order AWS does (#6788)
AWS runs each policy check on every statement before the next check. It answers an Effect other than Allow or Deny with "Invalid effect: <value>", and a malformed Principal or a non-string Effect with "Syntax error at position (-1,-1)".
2026-10-28 09:22:20 -04:00
Aniket Shukla 9eabfaf9bc fix(apigateway): map Lambda context in HTTP proxy requests (#6818) 2026-10-28 09:09:52 -04:00
Francisco Javier Barón 481b7f8d6d fix(lambda): pass LoggingConfig log format and level to the runtime (#6775)
* fix(lambda): pass LoggingConfig log format and level to the runtime

A function with LogFormat=JSON logged text: neither launcher set AWS_LAMBDA_LOG_FORMAT or AWS_LAMBDA_LOG_LEVEL, which the runtime interface clients read. Both launchers now pass them, and a JSON function without an ApplicationLogLevel gets INFO, the level the API reports, through one default shared with the response.

Closes #6774

* docs(lambda): note the log format and level the runtime receives

* refactor(lambda): build the runtime environment in one place for both launchers

ContainerLauncher and KubernetesPodLauncher wrote the same AWS_LAMBDA_* lines, the LoggingConfig ones included. LambdaRuntimeEnv.of now builds them once.
2026-10-28 09:04:14 -04:00
Aniket Shukla 119b7e9580 fix(athena): paginate query execution listings (#6816) 2026-10-28 09:03:55 -04:00
Jackson Price a83fa9c9e4 fix(ec2): keep the KMS key a volume is created with (#6756)
* fix(ec2): keep the KMS key a volume is created with

CreateVolume ignored KmsKeyId, so neither CreateVolume nor
DescribeVolumes reported kmsKeyId, even for a volume created encrypted
with a named key. A volume CreateVolume makes encrypted now keeps the
request's KmsKeyId as given, or gets the region's default EBS key when
it names none, and both responses report it. A volume that is not
encrypted keeps no key, and volumes stored before this change load as
they were, with no kmsKeyId.

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

* test(ec2): read volume responses with XmlParser

The volume KMS key tests read CreateVolume and DescribeVolumes
responses with a regular expression, substring offsets and plain
string matches. They now read them with XmlParser, as other EC2 tests
do, so element values are parsed and decoded as XML. Test-only; the
assertions are unchanged.

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

* fix(ec2): keep the KMS key a launch's block device mapping names

A launch's encrypted volumes got the region's default EBS key even
when their block device mapping, or the launch template's, named
Ebs.KmsKeyId. The key now goes from the mapping to the volume, root
included, and a mapping that names none still gets the default.

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

* test(ec2): pin the launch volume key rules

Pin that a launch mapping naming a key without Encrypted leaves the
volume unencrypted and keyless, and that a request entry's key wins
over its launch template's. Delete the test's launch template, reuse
the launch helpers in the root-volume test, and document that a launch
volume encrypted only by its snapshot gets the region's default key,
since snapshots record no key.

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

---------

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
2026-10-28 08:46:27 -04:00
Daniël van Ziel 0ee1d10659 fix(cognito): refuse a reused TOTP code for SOFTWARE_TOKEN_MFA (#6808)
A software-token code now answers one SOFTWARE_TOKEN_MFA challenge only. The step of the
last accepted code is stored on the user, and a code from that step or an earlier one fails
with ExpiredCodeException, as AWS does (RFC 6238 section 5.2). VerifySoftwareToken does not
record a step, and activating a new authenticator clears it.

Fixes #6804
2026-10-28 07:20:05 -04:00
Liron CohenandliRONCO11 548788840c feat(cloudfront): serve execute-api custom origins of this Floci in-process (#6754)
* feat(cloudfront): serve execute-api custom origins of this Floci in-process

A custom origin whose domain is an execute-api endpoint of an HTTP or
REST API in this Floci is now served through Floci's own listener, as
Lambda Web Function endpoints are, with the execute-api domain as Host.
Before, the origin went through DNS and the viewer got 502.

ApiGatewayExecuteApiHostFilter.routes() says whether the host filter
rewrites a host and path onto an API. A request that it does not route
(a WebSocket API, a disabled endpoint, a missing stage, another region)
answers 404 and never reaches Floci's other endpoints. Dot segments in
the forwarded path are resolved before that check. A forwarded viewer
Host answers 502. Every other origin is unchanged.

* refactor(cloudfront): share the execute-api routing decision with the host filter

ApiGatewayExecuteApiHostFilter.decide() returns the routing decision
without touching the request, with its lookups under the API owner's
account. filter() applies the decision and routes() reuses it, so the
two cannot drift.

This fixes two cases where routes() differed from filter(): an HTTP API
owned by another account than the viewer is now served through
CloudFront, and a REST API origin whose region label is not the API's
region now answers 404. The 404 body is one constant.

* refactor(apigateway): keep Optional out of the route decision record

RouteDecision stores the API owner as a nullable value, and the decision
helpers take it as a plain parameter. Optional stays the return type of
the owner lookup only, as AGENTS.md asks.

* refactor(cloudfront): name the ignored host parse failure and drop the Optional test field

---------

Co-authored-by: liRONCO11 <7966063+liRONCO11@users.noreply.github.com>
2026-10-28 07:12:47 -04:00
Aniket Shukla a636de20dc fix(backup): persist and manage backup plan tags (#6796) 2026-10-28 07:08:52 -04:00
Aniket Shukla da517acc65 fix(cognito): verify SRP proofs in custom authentication (#6794)
* fix(cognito): verify SRP proofs in custom authentication

* fix(cognito): include password-change challenge parameters
2026-10-28 07:07:12 -04:00
lex00 967e87d7f7 fix(iam): set iam: condition keys from a table generated from the Service Reference (#6762) 2026-10-28 07:00:43 -04:00
TATSUNO “Taz” Yasuhiro 0c549d267b fix(lambdaweb): refuse an Allow for a federated principal as public (#6789)
AWS blocks an Allow whose principal is Federated unless its values include "*" or a trusted condition pins the caller. It checks no pattern on Federated or CanonicalUser values.
2026-10-28 06:54:08 -04:00
Priamo Germosen 897667f4e6 feat(emr): run command-runner.jar commands and script-runner.jar scripts (#6747)
In the docker runner mode a step that was not a Spark step failed
without running, so a cluster whose steps copy files with the AWS CLI,
run a shell or Python script, or call script-runner.jar could not run
its steps in Floci. Such steps now run in the same per-step container
of the release's EMR Serverless image, with the same credentials,
endpoint, logs and lifecycle as a Spark step, as the Release Guide's
"Run commands and scripts on an Amazon EMR cluster" describes them:

- command-runner.jar runs its arguments as a command, the first naming
  it, unless that is spark-submit (the Spark step, as before) or a tool
  the image does not have: hive-script, pig-script, hadoop-streaming,
  hadoop-lzo and s3-dist-cp still fail without running.
- script-runner.jar, by name (7.13 on) or by its
  s3://<region>.elasticmapreduce/libs/script-runner/script-runner.jar
  URI, fetches its script from S3 with the image's AWS CLI and the
  step's credentials, then runs it with the step's other arguments. A
  local script named without a path runs from the working directory
  when a file there has that name.

The image runs them as its hadoop user in /home/hadoop, with bash,
Python 3, Java, curl and AWS CLI v2, which reaches Floci through
AWS_ENDPOINT_URL. A spark-submit they start runs in local mode on
Floci's S3 with the cluster's spark-defaults: the image's
spark-defaults.conf names EMR Serverless's resource manager as its
master, which a system property cannot override, so the container
starts through a wrapper that copies the image's Spark configuration,
drops that master, and adds local mode, Floci's settings and the
cluster's spark-defaults, in a SPARK_CONF_DIR of its own, each setting
escaped for the Properties file Spark reads it as. A step's own --conf
still wins. A failed command reads "The step's command exited
with code N.".

SparkJobRunner.Job gets a command, run in place of spark-submit.
2026-10-27 23:41:56 -05:00
Andre Kurait 2d3fb0ce87 fix(ecs): bound FireLens socket volume paths (#6787)
Bound the FireLens socket volume name while retaining full ownership labels and cleanup retries, and validate the inspected host path before creating containers.

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
2026-10-28 00:30:44 -04:00
Andre Kurait a46a2b32fd fix(lambda): honor platform-specific runtime image overrides (#6786)
Select runtime images with the effective Docker platform while preserving runtime-wide defaults, explicit platform precedence and code-volume helper platform.

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
2026-10-28 00:06:26 -04:00
Andre Kurait 80dbdbc0f8 fix(elb): default omitted classic listener instance protocols (#6785) 2026-10-27 23:55:13 -04:00
Vũ Thế Huy d3c4732b31 feat(cloudformation): provision Redshift event subscriptions (#6664)
* feat(redshift): support event history and SNS notifications

* fix(redshift): guard stale delivery failures and prune all event scopes

* feat(cloudformation): provision Redshift event subscriptions

* fix(redshift): scope snapshot events and serialize subscription tag mutations

* feat(cloudformation): provision Redshift event subscriptions

* fix(cloudformation): resolve Redshift subscription list parameters

Use the shared list reader for SourceIds and EventCategories. Cover CommaDelimitedList and List<String> parameters through the AWS SDK and verify concurrent tag requests preserve CloudFormation tag updates.

* fix(redshift): honor event disablement and restore rollback attributes

Check the EventBridge external service key before publishing API events. Snapshot and restore CloudFormation resource attributes alongside subscription state during in-place rollback.

* fix(redshift): drop API event publisher and share subscription setup

Remove RedshiftApiEventPublisher, its handler hook, tests and docs, which are not part of the CloudFormation resource and emit CloudTrail-style events without a trail. Route createSubscription and replaceSubscription through one helper that normalizes the subscription fields.
2026-10-27 23:28:52 -04:00
Andre Kurait 5c20d54646 fix(appconfig): reject ambiguous configuration names (#6783) 2026-10-27 23:17:05 -04:00
Andre Kurait b5033e970d fix(ec2): model scheduled capacity reservations (#6764)
* fix(ec2): reject unsupported future capacity reservations

Reject StartDate before capacity reservation creation or client-token replay. Preserve immediate reservation behavior.

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>

* fix(ec2): model scheduled capacity reservations

Retain future start and commitment metadata, activate through capacity reconciliation, and preserve client-token replay.

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>

* fix(ec2): preserve activation membership and replay tags

Reuse open-reservation instance matching during activation, persist creation tag identity, and keep replay from overwriting later tag edits.

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>

* fix(ec2): validate future reservation matching and capacity

Require targeted matching, supported instance families and at least 32 vCPUs before future reservation publication. Preserve scheduling, tag replay and immediate reservation behavior.

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>

---------

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
2026-10-27 23:15:52 -04:00
Vũ Thế Huy 5bd4bd481a feat(redshift): publish CloudWatch cluster metrics (#6740)
* feat(redshift): publish CloudWatch cluster metrics

* fix(redshift): skip duplicate CloudWatch publication minutes

* test(redshift): isolate metrics publisher between integration tests

* fix(test): use Java 17 list access in Redshift metrics compatibility test

* fix(metrics): share minute publishing and prevent duplicate SQS samples

Centralize daemon scheduling, minute claims, per-target failures, retention and shutdown for SQS and Redshift. Carry the Redshift proxy key in metric targets and use the shared compatibility await fixture.

* docs(metrics): restore publisher class docs after the shared publisher move

Keep the SQS sample shape on SqsMetricsPublisher and document minute stamping, 15-day retention and the nothing-may-escape rule on MinuteMetricsPublisher.
2026-10-27 22:03:23 -04:00
Andre Kurait f4ace9ebbe fix(appconfig): return no content for cached configurations (#6777) 2026-10-27 22:00:37 -04:00
TATSUNO “Taz” Yasuhiro 701b04c410 feat(lambdaweb): reject resource policies whose principal does not exist (#6769)
* feat(lambdaweb): reject resource policies whose principal does not exist

PutResourcePolicy now looks up every AWS principal a policy names, as Lambda
does before it stores the policy. A role or user ARN has to name one IAM
holds in that account, under its own path, and a unique id one in the
function's account. A missing principal, an assumed-role session, a
CanonicalUser or an ARN in another partition gets the invalid principal
message, and a role or user named under another path gets the message
that the ARN does not match the actual one.

The principals are looked up after every statement passes its other
checks and before any statement is refused as public, which is the order
AWS checks them in.

* docs(lambdaweb): drop the principal check from the items not implemented yet

* refactor(lambdaweb): find policy principals through IamService and the resolver's partition

IamService.heldPrincipalArn now gives the ARN IAM holds what a principal
ARN names under, the root as given or the role or user at its own path.
DSQL's principal check and Lambda Web's use it, and Lambda Web keeps only
the path comparison and its messages. Lambda Web takes the partition from
RegionResolver.partitionForRegion, so a custom region falls back to the
deployment's partition.
2026-10-27 22:00:28 -04:00