Commit Graph
513 Commits
Author SHA1 Message Date
Mario Toffia fabcd6baf8 feat(iot): manage custom authorizers (#4826)
* test(iot): cover custom authorizer management against AWS

* feat(iot): manage custom authorizers

Serve CreateAuthorizer, DescribeAuthorizer, UpdateAuthorizer,
DeleteAuthorizer, ListAuthorizers, SetDefaultAuthorizer,
DescribeDefaultAuthorizer and ClearDefaultAuthorizer on the AWS REST-JSON
paths, with the validation, messages, defaults, key merge, delete rules,
ordering and paging measured against AWS. Authorizer ARNs are tagged
through the existing IoT tag routes. Authorizers are stored, not evaluated.

Closes #4821

* fix(iot): read authorizer public key PEM line by line like AWS

A key without its PEM header line, or with an indented or inline header, is not a valid RSA key, a header without its end line cannot convert, and text before the header is skipped, as measured on AWS.

* fix(iot): validate authorizer names like AWS, SetDefaultAuthorizer included

A name member reports every violated constraint in one message, the pattern first, and a missing one must not be null. SetDefaultAuthorizer validates authorizerName before the lookup, as measured on AWS.

* fix(iot): validate the authorizer name on describe, update and delete like AWS

DescribeAuthorizer, UpdateAuthorizer and DeleteAuthorizer now reject a malformed or overlong authorizerName path member with AWS's 400 InvalidRequestException messages instead of a 404, measured on eu-west-1.

* fix(iot): route tag calls to the authorizer service on the ARN resource

IotTagHandler matched ":authorizer/" anywhere in the ARN, so an ARN with that text outside the resource field reached the authorizer service and failed with a 500. It now routes on the parsed resource prefix, and any other IoT ARN goes through IotService as before.
2026-10-04 17:20:12 -04:00
Mario Toffia 2749cd6fcd feat(cognito): provision user group attachments (#4806)
* feat(cognito): provision user group attachments

Serve AWS::Cognito::UserPoolUserToGroupAttachment through a new per-service
provisioner. Ref is <UserPoolId>|<GroupName>|<Username>, as measured on AWS.
Every property is createOnly, so a change replaces the membership and the old
one is removed in cleanup; delete tolerates a membership that is already gone.

* test(cognito): read stack outputs with XmlPath

* fix(cognito): attach users to groups from their recorded parts, as AWS does

* test(cognito): cover pipe group names and alias updates, delete seeded pools

* fix(cognito): remove an unrecorded attachment named unambiguously by its id

* test(cognito): pin that a failed rollback keeps the replacement's recorded parts

* fix(docker): finish a failed tar copy's writer before retrying

* test(docker): wait for each attempt's tar writer instead of racing it

Restores RetryingTarCopier.copyStreamed to its state on main: joining a failed attempt's writer could block on a writer stalled outside the pipe.

* docs(cloudformation): note the no-op delete of a short membership id

The class Javadoc said an unrecorded id that does not split into exactly three parts is refused. An id of fewer parts names no membership and its delete does nothing; only more parts is refused.

* fix(cloudformation): keep __Floci attributes out of Fn::GetAtt

Provisioners keep private state under __Floci attribute keys. Fn::GetAtt and Fn::Sub resolved them like any attribute, so a template could read, for example, an attachment's recorded pool, group and username, while AWS resolves no such attribute. They now resolve as unresolved, like any attribute a type does not have.

* docs(cloudformation): note that custom resource Data keys under __Floci are reserved
2026-10-04 17:00:35 -04:00
Vũ Thế Huy 99a6b4050c feat(redshift-serverless): add running workgroups and Data API WorkgroupName support (#5012)
* feat(redshift-serverless): add running workgroups and Data API WorkgroupName support

Redshift Serverless workgroups get full CRUD (Create/Get/List/Update/Delete),
tagging by ARN, and the AWS::RedshiftServerless::Namespace and ::Workgroup
CloudFormation types with dotted Fn::GetAtt keys taken from the registry
schema. A namespace has at most one workgroup, and DeleteNamespace is refused
while one is attached.

Each workgroup runs a PostgreSQL container behind an authenticating proxy,
sharing the managers and the proxy port pool with provisioned Redshift. Add
GetCredentials, accept WorkgroupName (name or ARN) in the Redshift Data API,
and push a changed namespace adminUserPassword down to the running backend.
The runtime is re-attached when Floci restarts.

Not covered: snapshots, usage limits, endpoint access, and COPY/UNLOAD/Spectrum
on workgroups.

* fix(redshift-serverless): stop the runtime when workgroup creation fails after it started

If persisting the workgroup record failed after the container and proxy were
already running, the runtime was left behind with no record. createWorkgroup
now stops it (best effort) and releases the endpoint on the failure path.

Fix the CloudFormation error for a NamespaceName change: suggesting a new
WorkgroupName can never succeed because a namespace holds only one workgroup.

* fix(redshift-serverless): reset omitted CloudFormation properties and order startup observers

When UpdateStack drops a property from the template, the provisioner now sends
its default (BaseCapacity, EnhancedVpcRouting, PubliclyAccessible, Port,
TrackName, PricePerformanceTarget) instead of keeping the stored value, which
matches CloudFormation semantics. MaxCapacity has no default and keeps its
stored value.

Give the workgroup StartupEvent observer a @Priority after RedshiftService so
every persisted cluster has reserved its proxy port before workgroups restore
theirs.

Also remove an unused import and move DEFAULT_DATABASE to the top of
RedshiftContainerManager.

* fix(redshift-serverless): address review findings on password rotation and namespace updates

- Roll the backend password back when a rotation cannot be completed or stored, and apply
  it last so validation failures never leave the backend ahead of the stored namespace.
- Keep a workgroup endpoint reserved when its runtime cannot be stopped during clear().
- Reject an in-place DbName change in CloudFormation, since it is fixed at creation.
- Reset an omitted KmsKeyId and DefaultIamRoleArn on CloudFormation updates.

* fix(redshift-serverless): keep rollback failures from masking errors and drop stale GetAtt role

- Do not reset the proxy password when the role restore fails, and attach restore
  failures to the original exception instead of replacing it.
- Remove Namespace.DefaultIamRoleArn from the stack resource when an update no
  longer declares a default role.

* docs: correct the Redshift Serverless operation count in the service matrix

* fix(redshift-serverless): expose Workgroup.ConfigParameters through Fn::GetAtt

* fix(redshift-serverless): parse ConfigParameters resolved from a GetAtt attribute

* docs(redshift-serverless): list every unsupported operation group
2026-10-04 15:34:24 -04:00
Mario Toffia 66f04cde25 feat(eventbridge): provision AWS::Events::Archive (#4818)
* fix(eventbridge): make UpdateArchive a partial update

UpdateArchive reset the event pattern to null and the retention to 0
whenever a request omitted them. On AWS an omitted Description,
EventPattern or RetentionDays keeps the stored value, an empty
Description or EventPattern clears it, and RetentionDays 0 sets 0.

* feat(eventbridge): provision AWS::Events::Archive

CloudFormation stubbed AWS::Events::Archive with a fake ARN and created
nothing. EventsArchiveCfnProvisioner now creates a real archive through
EventBridgeService.

Ref is the archive name and Fn::GetAtt Arn the archive ARN. ArchiveName
is generated when omitted and kept across updates. Description,
EventPattern and RetentionDays update in place, sending only the
properties the template declares, and a failed stack update restores
them from a snapshot. Changing SourceArn or ArchiveName, or dropping an
explicit name, replaces the archive and deletes the displaced one once
the update commits. A replacement that keeps an explicit name is refused
with CloudFormation's custom-named resource error before any change.
KmsKeyIdentifier is ignored.

Closes #4815

* fix(eventbridge): reject an archive source that is not an existing bus of the account and region

CreateArchive now checks EventSourceArn as AWS does, before the archive
name: a bus in another account fails with AccessDeniedException, one in
another region with ValidationException, and a bus that does not exist
with ResourceNotFoundException. The AWS::Events::Archive provisioner goes
through the same service call, so a stack can no longer reach
CREATE_COMPLETE with an archive that could never capture an event.

* test(eventbridge): roll back an in-place archive update when a later resource fails

A stack update changes an archive's description and retention in place,
then fails on a second archive whose source bus does not exist. The stack
ends UPDATE_ROLLBACK_COMPLETE, DescribeArchive shows the original values
and the second archive was never created. The golden case passes on AWS
and is mirrored in the Floci integration test.

* fix(cloudformation): refuse declaring a generated archive name explicitly

Adding ArchiveName with the name CloudFormation generated for an unnamed
archive asks AWS to replace the archive under the same custom name, which
it refuses with the custom-named resource error and rolls the stack back.
Floci took the in-place path and reached UPDATE_COMPLETE; the existing
refusal now also fires when the previous name was generated.

* fix(cloudformation): provision a real archive when updating a stack whose archive was stubbed

A stack created before AWS::Events::Archive had a provisioner holds the dispatcher's stub, whose physical id names no archive. Its next update now creates the archive instead of failing to describe that id, and the stub id is left to the replacement cleanup.

* fix(eventbridge): validate archive description, pattern and retention as CreateArchive and UpdateArchive do

CreateArchive and UpdateArchive now reject a description over 512 characters, an event pattern over 4096 characters and a negative retention with the ValidationException AWS returns, all violations reported together. The check runs before the source, existence and duplicate checks, so it also fails the AWS::Events::Archive resource in a stack.
2026-10-04 13:39:49 -04:00
Priamo Germosen fe296fda69 feat(iam): model SSH public keys (#5051)
UploadSSHPublicKey, GetSSHPublicKey, ListSSHPublicKeys, UpdateSSHPublicKey
and DeleteSSHPublicKey, stored per user with the documented quota of five.

AWS accepts the body in ssh-rsa form or as PEM, so both are read, and the
body is kept exactly as it arrived: a caller that uploaded PEM gets that PEM
back rather than a re-encoding. GetSSHPublicKey converts, because Encoding is
required and decides the form of the response.

Fingerprint is the MD5 of the OpenSSH blob, confirmed by reproducing the
worked example in the IAM API Reference rather than assumed. It is not the
digest EC2 reports for the same key, which is taken over the DER: both are
sixteen bytes of colon hex, so the wrong one would look right.

The two rejection errors are kept apart the way the model separates them. A
body in neither accepted encoding is UnrecognizedPublicKeyEncoding; one in a
recognised encoding that will not parse, or that carries a key type other
than ssh-rsa, is InvalidPublicKey. An OpenSSH line is recognised by its
key-type token rather than by whether part of it base64-decodes, since a
short word often does.

DuplicateSSHPublicKey is per user, unlike the account-wide rule for signing
certificates, and compares fingerprints so the same key in the other
encoding still counts. A key blocks DeleteUser until removed and follows the
user across an UpdateUser rename, both under a lock taken in the same order
DeleteUser takes it.
2026-10-04 10:37:38 -05:00
TATSUNO “Taz” Yasuhiro ace5cbfc63 chore(style): replace var in more files no open PR touches (#5071)
* chore: replace var with explicit types in src/main files no open PR touches

* chore: replace var with explicit types in src/test files no open PR touches

* chore: replace var with explicit types in sdk-test-java files no open PR touches
2026-10-04 10:08:48 -05:00
David 82977a7f03 feat(emr): resize instance groups and fleets, list bootstrap actions (#4900) 2026-10-04 09:52:41 -04:00
Vũ Thế Huy 06ceec2aee feat(redshift): materialize Glue external tables into PostgreSQL (#4996)
* feat(redshift): materialize Glue external tables into PostgreSQL

Add ExternalTableMaterializer, which loads a Glue-backed external table
into the cluster's PostgreSQL through a staging table, plus
SpectrumCatalogResolver (Glue binding first, phase-one catalog as a
fallback) and SpectrumGlueCsvAdapter (simple CSV tables keep the
streaming path and need no floci-duck sidecar).

The bound IAM role is enforced for every S3 object read, including
Iceberg metadata, manifests and data files, before DuckDB sees them.
SpectrumS3Reader now reads through the role as well, so a phase-one
external schema needs a real role associated with the cluster.

Spectrum semantics: hidden files and folder markers are ignored, a
partitioned table without registered partitions returns no rows, and a
sized string value wider than its column in bytes becomes NULL.

Also: PartitionProjection accepts IN lists for injected columns and
checks each table alias, S3Service hides the Spectrum scratch bucket from
ListBuckets, S3TransferException becomes public, and
FLOCI_SERVICES_REDSHIFT_SPECTRUM_MAX_ROWS is added.

* fix(redshift): harden external table loads against review findings

- A session outside a transaction waits for a slow load instead of
  failing after 30 seconds; only a session in a transaction keeps the
  timeout, since it can hold a PostgreSQL lock the Java lock cannot see.
- A missing S3 bucket is reported as XX000, not as access denied.
- A load failure goes to the log with its cause and returns a generic
  message, because the cause can carry DuckDB request text.
- The partition fingerprint includes input format and SerDe, so a format
  change at the same location reloads the table.
- A partition value wider than its sized string key becomes NULL, as a
  data column does, instead of failing the whole load.
- The first load of an account removes scratch objects left by a JVM
  that died mid-load, keeping those younger than an hour.
- Document why the phase-one reader enforces the role without the
  cluster association check.

* fix(redshift): use a real IAM role in the Spectrum compat test

The external schema now enforces its IAM role, so the compat test needs a
role that exists, trusts redshift.amazonaws.com and is associated with the
cluster. Create it through the IAM SDK client, pass it to CreateCluster and
delete it in the cleanup.

* fix(redshift): address review findings on the external table materializer

- PartitionProjection: a table name must end at an identifier boundary, comma
  separated sources are checked like FROM and JOIN sources, an unqualified
  injected column is accepted when exactly one source declares it, and a
  constant may be wrapped in parentheses.
- The partition fingerprint covers the whole descriptor (columns, formats,
  SerDe and parameters), and an Iceberg table is read on every query because
  its snapshot can change without any visible change to the Glue table.
- A transactional load that keeps the committed columns keeps the schema
  signature, so a view that depends on the table can still be refilled.
- Files under a hidden folder such as _temporary are ignored, not only
  hidden file names.
- The scratch bucket is told apart from a user bucket of the same name by a
  tag: a user bucket is listed, never written to, and never swept.
- Drop the SPECTRUM_MAX_ROWS row from the docs until routing makes the cap
  reachable.

* fix(redshift): verify slow-load wait with timeout
2026-10-04 09:20:44 -04:00
Hector Ventura fde5170335 test(compat): take the partition and region from TestFixtures in the last 33 suites (#5052)
Third and last batch of the cn-north-1 allowlist burn-down (#4272). The 41
remaining entries all pinned commercial values: ARNs built as
arn:aws:<svc>:us-east-1:..., arn:aws: prefix assertions, us-east-1 zones,
hosts and filter strings, and clients or signers created for us-east-1
next to the cn-north-1 fixture clients. Among them, the RDS IAM-token tests
signed their tokens for us-east-1, OrganizationsTest built its invited
account's client for us-east-1, Route53Test associated VPCs as us-east-1
that live in the fixture region, and SesEventPublishingTest failed in setup
on a us-east-1 event bus ARN.

All 33 classes now derive those values from TestFixtures, so the allowlist
is empty: any failure in the China nightly fails the run.
2026-10-03 23:46:21 -04:00
Hector Ventura 7ff3363899 test(compat): run the Marketplace Entitlement and Agreement tests in every region Floci serves (#5050)
Since #5028 Floci serves Entitlement in us-east-1, cn-northwest-1 and
eusc-de-east-1, and Agreement in us-east-1, the three ISO regions and
eusc-de-east-1. The compat guards still skipped both tests outside
us-east-1; they now take the same region sets, so a run in those regions
exercises the wider support.
2026-10-03 23:17:05 -04:00
Kenshin Okinaka 3e81b24c9b chore(compat): bump the pinned AWS SDKs for the compatibility suites (#5037)
The SES v2 model release of 2026-09-29 moved ListEmailIdentities to
POST /v2/email/list-identities and ListConfigurationSets to
POST /v2/email/list-configuration-sets, each with a new Filter member.
Floci now serves both bindings, so the suites can move to SDKs that
send the new ones.

Java moves 2.55.3 to 2.55.11 and Python 1.43.100 to 1.43.108, the
current releases of each.
2026-10-03 21:05:41 -05:00
Abhigya ae3adfe992 fix(apigateway): validate and cache REST Lambda authorizers (#5002)
* fix: evaluate and cache REST Lambda authorizer policies

* fix: share REST request context and complete parameter mappings

* fix: prevent stale REST authorizer caching after stage flush

* fix: use valid authorizer policies in REST import tests

* chore: align API Gateway imports with repository style

* fix(apigateway): isolate authorizer contracts and validate cached identities

* chore(apigateway): align restored context code with style guide

* chore: order API Gateway SDK test imports
2026-10-03 21:54:36 -04:00
Hector Ventura 6deb0d4d2b test(compat): run the China-absent tests per partition instead of allowlisting them (#5027)
* test(compat): run the China-absent tests per partition instead of allowlisting them

Third batch of the cn-north-1 allowlist burn-down (#4272): the 13 tests that
exercised something AWS does not offer in China. Seven keep running there
with the China shape:

- S3Test: only the us-east-1 endpoint creates a bucket in another region, so
  elsewhere the location-constraint round trip names the client's own region.
- StsTest: the SAML assertion's Recipient is the partition's console sign-on
  URL (the CDK region facts), signin.amazonaws.cn in China.
- Ec2Tests: China names its interface endpoint services cn.com.amazonaws, so
  the S3 gateway and interface offerings are two services there.
- IamTest: GetAccountSummary reports GlobalEndpointTokenVersion only in the
  commercial partition, the one with a global STS endpoint.

Six skip where the service has no endpoint: the five Marketplace tests (the
regions botocore publishes for each) and Lightsail (commercial only).

The allowlist's China-absent section is gone, 13 entries, 73 to 60.

* test(compat): derive VPC endpoint names from the DNS suffix and keep Marketplace guards to us-east-1

The ECR interface service is named under the partition's DNS suffix reversed
in every China, EUSC and ISO region (eu.amazonaws, gov.ic.c2s, ...), not only
in China, so describeVpcEndpointServices now takes that prefix from the SDK's
partition metadata. S3 keeps the China-only split, the only regions where
AWS lists it.

Floci serves Marketplace Agreement and Entitlement only in us-east-1, so
their guards no longer admit the other regions AWS runs them in; widening
both is a separate change.
2026-10-03 17:53:57 -04:00
Priamo Germosen 290f952cb1 feat(iam): model signing certificates (#5024)
UploadSigningCertificate, ListSigningCertificates, UpdateSigningCertificate
and DeleteSigningCertificate, stored per user with the documented quota of
two and account-wide duplicate detection compared on the encoded form.

The body is parsed on upload, because MalformedCertificate cannot be
answered without reading it. Status accepts Active, Inactive and Expired:
the API Reference gives all three as valid values even though the
parameter's prose explains only the first two. UserName is optional on
every operation and resolves from the access key that signed the request.

A certificate blocks DeleteUser until it is removed, which AWS lists as a
prerequisite, and follows the user across an UpdateUser rename rather than
being stranded on a name that no longer exists. The credential report's
cert_1 and cert_2 columns are backed by the store instead of always
reporting FALSE, reporting N/A for the rotation date unless the
certificate is Active, as the User Guide defines them.
2026-10-03 15:46:37 -05:00
Mario Toffia ae0a591bb1 feat(cognito): provision user pool users (#4805)
* feat(cognito): provision user pool users

Add a CloudFormation provisioner for AWS::Cognito::UserPoolUser. Ref is the
username Cognito reports (the sub in an email-as-username pool). Every property
is createOnly: a changed custom-named user is refused as on AWS, any other change
replaces the user, and each delete targets the pool the user was created in.

* fix(cognito): refuse a RESEND user pool user that already exists

* fix(cognito): keep the user's pool out of Fn::GetAtt

* fix(cognito): keep only owed users in the pool record
2026-10-03 15:15:50 -05:00
TATSUNO “Taz” Yasuhiro bdab4448d6 perf(kms): drop unused BouncyCastle curves from the native image (#4868)
* perf(kms): build the KMS curves directly so unused BouncyCastle curves leave the native image

Any BouncyCastle named curve lookup reaches every curve the tables know,
including the binary SecT curves. BcEcKeys now builds the five curves KMS
uses from their own BouncyCastle classes and encodes keys itself, in the same
DER layout as before. RsaKeyType builds the PSS signer's key parameters from
the JDK key instead of going through BouncyCastle's key factories.

* test(compat): cover the KMS key paths that call BouncyCastle directly

secp256k1 signing, EC key import for every curve, and RSA PSS digest signing
had no test in the suite that runs against the native image.

* chore(kms): note where each curve generator comes from
2026-10-03 15:05:07 -05:00
Mario Toffia 9e178d77a0 feat(wafv2): provision web ACL associations (#4804)
* feat(wafv2): provision web ACL associations

WafV2CfnProvisioner now serves AWS::WAFv2::WebACLAssociation with Ref
ResourceArn|WebACLArn, as measured on AWS. Any property change replaces
the pair through ReplacementCleanup. Delete disassociates only while the
resource still uses that ACL, so cleanup of an old pair keeps the new one.
Rollback re-associates the restored pair.

* test(wafv2): cover ResourceArn replacement and read stack outputs with XmlPath
2026-10-03 15:01:18 -05:00
Hector Ventura dfe2117fed test(compat): take the partition and region from TestFixtures in five more suites (#5025)
Second batch of the cn-north-1 allowlist burn-down (#4272). These tests pinned
the commercial partition, so they failed against a China deployment for the
test's own reasons, not Floci's:

- AppSyncTest asserted the arn:aws:appsync: prefix on four ARNs.
- Ec2DescribeSpotPriceHistoryTest filtered on us-east-1a and us-east-1b.
- PipesTest built its role, SQS and Kinesis ARNs in arn:aws and us-east-1.
- IamTest looked its user up by an arn:aws ARN; its AWS managed-policy prefix
  and the SimulatePrincipalPolicy source now follow the partition too.
- CloudWatchLogsMetricFilterTest replaced the recorded @aws.region dimension
  with us-east-1, and MetricFilterQueryAssertions signed its Query request for
  us-east-1, so it read another region's metrics.

All now derive the partition and region from TestFixtures. The allowlist drops
19 entries, from 73 to 54.
2026-10-03 15:54:55 -04:00
David 9c49ecf255 feat(rds): restore DB instances and clusters to a point in time (#4963)
Serve RestoreDBInstanceToPointInTime and RestoreDBClusterToPointInTime,
and report the restorable window: LatestRestorableTime on
DescribeDBInstances, EarliestRestorableTime and LatestRestorableTime on
DescribeDBClusters.

Requests are checked as the API reference describes: exactly one of
RestoreTime (RestoreToTime) and UseLatestRestorableTime, a time inside
the window or InvalidRestoreFault, PointInTimeRestoreNotEnabled for an
instance with backups off, and exactly one source. An instance source is
named by identifier or DbiResourceId, a cluster source by identifier, ARN
or DbClusterResourceId; automated backups ARNs answer
DBInstanceAutomatedBackupNotFound since no automated backups are kept.

Floci keeps no transaction log, so the target is seeded from a
pg_dumpall of the source taken when the request arrives, as read
replicas are. The restored data is the source's latest state for any
time in the window, and LatestRestorableTime is the current time. Only
PostgreSQL sources are accepted, as for CreateDBSnapshot.

Closes #4952
2026-10-03 15:43:02 -04:00
TATSUNO “Taz” Yasuhiro 823f8751de feat(lambda): store DurableConfig on functions (execution later) (#5007)
* feat(lambda): accept and echo DurableConfig on functions

CreateFunction and UpdateFunctionConfiguration take DurableConfig, PublishVersion snapshots it, and every read echoes it. ExecutionTimeout is required on create, RetentionPeriodInDays defaults to 14, a durable function's Timeout defaults to min(ExecutionTimeout, 900) and its logging to JSON. Update merges the members, and a function created without DurableConfig cannot gain one. KMSKeyArn is validated against its pattern and stored, the key itself is not looked up.

* chore(lambda): trim the DurableConfig tests to one case per rule

* feat(lambda): durable functions log in JSON format only

A durable function rejects LogFormat Text on create and update, and a LoggingConfig without LogFormat reads back as JSON. An empty KMSKeyArn means no key.

* chore(lambda): let the logging helpers own the durable JSON rule

validateLoggingConfig and applyLoggingConfig take the durable flag, so a durable function's default format and the Text rejection live in one place and a LoggingConfig without LogFormat keeps its log levels. applyDurableConfig sets the retention default and merges, and the test uses chainable helpers.

* chore(lambda): say why the durable compat test ignores a failed cleanup
2026-10-03 14:35:12 -05:00
Aniket Shukla ba944df922 fix(cloudformation): resolve change sets by ARN without stack name (#4885)
* fix(cloudformation): resolve change sets by ARN without stack name

* test(cloudformation): verify change set ARN execution with SDK

* test(cloudformation): wait for change set execution status

* fix(cloudformation): tighten change set ARN validation tests
2026-10-03 15:25:07 -04:00
Hector Ventura fa30cd7834 test(compat): take the partition and region from TestFixtures in SES and SSO Admin tests (#5017)
* test(compat): take the partition and region from TestFixtures in SES and SSO Admin tests

The cn-north-1 nightly allowlists 25 cases in SesTagResourceTest,
SsoAdminAccountAssignmentTest and SesConfigurationSetEventDestinationTest
that fail only because the tests pin commercial values: ARNs built as
arn:aws:<svc>:us-east-1:..., the arn:aws: AWS-owned SSO application
provider and managed policies, and a us-east-1 primaryRegion. Floci answers
correctly in China.

TestFixtures gains region(), partition() (from the SDK's region metadata)
and arn()/globalArn() builders, and the three classes use them. The
rejected-bus cases move from @CsvSource, which only takes constants, to a
@MethodSource whose mismatched-region bus is another region of the fixture
partition. The 25 entries leave the allowlist (98 to 73). Part of BL-020.

* test(compat): keep the SES bus rejection cases running in a single-region partition

Greptile on #5017: the method source threw when the fixture partition has no
second region (aws-eusc and aws-iso-e list one), so the custom-bus and
mismatched-account cases, which need no second region, never ran there. The
other region is now optional: the two cases always run, and only the
mismatched-region case is left out of a single-region partition.
2026-10-03 14:12:29 -04:00
vamsiakandVamsi Akavarapu a18aa246d3 fix(eventbridge): preserve target role ARN configuration (#4946)
* fix(eventbridge): preserve target role ARN configuration

* fix(eventbridge): handle stored targets without an ARN

---------

Co-authored-by: Vamsi Akavarapu <16164447+vamsiak@users.noreply.github.com>
2026-10-03 09:42:03 -04:00
Priamo Germosen d0c7c23f6b feat(iam): model server certificates (#4975)
Replace the ListServerCertificates stub with the server-certificate
lifecycle: UploadServerCertificate, GetServerCertificate,
UpdateServerCertificate, DeleteServerCertificate, ListServerCertificates
and the tag operations.

The uploaded material is really parsed, because two of the upload's
modeled errors cannot be answered otherwise. CertificateBody, and every
certificate in CertificateChain rather than only its first block, must be
readable PEM or the upload is MalformedCertificate; the private key must
match the certificate's public key or it is KeyPairMismatch. The match is
a sign-then-verify check, so it holds for RSA and EC alike. All of it goes
through core.common.Pem rather than a second copy of the parsing.

Expiration is read from the certificate's own notAfter rather than stored
separately, so it cannot drift from what it describes. ServerCertificateId
uses AWS's ASCA prefix. The private key is stored and never returned: AWS
marks privateKeyType sensitive and models it only on the upload, so
neither reader echoes it back, and ListServerCertificates returns metadata
only as AWS documents.

Request shapes are enforced from the wire model: the 16384-character caps
on the body and key, the much larger 2097152 cap on the chain, and the
per-account quota of 20 that the User Guide's table publishes, counted
under the same lock as the write. A rename that only changes case is
allowed, excluding the certificate from its own duplicate check by id the
way updateUser does.

GetAccountSummary's ServerCertificates count is now backed by the store
instead of a hardcoded zero.

ResourceArnBuilder gains an iam case naming the certificate an operation
targets, so a policy statement scoped to one certificate constrains it
under enforcement. Every other IAM action still resolves to *, which is
long-standing behaviour rather than something this adds; documented in
docs/services/iam.md and tracked in #4979.

DeleteServerCertificate does not raise the in-use DeleteConflict AWS
returns when a load balancer still references the certificate. Floci
cannot determine that yet, because ELB Classic and CloudFront store
certificate identifiers without resolving them against IAM. Documented,
and tracked in #4875.
2026-10-02 23:51:47 -05:00
Vũ Thế Huy 543f01618f fix(ecr): support image scanning configuration updates (#4928)
* fix(ecr): support image scanning configuration updates

* fix(ecr): validate scanning configuration booleans

* fix(ecr): accept null scan-on-push values

* docs(ecr): list the image scanning configuration actions

Add PutImageScanningConfiguration and BatchGetRepositoryScanningConfiguration
to the Supported Actions table. The table is not generated, so the docs check
does not catch a missing row.
2026-10-03 00:01:40 -04:00
Kenshin Okinaka ef9ed50742 feat(ses): apply the ListContacts filter (#4981)
* feat(ses): apply the ListContacts filter

ListContacts now honours Filter.FilteredStatus and Filter.TopicFilter the way
SES v2 matches them, with the validation messages and precedence SES answers.
The filter is applied before the page is cut, so filtered pages are exact,
and a token stays a position in the list, as on SES, rather than being bound
to the filter.

* test(ses): name the filter unit test SesContactFilterServiceTest
2026-10-02 20:32:49 -04:00
TATSUNO “Taz” Yasuhiro 4e842a85aa chore(style): replace var in files no open PR touches (#4789)
* chore(style): replace var with explicit types in src/main

Drop the NoVar suppressions of the src/main files that no open PR touches.

* chore(style): replace var with explicit types in src/test

Drop the NoVar suppressions of the src/test files that no open PR touches.

* chore(style): replace var with explicit types in sdk-test-java

Drop the NoVar suppressions of the compatibility test files that no open PR touches.
2026-10-02 17:45:36 -05:00
Kenshin Okinaka bb3dd2de92 feat(ses): paginate the contact, dedicated IP pool, suppressed destination and receipt rule set lists (#4877)
* feat(ses): paginate the contact, dedicated IP pool, suppressed destination and receipt rule set lists

Page ListContactLists, ListContacts, ListDedicatedIpPools, GetDedicatedIps,
ListSuppressedDestinations and v1 ListReceiptRuleSets with the probed bounds
and messages. ListContacts serves 50 by default and receipt rule sets 100, the
figure the model documents; the lists whose default could not be measured
serve up to 1000. Where SES's own order is not stable Floci keeps the order
its unpaged lists already had. A suppressed-destination token is bound to the
reason filter and tenant it was taken with, as on SES.

* test(ses): isolate the contact paging compat test and cover v1 receipt rule set paging on the wire

The contact paging compatibility test cleared every contact list in the
account before and after it ran; it now runs as its own account and removes
only the list it created. A new integration test pages 101 receipt rule sets
through the Query API, where the earlier coverage only reached the service.

* docs(ses): note that SES lists receipt rule sets by name

Floci pages ListReceiptRuleSets in the creation order its unpaged list already
had; the paging paragraph now says SES lists them by name.
2026-10-02 17:10:06 -05:00
Attila Kis 5de9b0d6c1 fix(dynamodb): match the AWS shape of the Kinesis destination responses (#4917)
DisableKinesisStreamingDestination now returns EnableKinesisStreamingConfiguration
with the precision the destination still carries, like AWS does.
Drop DestinationStatusDescription from the Enable and Disable responses. AWS carries
that member on DescribeKinesisStreamingDestination only, where it stays.
Build both responses from one snapshot taken while the call runs, so a concurrent
call on the same destination cannot change the status this answer reports.
Add an SDK compatibility test, because the SDK parses the typed response members
that handcrafted HTTP cannot check.
Document that Enable and Disable report the precision too.
2026-10-02 13:39:34 -04:00
vamsiakandVamsi Akavarapu 3ce093f208 fix(scheduler): validate expressions and target role ARNs (#4561)
* fix(scheduler): validate expressions and target role ARNs

* fix(scheduler): keep persisted weekly schedules firing

* test(scheduler): use valid role ARNs in SDK error cases

* fix(scheduler): validate rate units and format constraint errors

* fix(scheduler): match AWS validation message details

* fix(scheduler): exempt quoted model pattern from partition scan

---------

Co-authored-by: Vamsi Akavarapu <16164447+vamsiak@users.noreply.github.com>
2026-10-02 13:28:09 -04:00
David 044c700d68 feat(emr): scaling and termination policies and block public access (#4893)
Serve PutManagedScalingPolicy, GetManagedScalingPolicy,
RemoveManagedScalingPolicy, PutAutoTerminationPolicy,
GetAutoTerminationPolicy, RemoveAutoTerminationPolicy,
PutAutoScalingPolicy, RemoveAutoScalingPolicy,
GetBlockPublicAccessConfiguration and PutBlockPublicAccessConfiguration.

The managed scaling and auto termination policies are stored on the
cluster and the automatic scaling policy on its instance group, as the
JSON given. RunJobFlow and AddInstanceGroups accept the same policies
instead of dropping them, and ListInstanceGroups reports an attached
automatic scaling policy. Validation follows the API model: ComputeLimits
members and minimum not above maximum, IdleTimeout 60 to 604800 seconds,
automatic scaling only on core and task groups, port ranges within 0 to
65535. Block public access is kept per account and Region and starts at
the AWS default (public rules blocked, port 22 permitted).

The cluster mutators are synchronized, since each reads, changes and
stores the whole cluster.

Refs #4888
2026-10-02 10:37:45 -04:00
Hector Ventura c800cc375e test(compat): keep the China nightly allowlist free of an order-dependent entry (#4891)
The first Partition Compatibility run (36963820252) went red on one stale
entry: SsoAdminAccountAssignmentTest#createInstanceQuotaUsesAwsSdk passed. It
only fails when OrganizationsTest#testFullLifecycle leaves its organization
behind, which made the caller the management account for every later test,
and that happened because the organization's own assertions, including the
arn:aws: one that fails in cn-north-1, ran before the try whose finally
deletes it.

The assertions now run inside the try, so the organization is deleted however
they end, and the stale entry is gone from the cn-north-1 allowlist. Part of
#4272.
2026-10-02 09:28:41 -04:00
Vũ Thế Huy 436c15ca38 fix(sts): reject AssumeRole for roles that do not exist (#4463)
* fix(sts): từ chối AssumeRole khi role không tồn tại trong IAM

AssumeRole trước đây cấp credential cho mọi role ARN, kể cả role chưa
từng được tạo (iam:GetRole trả NoSuchEntity). Giờ trả AccessDenied như
AWS, bất kể enforcement có bật hay không; trust policy vẫn chỉ được
đánh giá khi enforcement bật. Các test cũ assume role chưa tạo được sửa
để tạo role trước.

Closes #4392

* fix(sts): so sánh chính xác role ARN và cập nhật compatibility tests

- StsQueryHandler: kiểm tra roleArn khớp chính xác role.getArn() để tránh chấp nhận role cùng tên khác path

- StsQueryHandlerTest: đổi tham số helper sang IamRole thay vì Optional, bổ sung test case từ chối role khác path

- AssumeRoleTrustPolicyIntegrationTest: sửa Javadoc mô tả đúng hành vi từ chối unknown role

- Cập nhật compatibility tests (Java, Node, Python, AWS CLI) để tạo role trước khi assume và kiểm tra lỗi 403 khi role không tồn tại

* fix(sts): accept partition-correct role ARNs and strictly catch cleanup exceptions

- StsQueryHandler: match role ARN structurally using AwsArnUtils to admit valid noncommercial partition ARNs

- StsQueryHandler: preserve caller partition when generating assumedRoleArn

- StsTest, test_sts.py, sts.test.ts: only ignore NoSuchEntity/EntityAlreadyExists in cleanup, re-raising unexpected errors per AGENTS.md

- StsQueryHandlerTest, AssumeRoleTrustPolicyIntegrationTest: add unit and integration coverage for partition-correct role ARNs

* fix(sts): preserve role partition in resolved session caller ARN

* fix(sts): preserve stored role partition in assumed identity

* fix(sts): validate web identity role ARN

* fix(sts): require role existence in AssumeRoleWithWebIdentity and reuse path helpers

* fix(sts): keep IAM ARN partition behavior unchanged

* fix(sts): derive trust caller account from identity ARN

* fix(iam): migrate legacy credential reports by partition

* fix(iam): serialize legacy credential report migration

* test(iam): make credential report race deterministic

* fix(sts): address review feedback

* fix(sts): reuse IAM role path normalization
2026-10-01 13:18:07 -04:00
Kenshin Okinaka a22e65f993 feat(ses): paginate the tenant and import job lists (#4819)
* feat(ses): paginate the tenant and import job lists

Page ListTenants, ListTenantResources, ListResourceTenants and ListImportJobs
on the shared SES paging, each with its own token namespace, and delete
SesTenantService.validateListPaging. The tenant lists answer the probed SES
rules: PageSize 1 to 100 with the Smithy validation messages, an empty
NextToken refused with its Smithy message before the tenant or resource is
looked up, an unreadable token answered "Invalid Next Token", tenants listed
by name, a tenant's resources by ARN and a resource's tenants in association
order. ListImportJobs could not be probed and is modelled on the tenant lists,
keeping Floci's oldest-first order. Without a PageSize all four lists serve up
to 100, a Floci assumption where nothing could be measured.

* fix(ses): follow the probed order, aggregation and token binding on the tenant lists

A second probe of real SES showed three differences on ListTenantResources and
ListResourceTenants: the tenant or resource is looked up, and the filter
checked, before the page size and token; a page size outside the bound and an
empty NextToken are reported together in one validation message; and a token
is refused once the tenant, resource or filter changes. ListImportJobs, which
cannot be probed, follows the same rules. The service docs keep the per-list
paging detail and gain a paragraph for these four lists.
2026-10-01 13:10:03 -04:00
XuJian b2dd5665db fix(s3): validate notification destinations before storing configuration (#4747)
* fix(s3): validate notification destinations before storing configuration

* test(s3): consume validation events before POST notifications

* fix(s3): preserve bucket lifecycle during notification validation

* fix(s3): enforce SQS queue policies for notifications

* fix(s3): align notification validation with IAM enforcement

* fix(test): stub IAM config for S3 failure delivery

* fix(s3): validate cross-account SNS without test publish

* fix(sns): recognize legacy topics during destination validation

* docs(s3): describe cross-account notification validation

* fix(s3): skip cross-account SNS notification test publishes
2026-10-01 11:35:16 -04:00
Aymen JAMAAOUI bc2592e300 fix(ecs): send container logs to the awslogs group and stream from the task definition (#4808)
* fix(ecs): send container logs to the awslogs group and stream from the task definition

* fix(ecs): keep console output for containers without awslogs
2026-10-01 10:39:44 -04:00
Mario Toffia fa4d4663a2 feat(lambda): honour the Invoke Qualifier and wait between asynchronous retries as AWS does (#4733)
* feat(lambda): honour the Invoke Qualifier query parameter

* feat(lambda): wait between asynchronous retries as AWS does

A failed Event invocation now waits floci.services.lambda.async-retry-delay-seconds before its first retry and twice that before its second (default 60, matching AWS), capped at the event's remaining maximum age. The concurrency permit is held only for each attempt, and an emulator reset drops retries still waiting.

* test(lambda): prove asynchronous retries end to end

* docs(lambda): document asynchronous retry timing and the Invoke Qualifier

* fix(lambda): drop retries of deleted functions and tighten async retry edges

- Drop a pending asynchronous retry when its function (or version) was deleted.
- Decide expiry once, on the injected clock, when a retry is scheduled.
- Check the reset generation at routing, so no stale outcome is delivered.
- Restore upstream behavior when an attempt throws: stop retrying and route
  the previous result, or UnknownError when there is none.
- Harden tests: in-order permit release, deterministic reset, error types
  and an unqualified-ARN Qualifier case for Invoke.

* fix(lambda): drop a deleted function's pending events on every path

Replace the store lookup with a per-function deletion counter, captured
when the event is invoked and checked wherever an event is attempted or
routed. This covers the expiry path, which bypassed the old check, and a
delete-and-recreate of the same name during the wait, which the lookup
could not see. Verified against AWS that DeleteFunction drops pending
retries without delivering a record.

* fix(lambda): clear deletion counts before bumping the reset generation

An invoke between the two statements of clear() captured the new
generation with a stale deletion count and its event was dropped.
The expiry-path deletion test now drops inside the first attempt,
so it no longer races the one-second maximum event age.

* fix(lambda): keep deletion counts across a reset

Clearing them while the old generation was still current let a
deleted function's pending event see a zero count and be routed.
A reset now only bumps the generation, in one atomic step.

* fix(lambda): drop an Event invoke that races DeleteFunction

An Event invoke that resolved the function just before a concurrent
DeleteFunction could take its deletion-count snapshot after the delete
had already moved the count. The event then never looked stale, so the
deleted function could still be started and a failure record could
still reach its destination.

DeleteFunction now moves the deletion count only after the function has
left the store, and an Event invoke checks that the function is still in
the store after it takes its snapshot and before it queues the event.
Either the check sees the function gone and the invoke answers 202
without queueing anything, or the snapshot predates the count change and
the event is dropped as stale later.

* fix(lambda): validate the Invoke Qualifier query parameter

Invoke treated an empty or blank Qualifier as if none had been given
and ran $LATEST, and it passed a qualifier longer than 128 characters on
to the lookup, which answered 404. AWS rejects both with a 400.

A supplied Qualifier must now be 1 to 128 characters of letters,
digits, $, _ and -, or Invoke fails with ValidationException. The
controller reads the parameter from the raw query, because @QueryParam
reports a present but empty value as null and the check could not see
it.

* fix(lambda): stop pending events before a delete or reset removes state

DeleteFunction moved a function's deletion count only after it had
removed the function's code and store entry. A retry whose timer fired
in that gap still passed the staleness check, tried to start a function
with no code, and could deliver a failure record to its destination. An
attempt that finished in that gap could deliver its OnFailure record.
DeleteFunction now moves the count before it deletes anything, which
stops every queued or running event, and again after the store entry is
gone, which stops an Event invoke that read the count in between.

An emulator reset wiped storage before the executor's clear() moved the
reset generation, so a retry firing during the wipe could run or deliver
against half-cleared state. The executor now also moves the generation
in beforeReset(), which runs before the wipe. clear() still moves it, to
drop events accepted between the two.

* test(lambda): fix a doc comment and name the tolerated Docker ping failure

The class comment now reads "wait as they do on AWS". The Docker ping
check names its caught exception "expected" and says why returning
false is safe: the test is then skipped rather than failed.

* fix(lambda): count version and alias invokes against the function's reservation

Routing the Invoke Qualifier to a published version meant a qualified
invoke took its permit against the version's snapshot, which carries no
reservation, so a reserved concurrency of 0 on the function no longer
throttled it and a positive one stopped counting those invokes. The
name-qualified path (fn:1, fn:alias) already had the same gap.

Reserved concurrency is function-wide in AWS, so the executor now takes
the permit against the function's $LATEST record, which holds the
reservation. That covers direct Invoke with a Qualifier, qualified names
and ARNs, aliases, event source mappings and asynchronous retries alike.
It reads the stored record rather than the limiter's region registry
because event source pollers can invoke before LambdaService has
rehydrated that registry after a restart.

* fix(lambda): drop a deleted function's pending events before draining its containers

DeleteFunction drained the warm pool before fencing pending asynchronous
events, and draining blocks while idle containers stop. A retry whose
timer fired in that window still passed the staleness check and could
cold-start a container after the drain, leaving it warm for a function
that no longer exists. The fence now goes up first.
2026-10-01 10:00:47 -04:00
Priamo Germosen cf04f433b6 fix(iam): give a role session's aws:PrincipalArn as its role's ARN under enforcement (#4810)
Follow-up from the review of #4716.

The enforcement filter put the assumed-role session ARN
(arn:aws:sts::<account>:assumed-role/<role>/<session>) in aws:PrincipalArn for a
caller using role-session credentials. AWS puts the ARN of the role that was
assumed there, path included ("For IAM roles, the request context returns the
ARN of the role, not the ARN of the user that assumed the role", IAM User Guide,
global condition keys). So an identity or resource policy keyed on the role's
ARN never matched its sessions: an Allow scoped that way refused them and a Deny
written that way never fired, while a condition naming the session ARN, which
AWS says not to use for this key, matched.

The filter now reads both values from one lookup of the key, through a new
IamService.resolveCallerArns: the caller ARN, still the session ARN for a role
session, and the principal ARN, the role ARN the session recorded when it was
issued (#4716). A user's key and the account-root principal give the same value
for both. One lookup matters: two could straddle the session's expiry, answer
the first and not the second, and leave a fallback to fill aws:PrincipalArn
with the session ARN, so a Deny keyed on the role's ARN would miss.
resolveCallerArn and resolvePrincipalArn now read through it, and the STS trust
check, which made the same two lookups, uses it too. Both places the filter
fills the key (the request's own authorization and authorizeAdditionalResource)
take it from there. The session ARN stays the caller's principal for matching a
resource policy's Principal, which is a separate change.

docs/services/iam.md describes the key for role sessions and drops the caveat
about the session name, which no longer applies to it.

The integration test covers both paths: IAM calls whose policy is keyed on the
role's ARN, and an SSM GetParameter on a Secrets Manager reference, whose
secretsmanager:GetSecretValue check goes through authorizeAdditionalResource.
The SDK compatibility suite's IamEnforcementTest gets the same IAM checks with
AWS SDK clients; like the rest of that class it runs only against a Floci with
IAM enforcement on.
2026-10-01 07:50:19 -05:00
Mario Toffia 0a54d0708e feat(eventbridge): execute target retry and dead-letter policies (#4736)
* feat(eventbridge): execute target retry and dead-letter policies

PutTargets now validates, stores and returns a target's RetryPolicy and
DeadLetterConfig. Failed deliveries from PutEvents and scheduled rules are
retried with backoff within the configured attempts and event age, and
exhausted or non-retryable events are sent to the standard SQS dead-letter
queue with the AWS failure attributes.

* fix(eventbridge): order target retries by due time and honour a lowered retry limit

Pending retries are kept in a queue ordered by their next attempt, so each wake-up
takes only what is due instead of scanning every pending retry. The clock is read
again for each retry, so a slow target cannot let a later retry run past its event
age, and a reset mid-tick stops the remaining retries. A retry now checks the
target's current MaximumRetryAttempts before invoking it, as it already did for
MaximumEventAgeInSeconds.

* fix(eventbridge): drop a target retry that outlives a reset

An attempt still running when the emulator resets can fail afterwards. Its retry
or dead-letter delivery is now dropped, so a rule and target recreated under the
same names after the reset do not receive a pre-reset event. A scheduled retry
wake-up keeps only its due time, not the event.

* fix(eventbridge): wake a target retry at its due time after a slow attempt

The retry delay was measured from when the failed attempt started but counted from
when it failed, so every retry after a slow attempt woke late by the attempt's
duration, and an expired event reached its dead-letter queue late.

* fix(eventbridge): drop a removed target's retries and drive retries from one tick

RemoveTargets now drops the removed targets' pending retries, so a target re-added
under the same Id does not receive an event from before its removal. Pending retries
are taken by one periodic tick, as in the scheduler's dispatcher, instead of a timer
per retry, so a reset leaves no timers behind.

* fix(eventbridge): warn about a blank dead-letter queue ARN

PutTargets accepts a whitespace-only DeadLetterConfig Arn, since AWS constrains only
its length. Delivery skipped it without a word; it now gets the same WARN as any other
dead-letter queue that is not a standard SQS queue in the rule's region.
2026-10-01 07:59:18 -04:00
XuJian 75b56d49e2 fix(sqs): honor ReceiveMessage message attribute selectors (#4699)
* fix(sqs): honor ReceiveMessage message attribute selectors

* fix(sqs): match receive attribute checksum to selected fields

* test(sns): use the SQS Query message attribute selector

* fix(sqs): match message attribute prefix selectors
2026-10-01 07:17:20 -04:00
Hector Ventura ea06896984 test(compat): run the Java SDK suite nightly in cn-north-1 against an allowlist of known failures (#4790)
* test(compat): run the Java SDK suite nightly in cn-north-1 against an allowlist of known failures

Part of #4272 (P11). The partition work is covered by unit and integration
tests over all eight partitions, but nothing ran a real SDK whose own
partition logic (arn:aws-cn: ARNs, China signing scopes, the LocationConstraint
S3 CreateBucket sends) has to round-trip.

The Partition Compatibility workflow runs after each Nightly against the image
it published, or on dispatch with an image and region: Floci starts with
FLOCI_DEFAULT_REGION=cn-north-1 and sdk-test-java runs with AWS_REGION set,
which TestFixtures now reads (default us-east-1, so the per-PR legs are
unchanged). It runs once a night rather than per PR, to keep the shared runner
pools free.

compat-allowlist-check.py compares the JUnit results with
compat-partition-allowlist-<region>.txt and fails on a failure the list does
not name, on an entry that no longer fails, or on missing results, so the list
only shrinks. The cn-north-1 list holds the 112 failures measured locally on
main plus #4787: 96 tests that pin commercial ARNs, regions or zones, 13 that
exercise commercial-only behaviour, and 3 still to explain.

* test(compat): pin the nightly China run to its image's commit and catch an aborted suite

Greptile on #4790: the workflow checked out the Nightly run's head_sha but
pulled the mutable floci/floci:nightly tag, so the image and the tests could
come from different commits; it now pulls the image first and checks out the
commit in its org.opencontainers.image.revision label. And Maven exits
non-zero for allowlisted failures too, so a suite that stopped partway could
pass; the checker now takes --test-sources and requires a report for every
test class in that tree.

The cn-north-1 allowlist groups its entries by the verified cause: the RDS and
SSO portal entries are Floci bugs (an RdsService ownership check against the
literal partition "aws", and an arn:aws: seeded Identity Center instance),
and SsoAdminAccountAssignmentTest#createInstanceQuotaUsesAwsSdk passes alone
and fails only after OrganizationsTest leaves an organization behind.
2026-10-01 00:33:54 -04:00
Kenshin Okinaka ea41b775aa feat(ses): paginate the identity, configuration set and custom verification template lists (#4781)
* feat(ses): paginate the identity, configuration set and custom verification template lists

Move paging into the SES services, so each resource's cursor lives with its
list and the v1 and v2 operations of the same resource share it. Page
ListIdentities/ListEmailIdentities, ListConfigurationSets (v1 and v2) and
ListCustomVerificationEmailTemplates (v1 and v2) with the probed defaults,
bounds and messages: identities default to 25 on v2, configuration sets and
custom verification templates to 50, and a v1 page size outside the bound is
served the probed size instead of refused.

* fix(ses): refuse a list token replayed in another region

A list token carried only the resource kind and the cursor, so the same list
in another region read it as a position and could answer an empty last page.
Real SES refuses such a token with the operation's unreadable-token error
(probed on the identity and configuration-set lists), so the token namespace
now includes the region. The v1 and v2 lists of one resource still share
tokens within a region.
2026-09-30 23:29:35 -05:00
jwoa95 31038ee2a4 feat(cognito): add GetUserAuthFactors (#4764)
* feat(cognito): add GetUserAuthFactors

* fix(cognito): refuse access tokens with no scope claim where a scope is required

* fix(cognito): use AWS's message for a missing access-token scope
2026-09-30 21:45:10 -05:00
TATSUNO “Taz” Yasuhiro 7654a7cbec fix(appsync): supply reflection config so VTL runs on native image (#4729)
* test(appsync): run a VTL resolver in the native compatibility suite

AppSyncTest created and updated resolvers but never queried one, so no native test evaluated a VTL template. The new test runs a query whose templates touch everything VTL reaches through reflection: the #return directive, $ctx and the JDK maps, lists and strings behind it, each $util helper, and $util.error.

* fix(appsync): register what VTL reaches through reflection in the native image

Velocity loads the #return directive by class name and calls every template method through reflection. None of it was registered, so in the native image every AppSync mapping template failed. Register the directive, the $util helpers, and the JDK maps, lists and strings that $ctx, literals and $util results are made of.
2026-09-30 21:44:51 -05:00
Allen Sanborn 18128b432a fix(organizations): start a new root with no policy types enabled (#4756)
CreateOrganization (and EnableAllFeatures) seeded the root with
SERVICE_CONTROL_POLICY already ENABLED, so the first EnablePolicyType a
caller issues was rejected with PolicyTypeAlreadyEnabledException. That
is exactly what Terraform's aws_organizations_organization does with
enabled_policy_types right after CreateOrganization, so the common
"create the org and turn on SCPs" configuration failed at its first
resource.

On AWS a new root has an empty PolicyTypes list: the provider's
acceptance test for a plain organization asserts roots.0.policy_types
is empty, and its enabled_policy_types test enables SCPs on a fresh
organization successfully.

DescribeOrganization's AvailablePolicyTypes used to read the root's
list, which is what the seed was standing in for. It is now reported
separately and, as AWS documents for the deprecated field, lists only
SERVICE_CONTROL_POLICY for an ALL organization.

Tests that relied on the seed now call EnablePolicyType first, as a
real caller must. The CloudFormation test creates the stack without its
SCP, enables the type, then adds the SCP by UpdateStack, because no
CloudFormation resource enables a policy type.
2026-09-30 18:12:38 -04:00
mitsukado-shinagawaandmitsukado-shinagawa fd094aee05 fix(stepfunctions): return the PascalCase execution envelope from states:startExecution, .sync and .sync:2 (#4737)
AWS returns, as the Task result of the optimized states:startExecution
integration (measured in ap-northeast-1 on 2026-09-30):

- request-response: the StartExecution response, {ExecutionArn, StartDate},
  StartDate in epoch milliseconds
- .sync: the child's DescribeExecution response, PascalCase with its keys
  in alphabetical order, dates in epoch milliseconds, Input and Output as
  JSON strings
- .sync:2: the same envelope with Input and Output as JSON values

Floci returned camelCase with dates in seconds for the first two and the
child's output alone for .sync:2, so a state machine written against AWS
found nothing at $.Output, $.ExecutionArn or $.Status.

The failure cause of the two .sync modes already built this envelope
(#4675). It now builds the success result too: a SUCCEEDED child carries
Output, OutputDetails and RedriveStatusReason and reports NOT_REDRIVABLE.
Request-response returns the response TaskSubmitted already records.

This changes the result shape for state machines written against Floci's
earlier one: the child output of .sync:2 moves from $ to $.Output.

Closes #4723

Co-authored-by: mitsukado-shinagawa <mitsukado-shinagawa@users.noreply.github.com>
2026-09-30 10:14:12 -04:00
Langning Zhang d267ba3a9d fix(ses): validate EventBridge default bus ARNs (#4677)
* fix(ses): validate EventBridge default bus ARNs

Signed-off-by: boulea7 <zln1905391059@163.com>

* fix(ses): reject EventBridge bus account and Region mismatches

Signed-off-by: boulea7 <zln1905391059@163.com>

---------

Signed-off-by: boulea7 <zln1905391059@163.com>
2026-09-30 10:00:19 -04:00
David 5aad012e78 feat(emr-serverless): tag, untag and list tags for applications (#4667)
EMR Serverless had no tagging API: no TagHandler was registered for the
emr-serverless ARN service, so TagResource, UntagResource and
ListTagsForResource could not be routed, and a tagged
aws_emrserverless_application could not be planned.

Register an emr-serverless handler with the shared /tags dispatcher,
answering 200 as the model does, over the tags already stored on the
application. Validate keys and values, the user guide's 50 tag limit
and its reserved aws: prefix, refuse job run ARNs as not found, and
synchronize the application mutators so a tag write cannot lose a
concurrent update.

Closes #4662
2026-09-30 09:11:04 -04:00
Mario Toffia 560de5c13f fix(tagging): find resources by the tags their own service holds (#4563)
* fix(tagging): list resources by the tags their own service holds

GetResources, GetTagKeys and GetTagValues merge the tagging store with every
ResourceProvider, so SQS, Lambda and Logs tags are discoverable. Resource type
filters now parse colon and leading-slash ARNs (function:f, log-group:x, /apikeys/k),
and TagResources/UntagResources write through to the owning TagHandler.

* fix(apigateway): expose tagged resources and API key tags to the tagging API

ApiGatewayService is a ResourceProvider for REST APIs, stages, API keys, usage plans and
domain names, and ApiGatewayTagHandler serves /apikeys/<id> ARNs, so GetResources finds
API Gateway resources by tag and tagging-API writes land on the API key itself.

* fix(cloudformation): forward AWS::Lambda::Function Tags

CreateFunction now receives the template Tags; an in-place UpdateStack untags dropped keys and retags the desired set, mirroring SqsCfnProvisioner.

* fix(tagging): scope global-ARN resources by region and clamp stale page tokens

Provider resources with an empty ARN region use their own region, stale page tokens
past the end return an empty page, and provider tags are copied inside the skip guard.

* test(compat): discover SQS, Lambda, Logs and API Gateway resources by tag

* docs(tagging): describe owning-service discovery

* fix(tagging): forward tags only for resources the owning service lists

* fix(apigateway): report the calling account and tag usage plans

* docs(cloudformation): note Lambda tag reconciliation on update

* fix(tagging): match declared resource types and scope owner writes to the request

API Gateway API key and usage plan ARNs must now name the key or plan at the
start of the resource part, so a nested /apikeys/ segment no longer tags the key.

* fix(tagging): match AWS type filters, regions and failure codes

Compared against a live AWS account: type filters, IAM listing, cross-region
TagResources and FailedResourcesMap entries now answer as AWS does.

* fix(cloudformation): keep Lambda tags added outside the template

* fix(tagging): route TagResources to V1 tag handlers too

* fix(apigateway): reject sub-resource ARNs when tagging a REST API

* fix(tagging): write tagging API tags through to SQS, Lambda and Logs

TagResources and UntagResources now reach the queue, function or log group's own tags through TagHandler beans qualified @TaggingApiOnly, so ListQueueTags, Lambda ListTags and Logs ListTagsForResource show them. The qualifier keeps these handlers off the /tags/{arn} and /v1/tags/{arn} paths, since each service defines tags in its own protocol.

* fix(cloudformation): forward SSM parameter tags

AWS::SSM::Parameter now applies its Tags after the overwriting put. On UpdateStack only the keys the previous template set and the new one drops are removed, tracked in the internal FlociSsmTemplateTagKeys attribute, so tags added outside the template are kept.

* fix(tagging): hide tagging-store copies of global resources

GetResources no longer lists an IAM role or user tagged through TagResources, since AWS never lists global resources.

* fix(tagging): reject every wildcard log group ARN

TagResources and UntagResources now send a log group ARN ending in :* to CloudWatch Logs even when the group does not exist, so it is rejected as in AWS instead of stored.

* fix(tagging): clear store tags on every untag

UntagResources now removes the keys from the tagging store for every ARN, even one the owning service rejects, so a copy stored earlier can always be cleared.

* fix(cloudformation): tag an adopted Lambda function

When CreateFunction conflicts and the provisioner adopts the existing function, the template's tags are now applied to it.

* fix(apigateway): tag only exact domain and stage ARNs

A domain or stage segment nested elsewhere in an API Gateway ARN, such as /restapis/<id>/domainnames/<d>, is now rejected instead of tagging that domain or stage.

* fix(cloudformation): leave an adopted Lambda function's tags alone

Adoption uses the existing function as it is, as before, so a function outside the stack keeps its tags.

* fix(cloudformation): record no template tag keys for an adopted Lambda function

An adopted function keeps its own tags, so a later update adds the template's tags without removing any it never set.

* fix(tagging): never list IAM ARNs from the tagging store

A role tagged through TagResources stays hidden after DeleteRole, as AWS never lists IAM resources.

* fix(tagging): fail a write when an owning service cannot be read

A provider that fails while routing TagResources or UntagResources now returns InternalServiceException instead of writing the tagging store and reporting success.

* fix(tagging): fail only unresolved ARNs when a provider cannot be read

A provider failure no longer fails the whole TagResources or UntagResources call; only ARNs whose owner could not be resolved are reported in FailedResourcesMap.

* fix(tagging): report another account's ARN instead of storing it

TagResources and UntagResources report an ARN from another account in FailedResourcesMap with AccessDeniedException, as AWS reports it per ARN, and never write it to the tagging store.

* fix(tagging): keep stored tags for an ARN an untag could not resolve

UntagResources leaves the tagging store unchanged for an ARN it reports as unresolved or from another account; an ARN its owner rejected is still cleared.

* fix(tagging): fail an unresolved ARN only when its own service cannot be read

A provider failure now only affects unlisted ARNs of the services that provider declares.

* fix(tagging): copy stored tags under the writers' lock

GetResources, GetTagKeys and GetTagValues no longer race a concurrent TagResources on a stored mapping.

* fix(apigateway): reject reserved tags when tagging a usage plan

TagResources on a usage plan now refuses floci:override-id as the other API Gateway tag paths do, instead of dropping it and reporting success.

* fix(apigateway): reject tag ARNs with an account or another region

The /tags path now answers an ARN with an account segment with BadRequestException and one naming another region with NotFoundException, as AWS does, instead of resolving the id in the caller's region.

* fix(ssm,lambda): reject tag keys outside the AWS pattern

AddTagsToResource, PutParameter, TagResource and CreateFunction now reject a tag key outside the AWS pattern or 1 to 128 characters with ValidationException, as AWS does, which also keeps the CloudFormation managed-key attributes lossless.

* fix(ssm,lambda): validate CloudFormation tag keys before changing the resource

* docs(tagging): say every handled ARN ending in :* reaches its service

* fix(tagging): read a negative pagination token as the first page
2026-09-30 06:10:27 -04:00
Allen Sanborn 6b7d17698c fix(ec2): an interface VPC endpoint reports its network interfaces, and they resolve (#4598)
* fix(ec2): report an interface VPC endpoint's network interfaces

DescribeVpcEndpoints never emitted networkInterfaceIdSet, so an interface (PrivateLink)
endpoint came back with no interfaces at all. Terraform's aws_vpc_endpoint surfaces that
element as network_interface_ids, and modules feed the output downstream to
security-group rules, flow-log filters and DNS, so the empty list does not merely differ
from AWS: it propagates into whatever consumes it.

The interfaces already existed. Ec2Service.endpointNetworkInterfaces derives one per
subnet deterministically, with a stable id, the subnet's availability zone and
interfaceType vpc_endpoint, so flow-log generation can attribute AWS-service traffic to a
stable endpoint address. Nothing reported them on the wire.

So this adds a reader rather than a new resource. endpointNetworkInterfaceIds returns the
same ids that endpointNetworkInterfaces synthesizes, reusing endpointEniId, deliberately
derived instead of stored: a second, stored copy could disagree with the one flow-log
attribution reads, and then two answers would exist for one question. It mirrors the
existing endpointDnsEntries accessor, which the same XML writer already calls.

A Gateway endpoint is a route-table entry and owns no interfaces. AWS reports none for
one, and so does this: the element is omitted rather than emitted empty.

Ec2VpcEndpointNetworkInterfaceIdsIntegrationTest covers one interface per subnet with
distinct ids, the ids being stable across two DescribeVpcEndpoints calls (Terraform reads
them between plan and apply), a single-subnet endpoint reporting exactly one, and a
gateway endpoint reporting none. That last case is what stops a change that simply
emitted the set unconditionally from passing.

Verified by reverting the emission alone: 2 of the 3 tests fail, and the gateway case
correctly still passes. Restored, all 3 pass.

Ec2*Test is 1246 tests with 2 failures, both in Ec2VolumeBlockDeviceDockerIntegrationTest
(Docker block devices, mke2fs). Measured on a clean checkout of upstream/main with these
changes removed: the same 2 fail. Pre-existing and environment-specific, not from this
change.

* fix(ec2): reattach the DnsEntries javadoc to its own method

The previous commit inserted endpointNetworkInterfaceIds and its javadoc between the
endpointDnsEntries javadoc and endpointDnsEntries itself. Java binds a doc comment to the
next declaration, so that left two consecutive blocks on the new method -- the first
dangling, the second the real one -- and endpointDnsEntries documented by nothing.

Moving the new method above the DnsEntries javadoc restores that binding and puts the
accessor next to endpointEniId, the helper whose ids it returns. Comment placement only;
no behaviour changes.

Ec2VpcEndpointNetworkInterfaceIdsIntegrationTest: 3 tests, 0 failures.

* refactor(ec2): derive endpoint ENI ids from the interfaces, not beside them

Review found that the javadoc on endpointNetworkInterfaceIds asserted an invariant the
code did not have. It said the ids were derived from endpointNetworkInterfaces so a
second copy could not disagree with what flow-log attribution reads. They were not
derived from it: both called endpointEniId independently, and they filtered differently.
endpointNetworkInterfaces skips a subnet whose record has gone; the id method emitted one
for every entry of getSubnetIds() unconditionally.

The gap is reachable. deleteSubnet checks only for transit-gateway attachments, so
nothing stops a subnet being deleted out from under a live endpoint, and the two were
then measured reporting different sets -- two answers to one question, with flow-log
attribution reading the shorter. Real AWS answers DependencyViolation to that delete and
Terraform's graph destroys the endpoint first, so the state is reachable only in an
emulator. That is the argument for the emulator staying self-consistent in it, not
against.

Extracts endpointNetworkInterfacesOf(VpcEndpoint). The region-wide
endpointNetworkInterfaces(String) is now that method looped, and the id list is mapped
over it, so one copy of the subnet-existence filter serves both and congruence holds by
construction rather than by inspection.

A distinct NAME rather than an overload: endpointNetworkInterfaces(VpcEndpoint) beside
endpointNetworkInterfaces(String) makes a Mockito any() ambiguous, and
FlowLogServiceTest:31 already uses one. Caught by the compiler; a new method should not
make an existing test stop compiling.

Incidental saving: vpcEndpointXml called the region-wide scan once per endpoint in a
response, so DescribeVpcEndpoints was quadratic in subnet lookups. It no longer is.

THE TEST WAS DECORATIVE UNTIL IT WAS MEASURED. Its first draft compared the wire ids to
the service's list for an endpoint whose subnets all still existed -- a case where both
derivations trivially agree, and it passed against the buggy version. It now deletes a
subnet out from under the endpoint first. Verified both ways: it FAILS on the old
independent derivation and PASSES on this one.

Ec2VpcEndpoint*, FlowLogServiceTest, Ec2ServiceTest and Ec2NetworkInterfaceIntegrationTest:
1251 tests, the only failures being Ec2VolumeBlockDeviceDockerIntegrationTest's known 2
of 8 (Docker block devices, mke2fs), measured identically on a clean upstream/main
checkout.

Not addressed here, filed separately: the ids this publishes do not resolve through
DescribeNetworkInterfaces, which never consults endpointNetworkInterfaces. Real AWS
returns endpoint ENIs there as requester-managed with interfaceType vpc_endpoint. That
gap predates this branch; publishing ids makes it visible rather than creating it, and no
corpus module looks one up today.

* docs(ec2): narrow the congruence claim to what the code actually guarantees

Three findings from review of #21, none behavioural.

The javadoc said the wire ids are BY CONSTRUCTION "the interfaces flow-log attribution
reads". Within one account that is exact -- vpcEndpoints.scan and subnets.get share a
prefix and both stores are account-wrapped. But FlowLogService runs on a scheduler with
no request context, so it reads the default account while this path reads the caller's;
for a non-default account the flow-log side sees no endpoints at all. Each side stays
internally consistent, which IS the property the refactor established and the one worth
claiming. Both seeing the same endpoints is not, and the absolute phrasing claimed it.
Restated as shared derivation rather than shared view.

endpointNetworkInterfacesOf was public with no caller outside the class -- not in
Ec2QueryHandler, which calls endpointNetworkInterfaceIds, and not in any test. Every
sibling helper in the same block is private (endpointEniId, endpointDnsDiscriminator,
endpointServiceToken, endpointPrivateIp), so public was the outlier. Now private. The
javadoc's argument for the distinct NAME stands untouched; that was about the Mockito
ambiguity, not the visibility.

The same javadoc cited FlowLogServiceTest:31 for that ambiguity. The line is 44 on this
base, and a comment carrying a line number is wrong again at the next rebase, so it now
names the stub instead.

Also drops a stray backslash in "method\'s" that survived from the heredoc the comment
was written in.

* test(ec2): say what the gateway case actually catches, which is less than claimed

The class javadoc and the PR description both said the gateway assertion is "what stops a
change that simply emitted the set unconditionally from passing". It is not. The emission
is guarded by `if (!endpointEniIds.isEmpty())`; remove that guard and a gateway endpoint
gets an empty `<networkInterfaceIdSet/>`, whose `item` list is empty, so
`eniIdsOf(...).isEmpty()` still holds and the test still passes.

Found by review of #21. Third claim on this branch that asserted more than the code
delivered -- after the javadoc that claimed a congruence invariant the code lacked, and
the one that claimed both sides see the same endpoints across accounts.

Not fixed by tightening the assertion to pin absence, which was the obvious move and the
wrong one: real AWS emits the empty element where this omits it. Absent and empty are
indistinguishable to any ec2query SDK, and Terraform's TypeSet lands both as an empty set,
so the behaviour is fine -- but an assertion pinning absence would pin the side of that
choice further from AWS, and make a later move toward AWS look like a regression.

So the comment now states the limit instead. The case still earns its place as a
regression guard: a gateway endpoint must never report interface ids.

Also orders the new test's imports like the sibling SubnetConfiguration suite.

* fix(ec2): an endpoint on a subnet whose CIDR is not dotted IPv4 must still answer

Both findings from the Greptile review of #4598.

P1. endpointPrivateIp splits the subnet's CidrBlock on dots and reads parts[1] and
parts[2]. CreateSubnet calls setCidrBlock with whatever it was given and never validates
the address family, so the value is not guaranteed to be dotted IPv4 -- "2001:db8::/56"
splits to one element and parts[1] throws.

This PR is what makes that reachable from a request. Deriving an endpoint's interfaces
used to happen only on the flow-log scheduler, where a throw was contained; it now also
happens while rendering CreateVpcEndpoint and DescribeVpcEndpoints, so the same odd subnet
turns into a failed EC2 response rather than a degraded address. Measured, with the guard
removed:

  Unhandled error dispatching Query action CreateVpcEndpoint for service ec2:
  java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1

Falls back to the same default the existing null-CidrBlock branch already uses, so "no
usable IPv4" has one behaviour instead of two. Deliberately NOT fixed by validating in
CreateSubnet: rejecting a non-IPv4 CidrBlock is what AWS does and is probably right, but
it is a behaviour change with a wider blast radius than this PR should carry, and it would
not help an IPv6-only subnet, which legitimately has no IPv4 CIDR at all.

anEndpointOnASubnetWithoutIpv4StillAnswers is a regression guard and states so. Measured
both ways: it FAILS at CreateVpcEndpoint without the guard and PASSES with it. Reviewer
found the defect by reading; the test is what keeps it found.

P2. Import order -- io.restassured sorts before jakarta. I reordered the first two imports
in an earlier commit and did not notice the same rule applied further down the block.

Ec2VpcEndpoint* and FlowLogServiceTest: 52 tests, 0 failures.

* fix(ec2): the non-IPv4 fallback gave every subnet on an endpoint the same address

Second Greptile round on #4598, and a defect introduced by the fix for the first.

The crash fix fell back to a CONSTANT network, 172.31.0.0. The host octet is derived from
the ENDPOINT, so it is identical across that endpoint's interfaces; on the IPv4 path the
only thing making them distinct is each subnet supplying its own network. Collapsing the
network to a constant threw that away, so every non-IPv4 subnet on one endpoint got the
same private address -- a crash traded for a silent collision. Measured:

  got [172.31.0.249, 172.31.0.249]

The third octet now comes from the subnet id, restoring the property the IPv4 path has by
construction rather than by luck. The ENI ids were never affected -- endpointEniId already
mixes the subnet in -- and the new test asserts both, so a later change cannot fix one and
break the other.

twoSubnetsWithoutIpv4GetDistinctAddresses measured both ways: it FAILS on the constant
fallback with the collision above and PASSES with the subnet-derived one. The existing
non-IPv4 test could not have caught this: it uses a single subnet, where a collision has
nothing to collide with.

Ec2VpcEndpoint*, FlowLogServiceTest, Ec2ServiceTest, Ec2NetworkInterfaceIntegrationTest:
264 tests, 0 failures.

* test(compat): validate the endpoint's network interface ids through the Java SDK

Greptile's P2 on #4598. The integration test asserts the wire element over RestAssured,
which is deliberate -- an absent networkInterfaceIdSet and an empty one are different
things and only raw XML can tell them apart. But AGENTS.md's "Management APIs should be
validated with AWS SDK clients, not only handcrafted HTTP requests" sits under AWS Protocol
Rules, not under Compatibility Project, so it is general and "not only" is the operative
phrase. Both, not either.

src/test cannot host it: the main module has no AWS SDK dependency at all. sdk-test-java is
where the repo keeps SDK validation and already had 60 EC2 tests, covering
DescribeVpcEndpointServices but not an endpoint's own interfaces.

What this proves that the XML assertions cannot: that the real Java SDK DESERIALIZES the
element into networkInterfaceIds(). A response can be well-formed XML and still not populate
the model -- a wrong element name or nesting fails silently and leaves an empty list rather
than raising, which is the exact symptom this PR fixes.

Asserted on CreateVpcEndpoint and again on DescribeVpcEndpoints, and that the two agree,
because Terraform reads from one and re-reads from the other between plan and apply.

DeleteVpc moves from @Order(50) to @Order(51) so this runs while the shared VPC still
exists.

* fix(ec2): an endpoint's published interface ids have to resolve too

Blocking finding from hectorvent on #4598, and the gap it names is one this branch
filed as separate work (floci-5wby) on reasoning that turns out to be wrong.

DescribeVpcEndpoints publishes one ENI id per subnet in networkInterfaceIdSet.
describeNetworkInterfaces enumerated instance-attached interfaces and the standalone
CreateNetworkInterface store only, never endpointNetworkInterfaces, so asking about a
published id got InvalidNetworkInterfaceID.NotFound from the same emulator that had
just handed it over.

WHY IT CANNOT SHIP SEPARATELY. The bead argued no corpus module writes
data "aws_network_interface", so nothing resolves one. The corpus check was right and
the conclusion was wrong: the provider does the lookup ITSELF, inside its own read of
aws_vpc_endpoint. resourceVPCEndpointFlatten calls
findSubnetConfigurationsByNetworkInterfaceIDs over every id in network_interface_ids to
build subnet_configuration, and returns the lookup error rather than tolerating a
NotFound -- it handles retry.NotFound for the prefix list a few lines above and
pointedly does not here. So the blast radius is not "modules that look up an ENI", it is
every interface endpoint read. Publishing the ids without this turns an empty list on
main into a hard read failure, which is a regression against main rather than a
pre-existing gap left unfixed.

Endpoint interfaces now answer describeNetworkInterfaces: listed unfiltered, resolvable
by id, and selectable by interface-type, subnet-id and vpc-id. interface-type had no arm
at all, so it matched everything through the default; requester-managed is new alongside
it.

WIRE SHAPE. interfaceType vpc_endpoint and requesterManaged true, which is what AWS
reports for an interface it creates on the customer's behalf, and requesterManaged is now
emitted for every interface, false included, as the documented sample response does.
requesterId is left unset on purpose: real AWS reports an internal service account there,
which floci cannot know, and an invented twelve-digit id would be a wrong answer rather
than a missing one. No attachment block, for the same reason -- AWS reports one carrying
an AWS-side owner alias that would have to be fabricated, and the provider reads none of
it.

The new arm is deliberately NOT account-scoped, unlike the two above it. describeVpcEndpoints
is not account-scoped either, so scoping here would leave an id that IS published to a
caller unresolvable BY that caller -- the exact defect being closed. Its ids are added to
foundIds before the filter check, matching the other arms, so an id asked for by name and
then excluded by a filter is absent from the answer rather than NotFound.

Measured both ways at 1608dc7. Before: 5 of the new class's 6 tests fail, the id lookup
answering

  <Code>InvalidNetworkInterfaceID.NotFound</Code>
  <Message>The network interface ID 'eni-787c7b66a5503789b' does not exist</Message>

for an id DescribeVpcEndpoints had just published. After: 6 of 6 pass. The sixth is the
guard that an id which was never published still does not exist, and it passes both ways --
a store that resolves everything would satisfy the other five.

Ec2VpcEndpoint*, Ec2NetworkInterfaceIntegrationTest, FlowLogServiceTest, Ec2ServiceTest,
Ec2IntegrationTest, plus the two internal describeNetworkInterfaces callers
(EcsFargateTaskIntegrationTest, EksVpcRouteProgrammingTest) and CloudControlIntegrationTest:
504 tests, 2 failures, both in Ec2VolumeBlockDeviceDockerIntegrationTest and both measured
failing identically on this head with the change reverted -- a loopback mount inside the
container returning EINVAL on this machine, which no ENI path reaches.

* docs(ec2): drop the private tracker ids from shipped source

Second point on #4598: floci-5vs is an id in a private tracker, so an upstream reader
cannot resolve it. The sentence it sat in stands on its own -- the parenthetical was
the only part carrying the dangling pointer.

Two more of the same kind, both introduced by the previous commit on this branch rather
than pre-existing: floci-5wby on the new describeNetworkInterfaces arm, and the same id
in the new test class's javadoc. The test keeps its floci-io/floci#4598 reference, which
is this PR and resolves for anyone reading it.

The PR's diff now adds no tracker-shaped id at all. Note that upstream main already
carries several on lines this branch does not touch -- floci-kt9 appears eleven times in
Ec2Service alone, plus floci-k41 and the floci-3wz the review cites -- so this is the
convention changing, not a slip being corrected, and the rest is left where it is rather
than widened into this fix.

Deliberately NOT the javadoc trimming the review asks for in the same breath. That was
sequenced as a separate follow-up PR and the branch-history lines it targets are a
different problem from an unresolvable id.

Comment-only. Ec2VpcEndpoint*, Ec2NetworkInterfaceIntegrationTest, FlowLogServiceTest:
89 tests, 0 failures.

* fix(ec2): an endpoint's interfaces carry its security groups, and own their owner

Third review round on #4598. One finding is real, one rests on a misreading I had
written into the code myself, and the correction runs the other way from what was asked.

SECURITY GROUPS -- the real one. An interface endpoint's security groups are enforced ON
its interfaces; that is the entire mechanism by which a PrivateLink endpoint is
firewalled, and AWS reports them in each interface's groupSet. Floci reported an empty
groupSet, so a group-id filter excluded the very interfaces the group is attached to.
The group name is best-effort: it is cosmetic, the id is what filters and rules match on,
and the lookup reads the caller's account while FlowLogService runs on the default one,
so a miss omits the name rather than inventing one.

ACCOUNT SCOPING -- the misreading, and it was mine. The previous commit justified leaving
this arm unscoped by asserting that describeVpcEndpoints is not account-scoped either,
citing its vpcEndpoints.scan(k -> true). That is wrong. Plain scan on an
AccountAwareStorageBackend filters to the caller's partition before the predicate runs:
k -> true selects every KEY within one account, not every account. The endpoint side was
scoped all along, and so is the subnet lookup inside endpointNetworkInterfacesOf, which
would yield no interfaces for a foreign endpoint even if one were reached. Two
independent layers, neither visible at the call site.

So the review's conclusion -- that this arm exposed other accounts' interfaces -- does
not hold, and neither did my stated reason for writing it that way. Measured rather than
argued: deleting an account filter from the describe arm changes no observable behaviour,
because the scoping is not there to begin with. The arm is therefore left as it was and
the COMMENT is corrected, since the comment was the defect.

ownerId is the part of that finding with a real kernel, and it is fixed: it now comes
from callerAccountId(), the account these interfaces were actually read under, instead of
from safeAccount. The explicit-account overload can set safeAccount to an account this
ambient-scoped arm cannot honour, and labelling a resource with an account it did not
come from is worse than either showing or hiding it.

Also: the not-found matcher is statically imported rather than inline-qualified, per
AGENTS.md.

TESTS. anEndpointInterfaceCarriesTheEndpointsSecurityGroups measured both ways -- it
FAILS with the group loop removed ("expected: <[sg-13d37d8313c325d98]> but was: <[]>")
and passes with it, and it asserts the group-id filter as well as the groupSet, since the
empty-groupSet bug satisfies neither. anotherAccountsEndpointInterfacesAreInvisible is
labelled in the source as what it is: a characterization test that passes with and
without an account filter, kept because it pins the behaviour a reviewer doubted rather
than the mechanism, and positioned to fail if either scoping layer changes.

Ec2VpcEndpoint*, Ec2NetworkInterfaceIntegrationTest, FlowLogServiceTest, Ec2ServiceTest,
Ec2IntegrationTest, EcsFargateTaskIntegrationTest, EksVpcRouteProgrammingTest,
CloudControlIntegrationTest: 499 tests, 0 failures.

* test(compat): the endpoint SDK test creates the fixtures it needs

The ordered suite shares mutable fixtures, so what exists at a given point is a function
of position. @Order(44) deletes the shared subnet and sets subnetId to null and
@Order(45) deletes the shared security group, both before this @Order(50) test ran: it
was passing a null subnet id to CreateVpcEndpoint and asserting groups() was non-empty
while supplying no group at all.

It now creates its own subnet and security group, uses them, and deletes them in the
same finally block that already removed the endpoint.

Worth noting why neither half failed loudly enough to catch earlier: compatibility-tests
is not a module of the root pom, so `./mvnw test` never compiles or runs it. Verified
here by building the module directly.

Authored by Allen; committed from the branch worktree alongside the review round.
2026-09-29 22:28:01 -04:00