DeleteUser now returns DeleteConflict while the user still has inline policies or access keys, matching AWS. UpdateUser rename moves the user's access keys and group membership to the new name, so a renamed user keeps them and a user recreated under the old name does not inherit them.
Resolve the integration target before connecting and reject link-local and cloud instance-metadata addresses on both the HttpClient path and the Host-override socket path. Loopback and private ranges stay reachable so local backends keep working.
DeleteVpc now refuses while the VPC still has a subnet, a security group,
route table or network ACL other than the defaults, or an attached
internet gateway, as AWS does. Creating a subnet, group, route table or
network ACL, or attaching an internet gateway, re-checks the VPC under the
region topology lock, so a concurrent DeleteVpc can no longer leave one
pointing at a VPC that is gone. AttachInternetGateway now rejects a VPC
that does not exist.
The default arm of InitiateAuth and AdminInitiateAuth looked the user up by name and issued signed tokens for any AuthFlow value it did not recognize, with no credential check. Reject those values with InvalidParameterException. ADMIN_NO_SRP_AUTH is a valid AdminInitiateAuth flow that previously only worked through that arm, so it now goes through password authentication.
CreateDomain and CreateRepository accepted an unlimited number of domains and
repositories, but AWS caps an account at 10 domains per Region and a domain at
1,000 repositories, returning ServiceQuotaExceededException once reached.
DeletionProtection was stored and round-tripped but never read on the
delete path, so a protected pool was deleted like any other and a
CloudFormation DeleteStack owning one succeeded. AWS refuses with
InvalidParameterException until UpdateUserPool switches the flag to
INACTIVE, and the stack reports DELETE_FAILED with that reason.
The check reads the pool store directly: describeUserPool would turn a
delete of a missing id into ResourceNotFoundException (a separate
divergence) and generate signing keys as a side effect.
Closes#3948
* feat(sns): add the MaximumMessageSize topic attribute for 1 MiB payloads
AWS raised the SNS payload ceiling from 256 KiB to 1 MiB behind a new
per-topic MaximumMessageSize attribute. The default stays 262144, so an
unconfigured topic is unchanged.
CreateTopic and SetTopicAttributes validate the 1024-1048576 range, Publish
and PublishBatch size against the topic's value, and a topic above 262144 is
held to its subscription constraints: sqs, firehose or lambda only, and at
most 100 subscriptions. AWS::SNS::Topic forwards the property too.
Two things the same code path had wrong, both checked against the live API:
Subject was counted towards the publish limit when AWS does not count it, and
PublishBatch returned the SQS wording rather than the SNS one.
* fix(sns): ignore an out-of-range persisted MaximumMessageSize
Validation only guards new writes. A topic stored before the attribute was
known carries whatever the old generic setter accepted, so the read path
could hand back a value above 1 MiB and wave a publish past the AWS ceiling,
or one at zero and reject every publish. Out of range now falls back to the
default, exactly as a nonnumeric value already did.
Also covers the attribute end to end on both wire protocols -- create, set,
get, and the oversized Publish and PublishBatch errors on Query and JSON 1.1
-- since the existing suite drives SnsService directly and cannot catch a
regression in parameter extraction or error serialization.
* chore(iam): report enforcement state at startup and cover IAM management actions
Issue #3931 reported that an IAM user with an S3-only policy could call
CreateUser, CreateGroup, AttachUserPolicy and DeleteUser. The reporter had
set FLOCI_IAM_STRICT_VALIDATION, which is not a Floci flag, so enforcement
was never on; with FLOCI_SERVICES_IAM_ENFORCEMENT_ENABLED=true those calls
already return AccessDenied, including under an explicit Deny on iam:*.
Make that state visible: the startup banner now prints whether IAM policy
enforcement is enabled and names the correct variable when it is off. The
IAM docs state that management actions are enforced too and that any other
flag spelling is silently ignored. A regression test pins the issue's
scenario (group-attached S3-only policy, plus a direct explicit-deny
policy) against the four actions over HTTP with enforcement enabled.
* chore(iam): use explicit types and imports in the enforcement regression test
* chore(iam): stub the IAM config in EmulatorLifecycleTest and cover the enforcement banner line
* fix(sagemaker): restore the worker pools in afterReset, not clear()
A state reset runs every container teardown, and the SageMaker training
runner and endpoint manager shut their worker pools down there. Since
#3797 they create a new pool in clear(), but the reset controller skips
clear() as soon as the storage wipe or an earlier service's clear()
throws, so one failed reset still left both pools terminated and every
later CreateTrainingJob, CreateEndpoint and UpdateEndpoint returned 500
with RejectedExecutionException until Floci restarted.
Both beans now recreate the pool in afterReset(), which the controller
runs from a finally block for every service it prepared, whether or not
the wipe or a clear() succeeded. Shutdown still never runs it, so the
pools stay down there. clear() keeps only its stopRequested wipe, and
the ContainerTeardown Javadoc names afterReset() as the hook to use.
Refs #3796
* fix(ecs): restart the reconciler in afterReset, not clear()
EcsService restarted the reconciler its reset teardown had stopped in
clear(), the same one-way path the SageMaker pools had: a reset whose
storage wipe or earlier clear() threw skipped it and left ECS without a
reconciler until the emulator restarted. The restart now lives in
afterReset(), which the reset controller runs for every prepared service
regardless of that failure, matching the rule the ContainerTeardown
Javadoc states and what the SageMaker beans now do.
Refs #3796
S3VirtualHostFilter rewrites a bucket-level virtual-hosted request (GET /)
to the path /bucket/, and ResourceArnBuilder.buildS3Arn turned that into
arn:aws:s3:::bucket/ with a trailing slash. A policy naming the bucket as
arn:aws:s3:::bucket then failed to match, so an allowed ListBucket was
denied for every SDK that defaults to virtual-hosted addressing while the
identical path-style call was allowed.
Drop the separator when nothing follows it. A key that itself ends in a
slash (a folder marker such as folder/) keeps it, because there the slash
is key data rather than a separator.
Refs lex00/floci#213
(cherry picked from commit 8624701021f2c6374b6e5d627218eeaa961ce751)
* fix(dynamodb): honor MICROSECOND ApproximateCreationDateTimePrecision for Kinesis destinations
Store the precision requested in EnableKinesisStreamingConfiguration, echo it in the
enable response, and return it from DescribeKinesisStreamingDestination, so Terraform
no longer destroys and recreates the destination on every apply.
Stamp ApproximateCreationDateTime in epoch microseconds for MICROSECOND destinations,
with a shared eventID per change across destinations.
Reject precisions other than MILLISECOND and MICROSECOND with ValidationException.
Add forwarder unit and end-to-end integration coverage, and document the behavior.
* fix(dynamodb): stop enabling DynamoDB Streams with a Kinesis destination
EnableKinesisStreamingDestination turned on DynamoDB Streams for the table.
Kinesis forwarding does not need it, and Terraform saw stream_enabled drift
on aws_dynamodb_table on every run.
Leave the table's stream setting as the caller configured it.
* test(dynamodb): add Terraform compat test for Kinesis destination precision
Apply a Kinesis streaming destination with MICROSECOND precision and check that
it reads back, that a second plan is clean, and that a precision change
replaces the destination once and then settles.
* feat(ec2): report DnsEntries for interface VPC endpoints
CreateVpcEndpoint and DescribeVpcEndpoints answered without a dnsEntrySet, so an
interface endpoint reported no DNS entries at all. A caller that follows the
endpoint to the name it should point a Route 53 alias at has nothing to read:
Terraform's aws_vpc_endpoint exposes the list positionally as dns_entry, so
dns_entry[0].dns_name fails outright.
An interface endpoint now reports the regional name, one name per availability
zone it has a subnet in, and the service's own public name when private DNS is
on. The names and their hosted zones are derived from the endpoint and its
region rather than stored, so repeated describes and a restart keep answering
with what the caller first saw, the same approach the endpoint's network
interfaces already use.
The service segment follows AWS's rule rather than the last dot-separated
segment: com.amazonaws.us-east-1.ecr.api is reached at
api.ecr.us-east-1.vpce.amazonaws.com. CloudFormation publishes the matching
DnsEntries attribute, which closes its row in getatt-attribute-gaps.tsv.
* fix(ec2): build endpoint DNS names from the region's partition suffix
The names hard-coded amazonaws.com, so an endpoint in cn-north-1 reported
...vpce.amazonaws.com where AWS serves ...vpce.amazonaws.com.cn, and the same
for the private DNS name. AwsRegions.dnsSuffixFor already carries the suffix
per partition, as EksTokenMinter uses when it builds an STS hostname.
Also covers the CloudFormation attribute end to end: a CreateStack whose
Outputs take Fn::GetAtt on DnsEntries now asserts the pairing and the entry
order, which the schema-coverage ratchet cannot check because it only matches
provisioner source.
* fix(ec2): answer the private DNS name AWS serves, not the service token
Deriving the private name from the endpoint service token is wrong for the
services whose two differ. com.amazonaws.<region>.kinesis-streams answers on
kinesis.<region>.amazonaws.com and kinesis-firehose on firehose, the ECR
registry name is the wildcard *.dkr.ecr.<region>.amazonaws.com, and the IoT
data plane has no private name at all: AWS leaves private DNS off for it.
Those four are the exceptions among the services DescribeVpcEndpointServices
advertises, so the map covers that list rather than standing in for AWS's DNS
catalogue. Everything else keeps deriving from the token, which is what AWS
serves for it.
* fix(ec2): answer the wildcard private DNS name for API Gateway
A private REST API is invoked at {restapi-id}.execute-api.<region>.amazonaws.com,
so the endpoint's private name is the wildcard *.execute-api.<region>.amazonaws.com
rather than the bare regional name the service token produces.
* fix(ec2): answer the private DNS names AWS serves for the ECS endpoints
An ecs-agent or ecs-telemetry endpoint answered on its own service token, but
AWS serves them at ecs-a and ecs-t. Cover every advertised service in the
matrix test, and fail when one is advertised without a private DNS name
decided for it.
* refactor(sqs): move library usages to imports
* refactor(sqs): replace inline FQCNs and var declarations across sqs package
* refactor(sqs): eliminate test var usages and revert attribute order in json handler
* fix(proxy): preserve half-closed relay connections
* fix(proxy): bound both relay shutdown waits
Ensure Redis and Neptune relays close both directions when one peer half-closes,
and cover backends that send a response but remain connected.
* fix(proxy): keep healthy relays open
Removing stripBom and the unused imports in the review follow-up left a blank
line before the closing brace of CsvRecordReader and a doubled blank line in
SesImportJobService and InvalidRecordException.
* feat(route53): implement UpdateHostedZoneComment
The path carried GET and DELETE but no POST, so the action answered 405 and a
caller that renames or re-comments a zone could not proceed. Terraform's
aws_route53_zone sends it whenever the comment changes, which includes importing
an existing zone under a new configuration.
A request with no Comment clears the existing one, as AWS documents, rather than
leaving the previous value in place.
* fix(route53): reject a body that is not an UpdateHostedZoneCommentRequest
A missing Comment means "clear the comment", and XmlParser returns the default
for a body it cannot parse, so a truncated or wrong-root document cleared the
zone's comment and answered 200. Validate the root element first.
* fix(route53): resolve the zone through the caller-ownership lookup
UpdateHostedZoneComment resolved the zone with getHostedZone, which reads
pre-account-isolation data written before the store was account-scoped and
migrates it into whichever partition asked for it first. Use the same lookup
the VPC association actions use, so only the owning account can rewrite the
comment.
taggable() erased the resolved resource behind a private Tagged
lambda, so applyTagged()'s instanceof checks never matched and the
tag mutation/store.put were dead code. Dispatch on the resource's
concrete type directly instead.
* Fix#3910
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* feat(ses): add v2 import jobs for the suppression list and contact lists
Implements CreateImportJob, GetImportJob and ListImportJobs. A job reads a
CSV or newline-delimited JSON object from the local S3 emulation and applies
each record through the existing suppression-list and contact services, so
the imported rows land in their stores and only the job record is new.
The job is returned as CREATED and runs on a virtual thread under the request
account, moving to PROCESSING and then COMPLETED or FAILED, as on AWS. Records
that fail validation are counted in FailedRecordsCount while the job still
completes; a missing bucket or object, a contact-list CSV without an
emailAddress header, or a contact list deleted before the worker runs fail
the job with FailureInfo.ErrorMessage. At most 20 jobs per region may be in
progress, and jobs interrupted by a restart are marked FAILED on startup.
* fix(ses): accept the guide's unquoted contact row and match AWS's import not-found message
A quote that does not open a CSV field is data rather than an error: the SES
list-management guide writes attributesData unquoted as {"Name": "John"}, so
rejecting it refused the documented format. Garbage after a closing quote is
still a failed record, since that row cannot be read back unambiguously.
An import job for an unknown contact list answers NotFoundException with its
own wording, "ContactList <name> doesn't exist", which differs from the
contact-list APIs. Probed against real SES: the check is synchronous and the
error is NotFoundException, even though the service model lists only
BadRequestException, LimitExceededException and TooManyRequestsException for
CreateImportJob. The contact service keeps its own message.
Also drops five unused imports and a dead stripBom that held the only literal
BOM character in the reader sources.
Move AWS::IAM::AccessKey and AWS::IAM::InstanceProfile out of the CloudFormationResourceProvisioner monolith into IamAccessKeyCfnProvisioner and IamInstanceProfileCfnProvisioner, each over IamService, matching the existing one-type-per-class IAM provisioners (IamRole, IamUser). The monolith keeps iamService, still used by the Policy and ManagedPolicy arms that migrate in a later PR.
Ref is preserved: the access key id for AccessKey, the profile name for InstanceProfile. The move also publishes AccessKey Id as an Fn::GetAtt key the monolith left unresolved, because leaving LEGACY_SWITCH subjects a type to CfnSchemaCoverageTest, which requires every readOnly attribute to be set; SecretAccessKey and InstanceProfile Arn were already set, so no gap rows are needed. InstanceProfile delete tolerates an already-gone profile via CfnDeletes.safeDelete on NoSuchEntity while letting DeleteConflict propagate. AccessKey keeps the legacy no-op delete (removing a key needs the owning user name the id-only path lacks); deleting it properly is a follow-up.
* feat(ec2): validate DescribeVpnGateways and add DescribeEgressOnlyInternetGateways
* refactor(ec2): drop unused region parameter from empty gateway discovery
* fix(ec2): return an empty set for an unknown egress-only gateway ID
---------
Co-authored-by: Jason van Zyl <jason@vanzyl.ca>
Move AWS::EKS::Cluster and AWS::EKS::Nodegroup out of the CloudFormationResourceProvisioner monolith into a new EksCfnProvisioner over EksService. A nodegroup belongs to a cluster and its delete needs the cluster name, stored as a create-time attribute, so the two share one provisioner. Ref returns the cluster name for a Cluster and the nodegroup name for a Nodegroup, as the legacy switch did. With the arms gone, the monolith no longer needs its eksService dependency, which is dropped.
The move preserves Ref, but it is not a pure move for Fn::GetAtt. Leaving LEGACY_SWITCH subjects these types to CfnSchemaCoverageTest, which requires every readOnly attribute to be published or recorded as a gap. The Cluster arm previously set only Arn and Endpoint, so it now also publishes CertificateAuthorityData and OpenIdConnectIssuerUrl (both available from the model), and four attributes Floci does not model (Cluster ClusterSecurityGroupId, EncryptionConfigKeyArn and Id, and Nodegroup Id) are recorded as gap rows. Both deletes tolerate an already-gone resource through CfnDeletes.safeDelete on ResourceNotFoundException.
Adds PublishPackageVersion, DescribePackageVersion, and GetPackageVersionAsset
for CodeArtifact's generic package format, matching AWS's own wire restriction
that PublishPackageVersion accepts only the generic format. Includes real
asset hashing (MD5, SHA-1, SHA-256, SHA-512), SHA-256 integrity verification
against the caller's x-amz-content-sha256 header, correct Unfinished/Published
status transitions, and the documented AWS quotas for this action (350 assets
per version, 5 GB max asset size), all returning ServiceQuotaExceededException
when exceeded.
Asset bytes are kept out of the JSON/WAL-backed package-version store
(@JsonIgnore on PackageAsset.content) and instead go through a dedicated
asset store, a disk file in persistent/hybrid/wal mode or a side map in
memory mode, the same split S3Object/S3Service already uses for object
bytes. Without this, a publish rewrote every asset of every package version
on disk each time, growing quadratically under this action's own
350-asset/5GB quotas. The asset name is also validated against the wire
model's AssetName pattern (no control characters), not just its length,
since it is echoed back verbatim in the X-AssetName response header on
GetPackageVersionAsset.
Verified against the real botocore service-2.json wire model and the AWS
CodeArtifact User Guide (including its PDF for the quotas table, since the
HTML quotas page is JS-rendered). Live-verified with the real AWS CLI and
the AWS SDK for Java v2 against a running Floci instance, including an exact
byte-for-byte asset round-trip and the real ConflictException when
republishing an already-Published version.
* feat(iam): implement CreateLoginProfile, UpdateLoginProfile, DeleteLoginProfile
GetLoginProfile previously existed as a permanent stub always returning
NoSuchEntity, and the docs claimed the other three actions were supported
even though the query handler had no case for them at all.
Adds a LoginProfile model and the full lifecycle on IamService: a user
holds at most one login profile, Create/Get/Delete default UserName to
the caller's resolved identity (matching AWS), Update requires it
explicitly, and Update leaves an omitted field (Password or
PasswordResetRequired) unchanged rather than resetting it. The password
is validated against AWS's wire character-class/length rule and, when
the account has one, against the existing account password policy
(PasswordPolicyViolation).
Verified against the real AWS IAM API reference for all four actions'
request/response shapes and error lists.
* fix(iam): block DeleteUser on a login profile and carry it through UpdateUser rename
Login profiles now persist, so deleteUser left an orphaned profile that a
recreated user of the same name would inherit, and a rename dropped the
profile. DeleteUser now returns DeleteConflict while a login profile
exists, as AWS does, and UpdateUser moves the profile to the new name.
* fix(ec2): store omitted inline tag values as empty strings
* fix(ec2): normalize omitted tag values on CreateTags and every tag-spec path
---------
Co-authored-by: Jason van Zyl <jason@vanzyl.ca>
* fix(ec2): delete VPC default security group, route table and network ACL with the VPC
* test(ec2): check deleted VPC defaults by VPC scope instead of by ID
---------
Co-authored-by: Jason van Zyl <jason@vanzyl.ca>
Move the six coupled REST API Gateway types (RestApi, Resource, Method, Deployment, Stage, Authorizer) out of the CloudFormationResourceProvisioner monolith into a new ApiGatewayRestApiCfnProvisioner. The shared OpenAPI Body and BodyS3Location resolver, used by both AWS::ApiGateway::RestApi and AWS::ApiGatewayV2::Api, is extracted into OpenApiDocuments so the monolith's V2 arm reuses it rather than keeping a copy. With the v1 arms gone, the monolith no longer needs its apiGatewayService dependency, so that constructor parameter is dropped.
The move preserves Ref, but it is not a pure move for Fn::GetAtt: it also resolves four keys the monolith never populated. Once a type is owned by a registry provisioner, CfnSchemaCoverageTest requires every readOnly attribute to be published or recorded as a gap, so the new provisioner sets RestApiId, ResourceId, AuthorizerId and DeploymentId, which previously resolved to the literal "Logical.Attr". RootResourceId was already set. The inventory tsv, fixture wiring and a focused unit test cover the six types.
AWS::EC2::Instance provisioning launched a new instance on every UpdateStack, leaking the prior one and breaking Ref. Reuse the existing instance when no createOnly property changed, republishing its attributes and reconciling its tags in place. Replace it only when ImageId, SubnetId or KeyName differs, recording the displaced instance through ReplacementCleanup so the stack removes it after the update commits.
The reuse lookup tolerates a prior instance terminated out of band: describeInstances raises InvalidInstanceID.NotFound for an unknown id, and a terminated instance lingers in the store, so both fall back to launching a fresh instance instead of failing the update or pointing Ref at a dead instance. Republishing an instance's attributes now clears the ones it does not set, so a replacement never inherits the prior instance's PublicIp or DNS names.
Deferred: mutable properties are not applied to a reused instance in place (SecurityGroupIds, UserData, IamInstanceProfile), an in-place InstanceType change is not applied, and createOnly changes to properties the provisioner does not read (PrivateIpAddress, AvailabilityZone) do not force replacement.
Refs #3810
* feat(dynamodb): improve PartiQL grammar coverage
An attribute reference is now a path, so a.b and a[0] work in SELECT columns,
WHERE conditions and UPDATE SET and REMOVE targets. SELECT reports a path from
its last named component on, so SELECT a.b[0] answers b[0].
Values take map, list and set literals, exponent numbers and a doubled single
quote. An empty set, a mixed set and a set with a repeated member are refused
in the AWS words.
WHERE takes OR, NOT, parentheses, IN with a list literal, IS MISSING and IS
NULL with their negations, and the contains, attribute_type and size
functions. Each becomes the matching filter or condition expression, so the
existing evaluator does the work.
UPDATE SET takes a sum or difference, list_append, set_add and set_delete. A
predicate beside the key equality becomes a condition on the write, so a false
one answers ConditionalCheckFailedException and leaves the item. UPDATE is not
an upsert and needs the key to hold an item already, while a DELETE on a key
holding no item stays a no-op. A clause omitting a key attribute says so.
RETURNING runs all four variants on UPDATE and ALL OLD * on DELETE. It answers
one row on Items, and no row when the projection is empty. DELETE refuses the
other three and ExecuteTransaction refuses the clause outright.
SELECT takes ORDER BY on the key, pages the sorted rows, and refuses the shapes
AWS refuses. A FROM path takes at most two components and no empty one. INSERT
refuses an index qualifier as a parse error, UPDATE and DELETE refuse the
operation on an index, and a keyed read filtering on an attribute the index
does not project is refused.
ExecuteTransaction runs a transaction of nothing but SELECT as a read, runs
EXISTS as a condition check, refuses a mix of reads and writes, and no longer
applies twice on a replayed ClientRequestToken. A BatchExecuteStatement member
carries the short error code and echoes TableName when it reached its table.
Two update engine bugs came out of this and are fixed for UpdateItem as well.
list_append on a nested path wrote a new top-level attribute, and ADD or DELETE
with an operand of another type replaced or ignored the stored value.
* fix(dynamodb): read key equalities inside a grouped AND in PartiQL
* fix(dynamodb): subtract without spaces and refuse trailing tokens in PartiQL
* fix(dynamodb): refuse a negative list index in PartiQL
* fix(dynamodb): refuse a non-string type in PartiQL attribute_type
* fix(dynamodb): refuse a value that is not a set in PartiQL set_add and set_delete
* fix(dynamodb): refuse duplicate members in a PartiQL bag
* fix(dynamodb): check PartiQL parameters before reading the statement
* fix(dynamodb): refuse two PartiQL reads of one item in a transaction
* fix(dynamodb): read only by the key in a PartiQL transaction SELECT
* fix(dynamodb): check unprojected attributes inside grouped PartiQL conditions
* fix(dynamodb): refuse an ADD or DELETE operand type before reading the item
* fix(dynamodb): skip line and block comments in PartiQL
* fix(dynamodb): apply a sign to a PartiQL number literal
* fix(dynamodb): refuse a parameter inside a PartiQL collection literal
* test(dynamodb): read a parameter in IN on a non-key attribute
* fix(dynamodb): refuse a PartiQL list index above the integer range
* fix(dynamodb): refuse a PartiQL literal nested 32 levels deep
* fix(dynamodb): refuse a non-number literal in PartiQL arithmetic
* feat(dynamodb): read attribute_exists and attribute_not_exists in PartiQL
* feat(dynamodb): compare a PartiQL condition with a boolean
* fix(dynamodb): match nothing when ordering a value against another type
* fix(dynamodb): read PartiQL key conditions spread over OR and IN like AWS
* fix(dynamodb): read a PartiQL transaction or batch SELECT only by its key
* fix(dynamodb): refuse two values for one key on a PartiQL write
* fix(dynamodb): cancel a PartiQL transaction that names a missing table
* fix(dynamodb): cancel a PartiQL transaction whose statement does not name one item
* fix(dynamodb): refuse a write that leaves an item nested too deep
* fix(dynamodb): refuse a PartiQL parameter only past the nesting limit AWS uses
* chore(dynamodb): drop comments that restate the code or a test
* perf(dynamodb): work out each PartiQL key branch once and cap how far it spreads
* chore(dynamodb): share one first key value helper across PartiQL key checks
* chore(dynamodb): throw the ADD or DELETE operand error and merge member loops
* chore(dynamodb): track PartiQL literal depth in one place and share truth helpers
* test(dynamodb): name the quoted table once and add statement and putItem overloads
* fix(dynamodb): cap IN operands and decomposed reads in PartiQL
S3AnalyticsConfiguration and S3InventoryConfiguration each carried an
identical private count(XmlElement, String) helper (#3843), a
follow-up from review of #3835/#3836. That review comment also
suggested the two share a second Filter grammar of their own, but
checked against botocore: AnalyticsFilter supports Prefix/Tag/And
(the same shape #3835 covers) while InventoryFilter is Prefix-only,
so there's no real Filter-grammar duplication between these two to
extract, only this helper.
Turned it into an instance method on XmlElement itself in XmlParser,
alongside the existing child() method, rather than a second static
utility: it belongs on the type both files were already calling
.child()/.children() on. Updated both call sites from count(x, "Y")
to x.count("Y") and removed each file's own copy.
Also looked at the Destination/S3BucketDestination builders both
files have; left them separate since the actual fields differ
(AccountId vs BucketAccountId, different supported Format lists,
Encryption only on Inventory's side), and forcing a shared shape
across those differences would be a worse abstraction than three
similar lines.
No behavior change: verified against both configuration types' unit
and integration test suites plus XmlParserTest.
A request signed with temporary credentials resolves its account before the
request context exists. IamService found the session with scanAllAccountsAsMap,
which copied every session of every account into a map on each such request,
even with IAM enforcement off. Expired sessions leave the store only when they
are looked up, so this cost grew over time.
The session lookup now uses findAnyAccount. AccountAwareStorageBackend keeps
the set of accounts that own keys, so findAnyAccountEntry does one get per
account instead of a scan. The first cross-account lookup builds the set with
one scan, and later writes add their account. A store that never looks across
accounts pays one volatile read per write. Accounts are never removed, so a
stale one only costs a missed get.
findAnyAccountEntry now reads the caller's partition from the delegate and
calls get only when un-prefixed legacy data exists. It no longer waits on the
store monitor that the legacy migrations hold.
The S3, EC2 and Route53 callers of findAnyAccountEntry use the same path.
* feat(eks): sign k3s service account tokens with the cluster OIDC key
In real EKS, workloads authenticate via IAM Roles for Service Accounts (IRSA) using projected tokens signed by the cluster OIDC key with audience sts.amazonaws.com. In Floci, k3s launches with default signing flags, meaning it signs in-cluster pod tokens using its own internal auto-generated key under https://kubernetes.default.svc.cluster.local. Because Floci STS verifies tokens against Floci's per-cluster OIDC key and issuer, in-cluster pod tokens cannot be verified, forcing local workloads to use static credentials instead of IRSA.
To bridge this gap, Floci now passes the cluster's per-cluster OIDC keypair and issuer to the k3s container on cluster start and restore. EksClusterManager exports the cluster keypair as restrictive PEM files (0600) into /etc/rancher/k3s/ and configures kube-apiserver with signing keys, dual issuers, and dual audiences (https://kubernetes.default.svc.cluster.local and sts.amazonaws.com). Projected pod tokens now verify cleanly against Floci STS, while internal cluster components continue operating without disruption.
* fix(eks): isolate IRSA signing key files by account and region
Persist cluster OIDC signing keypairs under dataPath/keys/<accountId>/<region>/<clusterName> instead of only clusterName. Because EKS cluster names are unique only within an account and region, same-named clusters across different accounts or regions previously shared host key files, risking key overwrite during startup or restore.
* fix(eks): create signing key files with atomic owner-only permissions
Create the signing key and public key files with PosixFilePermissions rw------- atomically on creation via Files.createFile, avoiding any brief window where private key material is readable with default umask permissions.
* fix(eks): guard webhookPath against null cluster ARN and createdAt
Safely resolve accountId, region, and createdAt with fallbacks in webhookPath when cluster fields are null, and ensure integration tests populate cluster ARN and createdAt.
* fix(core): route by the Host header on HTTP/2 requests
HTTP/2 carries the authority in :authority and sends no Host header, so every
lookup that reads Host fell through when a client negotiated HTTP/2. curl, the
AWS SDK for Java and Go, and browsers all do that over HTTPS, which left
CloudFront distribution domains, API Gateway execute-api and custom domains,
Lambda function URLs and Cognito custom domains unreachable over https://.
Copy the authority into a Host header before routing. S3 already covered this in
its own filter.
* feat(cloudfront): serve distributions over HTTPS on local hostnames
A distribution's assigned domain name resolves to nothing local, so a signed URL
could not be downloaded over https:// the way a viewer downloads one from
CloudFront.
Serve every distribution under <id>.cloudfront.localhost.floci.io and
<id>.cloudfront.localhost as well, and add both to the SANs of the generated
server certificate. The first resolves to 127.0.0.1 through public DNS on Linux,
macOS and in containers. The second needs no DNS at all but only resolves where
the runtime handles .localhost itself, which macOS and browsers do and
Debian-based images do not.
* fix(cloudfront): assign lower-case distribution domain names
AWS writes a distribution's domain name in lower case and keeps the id upper
case. Floci put the upper-case id straight into the host name, and a browser
lower-cases the authority it sends, so the rebuilt resource never matched the
one a signed URL was signed for and the download failed with 403.
* refactor(cloudfront): derive the local delivery hosts from the DNS suffixes
The suffix list was a fourth hardcoded copy of the emulator host suffixes, so a
configured FLOCI_HOSTNAME or FLOCI_DNS_EXTRA_SUFFIXES resolved and was covered by
TLS but did not route, and localhost.localstack.cloud did not either. Build it
from the same source the embedded DNS uses.
Match the host inside the scan findByHost already does, by comparing the host to
<id><suffix>, which drops a store read per request and the assumption that the
store keys distributions by an upper-case id. The tests read the default SAN list
from TlsConfigSource rather than copying it.
* fix(cloudfront): issue AWS-shaped public key ids
CreatePublicKey answered a UUID where AWS answers K followed by 13 characters,
the value a signed URL carries as Key-Pair-Id. Verified on AWS us-east-1
2026-09-18: a public key is K2VKB3XV74876Q, while key groups, cache policies,
origin request policies and response headers policies are UUIDs, which Floci
already matches.
* refactor(core): resolve the HTTP/2 authority in each host routing filter
The global Http2HostHeaderFilter made every service depend on a Host
header it wrote, and no service file showed that. RequestHost now returns
the Host header, or the HTTP/2 :authority when there is none. Each filter
that routes by host calls it. S3 and Cognito had their own copy of this
fallback and now use the helper.
* test(core): check host routing over HTTPS and HTTP/2 against the real SANs
The HTTP/2 routing test now boots with a CA-issued leaf that carries the
default SANs. The client trusts only the Floci CA and checks each
CloudFront local delivery host against that leaf. This replaces the
HTTP/1.1 local delivery test, which only set a Host header and never
reached TLS.
S3 drops three resolveHost tests that RequestHostTest now covers. Its
HTTP/2 bucket tests still guard the call to the helper.
* fix(rds): report the monitoring and lifecycle settings a DB instance was given
CreateDBInstance and ModifyDBInstance accepted MonitoringInterval,
MonitoringRoleArn, EnablePerformanceInsights,
PerformanceInsightsRetentionPeriod, EngineLifecycleSupport,
EnableCloudwatchLogsExports and MaxAllocatedStorage, then dropped every one of
them. DescribeDBInstances reported none, so a caller that set them read its own
configuration back as absent and treated the instance as changed.
DbInstanceSettings carries the seven, DescribeDBInstances writes them, and each
one takes the default its member documents. MonitoringInterval defaults to 0,
PerformanceInsightsRetentionPeriod to 7 days and EngineLifecycleSupport to
open-source-rds-extended-support. MaxAllocatedStorage and
EnabledCloudwatchLogsExports stay absent when storage autoscaling is off and no
log type is exported, matching what a live account returns. The valid values
each member documents are enforced, so 45 as a monitoring interval and 94 as a
retention period are rejected the way AWS rejects them.
withEffectiveWindows rebuilt the settings through the constructor and would
have dropped the new members, so it now goes through withWindows, which keeps
every member it is not resolving.
* fix(rds): require a monitoring role whenever the interval is not zero
Review feedback on #3688. MonitoringInterval and MonitoringRoleArn are
documented as a pair, in both directions and on both CreateDBInstance and
ModifyDBInstance. An interval other than 0 needs a role, and a role needs an
interval other than 0. The other rules on these members were already enforced
and this was the piece left out.
The check takes the values that will be in effect rather than the ones the
request carried. A modify may raise the interval on an instance that already
holds a role, or attach a role to an instance whose interval is already
non-zero, and judging the request alone would refuse both.
Three tests cover a create with an interval and no role, a create with a role
and a zero interval, and a modify that turns monitoring off while a role stands.
The existing modify test now raises the interval without naming a role, which
proves the effective-value reading.
Also turns the three inline fully-qualified names in the test into imports, per
the review.
* fix(rds): keep ModifyDBInstance to its own monitoring and log-export contract
Two review blockers on #3688, both from ModifyDBInstance being held to
CreateDBInstance's shape.
The pair rule is create-only. CreateDBInstanceMessage words it with "you must
supply a MonitoringRoleArn value" and "you must set MonitoringInterval to a
value other than 0". ModifyDBInstanceMessage drops the "must" from both, and its
MonitoringInterval adds "To disable collection of Enhanced Monitoring metrics,
specify 0" with no mention of clearing the role. Enforcing the pair on a modify
refused the documented way to turn monitoring off, and the previous test pinned
that as if it were correct. It now asserts the opposite.
ModifyDBInstance carries no EnableCloudwatchLogsExports at all. It sends
CloudwatchLogsExportConfiguration with EnableLogTypes and DisableLogTypes,
applied to the stored set as deltas. The shared parser only looked for the
create-only key, so a real request to change exports on a live instance was a
silent no-op. Modify now has its own branch, the way StorageEncrypted and
KmsKeyId already do behind includeEncryption, and LogExportChanges folds the two
lists into what the instance holds.
Three tests cover it. Disabling by interval 0 while the role stands is accepted
and both values are reported. An enable and a disable are applied together. A
modify that omits the configuration leaves the set alone. Neutralising the parse
turns the delta test red.
The security group provisioner was additive only and tag blind: on UpdateStack it authorized newly declared inline rules but never revoked a rule the template dropped, and never read or reconciled Tags. It now revokes, on update, only the inline rules this resource authorized on a prior run (recorded in internal __FlociSg{Ingress,Egress}Rules attributes) and no longer declares, so a rule owned by a standalone SecurityGroupIngress/Egress resource is never touched. Tags are reconciled against the group's current tags on create and update. Second of the EC2 provisioner follow-ups from #3810.
* fix(apigateway): return stored method, policy, and stage settings
Store and return method request parameters, the REST API policy, and stage
access log settings, tracing, and tags. These writes were accepted but never
saved, so Terraform planned the same changes on every run.
Support the patch paths Terraform uses for these fields.
Return the policy escaped the same way AWS does.
Tag stages by their own ARN instead of tagging the REST API.
Add REST regression coverage.
* test(apigateway): add Terraform compat test for REST read-back
Apply a REST API gateway module with Terraform, then check that it converges.
Check that the method, policy, and stage settings read back after apply.
Check that a second apply succeeds and the plan after it has no changes.
Check that changing a request parameter or a stage tag applies and re-plans clean.
Use the deployment trigger hash from the bug report, which used to fail with
"Provider produced inconsistent final plan".
* feat(ecs): route awsfirelens logs through a generated Fluent Bit router
Start the router first, point awsfirelens containers at the generated unix socket, and store firelensConfiguration as registered.
* feat(ecs): carry FireLens config through CloudFormation and aim outputs at Floci
AWS::ECS::TaskDefinition provisioning now keeps each container LogConfiguration and FirelensConfiguration, so a stack that registers a FireLens router reaches the same launch path as RegisterTaskDefinition.
The generated router points each awsfirelens output at Floci container-reachable base URL through Endpoint, and the app container awsfirelens log config uses fluentd-async, which Docker 28 accepts, instead of the removed fluentd-async-connect.
Only s3, cloudwatch and firehose receive that endpoint: they are the AWS-written Go plugins and parse the value as a URL. The upstream C plugins (cloudwatch_logs, kinesis_firehose, kinesis_streams) hand it to getaddrinfo as a bare host name and always dial TLS, with no output-level switch for either, so a URL is a guaranteed DNS failure on Fluent Bit 1.9 and 5.0.9 alike, and a bare host plus port only reaches Floci plain HTTP port before certificate verification fails. Those outputs keep whatever the task definition gave them.
* feat(ecs): support fluentd FireLens routers and s3-hosted FireLens config
A fluentd FireLens router is now acted on at launch instead of being stored and ignored. Floci generates the config the ECS agent generates for that type: unix and forward sources, a grep filter per include-pattern and exclude-pattern, a record_transformer filter for the ECS metadata, the include of an external config, and one match block per awsfirelens container keyed on its @type. Fluentd takes its output plugin name from the log option @type rather than Name, its tags end in ** rather than *, and it gets neither the healthcheck sections nor Mem_Buf_Limit, both of which the agent emits for Fluent Bit only. The router image is handed /fluentd/etc/fluent.conf, so the config archive contents and its destination directory are now chosen per router type.
config-file-type=s3 now reads the object from Floci's own S3 instead of ignoring the option, and writes it to the fixed external.conf path next to the generated config, /fluent-bit/etc/external.conf or /fluentd/etc/external.conf, which is where the agent mounts what it downloads. The object is read before any container is created, so a missing bucket or key stops the task with the agent's own wording as the stopped reason, Unable to download firelens s3 config file: unable to download s3 config <key> from bucket <bucket>: <detail>, rather than leaving a router running behind a task that already failed.
RegisterTaskDefinition enforces the same split ECS does. A Fargate-compatible task definition cannot take its config from S3, and is rejected with Fargate launch type does not support FirelensConfiguration config file from 's3'; a config-file-value that does not name an S3 object is rejected as Invalid arn syntax. An EC2-compatible task definition keeps s3, and a Fargate task can still source its config from S3 the way AWS documents, through the aws-for-fluent-bit init process and its aws_fluent_bit_init_s3_* environment variables, which ECS never inspects and Floci passes through. Floci serves no ECS task metadata endpoint, so that init path fetches nothing locally yet, which docs/services/ecs.md now states.
* fix(ecs): rejoin awsvpc tasks to the security-group namespace
The FireLens launch loop stopped calling withNetworkMode(container:<helper>)
and dropped the workload label, so prepareNetwork's ENI/nftables had nothing
to isolate. Cover the join with a firewallManager-wired unit test.
* test(ecs): assert FireLens router and app both join the SG namespace
* test(ecs): verify FireLens router and app lifecycle in SG namespace test
* refactor(ecs): reuse extractTaskId for FireLens cluster name
* docs(ecs): note the launchType/compatibilities gap next to FireLens S3
* docs(ecs): scope the FireLens TCP-listen rationale to non-shared namespaces
* fix(ecs): reject a FireLens type that is missing or not fluentd/fluentbit
AWS requires firelensConfiguration.type and accepts only fluentd or
fluentbit. parseFirelensConfiguration returned null for a missing type,
registering the container as if FireLens were absent, and persisted any
other string, so an unknown type only became ineffective later when
findFirelensRouter recognized neither value.
Both are now rejected at the RegisterTaskDefinition JSON boundary with
the smithy validation wording, and are covered in
EcsJsonHandlerRuntimePlatformLogConfigurationTest.
* fix(ec2): apply filters to transit gateway route table lookups
matchesFilter had no arm for TransitGatewayRouteTable, so every filter fell
through to the permissive default and DescribeTransitGatewayRouteTables answered
with every table in the region regardless of transit-gateway-id.
GetTransitGatewayRouteTableAssociations never read its filters at all.
A caller that filters associations down to its own attachment therefore sees
somebody else's, concludes its own association is missing, and tries to create
one, which then fails as Resource.AlreadyAssociated once a route table has more
than one attachment.
* fix(ec2): compare the association state in the associations filter
GetTransitGatewayRouteTableAssociations reports the association's state, so
routing its "state" filter through the shared attachment matcher compared the
attachment lifecycle state instead. Filtering on "associated" matched nothing
while "available" matched every association on the table.
* fix(ec2): limit the associations listing to its documented filters
GetTransitGatewayRouteTableAssociations models resource-id, resource-type and
transit-gateway-attachment-id. Forwarding the rest of the request into the
attachment matcher also honored transit-gateway-id, vpc-id, vpc-owner-id and the
tag filters, none of which AWS exposes on this action, and honored a state filter
it does not model at all.
Retaining only the three modeled names drops that surface, which also removes the
association state handling added earlier in this branch: the fix there was to stop
answering a filter AWS does not document rather than to answer it correctly.
* fix(ec2): apply the documented filters to the propagations listing
GetTransitGatewayRouteTablePropagations accepts resource-id, resource-type and
transit-gateway-attachment-id, but propagationsOf ignored filters entirely and
matchesFilter had no arm for TransitGatewayRouteTablePropagation. A caller that
narrows the listing to its own attachment got every propagation on the table
back instead.
Retaining only the modeled names also keeps the tag filters out. Those are
handled ahead of the per-resource arms and read getResourceTags, which has no
propagation case, so a tag:Name filter emptied the listing rather than being
ignored as an unmodeled filter. The associations listing models the same three
names, so the allowlist is one constant shared by both.
* chore(ec2): cover the transit gateway filter arms that had no test
The route table listing's state and transit-gateway-route-table-id arms, and
resource-id and resource-type on both the association and propagation listings,
read the right fields but nothing exercised them over the Query protocol.
Each now gets a matching and a non-matching value, so an arm that falls through
to the permissive default cannot pass. Verified by pointing each arm at a
plausible wrong getter and confirming the suite fails.
* feat(redshift): parse IAM_ROLE clause on COPY and UNLOAD
* feat(s3): add signed-principal authorization wrappers for role sessions
* feat(redshift): authorize COPY/UNLOAD S3 access through an IAM_ROLE session
* feat(redshift): thread IamService through the Redshift auth proxy chain
* test(redshift): cover IAM_ROLE resolution and signed authorization in prepareCopy
* fix(redshift): complete IAM_ROLE S3 authorization
* test(redshift): cover IAM_ROLE authorization end to end
* docs(redshift): document IAM_ROLE COPY and UNLOAD
* fix(redshift): retain IAM_ROLE session during COPY
* style(test): use Mockito static imports
* fix(native): initialize redshift copy simulator at runtime
* fix(redshift): address IAM role review feedback
* test(redshift): use valid proxy relay keys
* fix(redshift): require IAM roles to be associated
* test(compat): recover CodeArtifact create retries
* fix(redshift): parse IAM role location names
* fix(docs): exclude Redshift IAM role member label
* chore: remove unrelated CodeArtifact test