Commit Graph
2538 Commits
Author SHA1 Message Date
Abhigya 12e9cbd78b fix(apigateway): capture HTTP proxy greedy suffixes (#4980) 2026-10-02 21:49:47 -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
Kenshin Okinaka a68f8eab3a refactor(ses): move ListTenantResources into SesTenantService and drop unused resolveSuppressionReason (#4978) 2026-10-02 20:26:58 -04:00
Hector Ventura a95f4cee3d fix(cloudformation): reject non-integer target group ports and health check counts (#4970)
* fix(cloudformation): reject non-integer target group ports and health check counts

ElbV2CfnProvisioner turned a non-integer Port, HealthCheckIntervalSeconds,
HealthCheckTimeoutSeconds, HealthyThresholdCount or UnhealthyThresholdCount
into an unset value and created the target group anyway. The registry schema
types all five as integers and CloudFormation fails such a resource, so they
now fail with the same ValidationError the listener's Port and the rule's
Priority already raise. An absent value still reaches the service unset.

* fix(cloudformation): reject a literal blank target group integer, keep AWS::NoValue unset

Review on #4970: optionalInt treated a present blank value as absent, so
HealthCheckIntervalSeconds: "" still created the target group with the
service default, while CloudFormation's schema type check rejects a blank
string for an integer property. A literal blank in the template now fails
with the same ValidationError. A blank that an intrinsic resolves to stays
unset, because the engine resolves AWS::NoValue to blank and
Fn::If [cond, value, AWS::NoValue] is how templates drop the property.

The javadoc now says exactly that, including the one case still lenient (a
Ref to a parameter whose value is blank), and optionalInt parses directly
instead of passing parseInt a fallback it could never use. Both integer
checks share one error so the message cannot drift.
2026-10-02 20:19:28 -04:00
Hector Ventura be2998f2a2 fix(cloudformation): identify Lambda microVM images and network connectors by ARN (#4971)
* fix(cloudformation): identify Lambda microVM images and network connectors by ARN

Both registry schemas name the ARN as the primaryIdentifier, but Ref returned
the image name and the connector id. The physical id is now the ARN, and the
prior name is read from the Name attribute recorded at create time.

A network connector update created a new connector with a random client token
and leaked the old one. An update that keeps Name, the only createOnly
property, now goes through updateConnector; a changed Name creates a
replacement, and ReplacementCleanup deletes the displaced image or connector
once the update commits or restores it on rollback. A stack created when the
physical id was still the name or id records its cleanup before the id moves
to the ARN, so the entity it reuses is not marked displaced. Deletes tolerate
an entity that is already gone.

* fix(cloudformation): update every connector setting in place, roll it back, and replace on a dropped Name

Greptile on #4971 found three gaps in the network connector update path:

- An update that kept Name applied only subnets and security groups, so a
  changed OperatorRole, NetworkProtocol or AssociatedComputeResourceTypes
  reported success and changed nothing. UpdateNetworkConnector accepts all
  of them, so LambdaMicrovmsService.updateConnector now applies them (null
  leaves a value as it is), and both the REST controller and the
  provisioner pass them.
- The in-place update could not be rolled back: no replacement was
  recorded, so a later failure left the stack in UPDATE_ROLLBACK_FAILED with
  the attempted settings. The provisioner now snapshots the connector's
  settings before the update and restores them in rollbackUpdate, spending
  the snapshot only once the restore succeeded.
- Dropping an explicit Name reused the old named entity, while Name is
  createOnly and its removal replaces the resource. A prior name is now
  kept only when it has the shape generatePhysicalName gives this
  resource; a declared name that the template drops gets a generated one
  and the old entity is replaced. The check reads the name itself, so it
  holds across rollbacks and for stacks created before this change.
2026-10-02 20:18:30 -04:00
Allen Sanborn e25f488bf3 fix(backup): run scheduled job transitions in the caller's account (#4965)
startBackupJob and stopBackupJob schedule transitionJob, completeJob and
abortJob on the backup-job-scheduler executor. That thread has no request
context, so the account-aware job, recovery-point and vault stores, and
regionResolver.buildArn, all resolved the default account 000000000000.

A job started from any other account was therefore never found on the
scheduler thread: it stayed CREATED (or ABORTING) forever, no recovery
point was written, and the vault kept NumberOfRecoveryPoints=0, so
DeleteBackupVault's non-empty guard let the vault be deleted.

Capture the caller's account on the request thread and run each
scheduled body under RequestScopes.runAs, the idiom EcsService,
EksService and DynamoDbService already use for background work.
2026-10-02 19:53:01 -04:00
Hector Ventura 0bae2f0e35 fix(core): use the deployment region where Floci fell back to us-east-1 (#4974)
Seventeen code paths fell back to a hardcoded us-east-1 when the region was
missing, each escaped as a partition-literal follow-up. In a GovCloud, China,
ISO or EUSC deployment they minted ARNs, sent Cognito verification mail and
SMS, named MWAA containers, answered IMDS, polled Pipes sources and invoked
Scheduler targets in the commercial partition. Each now takes the region from
the resource itself (its ARN or stored region) and otherwise from the
deployment default:

- AppSync and Cost Explorer read RegionResolver's default region.
- Cognito sends verification messages from the pool's own region.
- Control Catalog takes the request region from RegionResolver.
- EKS takes the cluster region into the token-webhook path and VPC route
  programming, and mints pod identity association ARNs (and checks role
  partitions) from the cluster ARN with the deployment default otherwise.
- MWAA, Pipes and Scheduler default to the configured region.
- The IMDS identity document reports the configured availability zone, as
  the placement/availability-zone path already did.
- CloudHSM and DynamoDB drop fallbacks their callers never reach: the
  request region and the table ARN are always present.

Two literals stay, escaped with their real reason: the pricing snapshot file
Floci bundles, and EKS's last-resort region that only a test constructor
without a resolver or config reaches. No partition-literal follow-up remains.
2026-10-02 19:41:45 -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
Allen Sanborn 832bd97966 fix(apigateway): mark custom-domain routed requests so S3 virtual-host does not claim them (#4966)
A custom domain under the endpoint suffix (e.g. api.mycorp.localhost) was
rewritten to /execute-api/... by ApiGatewayCustomDomainFilter, then
S3VirtualHostFilter read the host as the dotted bucket "api.mycorp" and
prepended it to the path, so S3 answered NoSuchBucket.

ApiGatewayCustomDomainFilter now sets a server-side ROUTED_PROPERTY marker
when it rewrites, and S3VirtualHostFilter skips marked requests, the same
idiom already used for CloudFront distributions and Cognito custom domains.
2026-10-02 18:38:17 -04:00
Priamo Germosen b679fe2312 fix(s3): match a bucket policy's Principal the way IAM does in S3's own checks (#4961)
Follow-up from the reviews of #4838 and #4839.

S3 checks a bucket policy itself in two places, and neither matched its
Principal the way the IAM evaluator does since #4839:

- The signed-request check (s3.enforce-auth) passed the caller to the IAM
  evaluator as a bare ARN, so a role session was matched through a role ARN
  rebuilt from the session ARN, which drops the role's path. A bucket policy
  naming role/team/App never reached that role's sessions.
- The CopyObject/UploadPartCopy source check used S3's own matcher, which
  compared each AWS entry with the caller's ARN as a string. A grant to the
  caller's account, by id or root ARN, or to its role, never matched, so a
  cross-account caller allowed to read an object could not copy it.

Both now pass the typed caller to the IAM evaluator, a role session with the
ARN of the role it assumed, through a RequestPrincipal.caller factory the
enforcement filter now uses too. The copy check's own matcher is gone: its
direct-grant rules (an exact user ARN, or "*" with aws:PrincipalArn pinned to
it) are the IAM evaluator's, and the unit tests that pinned them there move to
IamPolicyEvaluatorTest. S3PublicAccessEvaluator keeps its principal matching
for CloudFront's origin access identity check.

A CanonicalUser entry matched nothing since #4839, and docs/services/iam.md
described that as AWS behaviour. The IAM User Guide ("AWS account principals")
lets an S3 bucket policy name an account by its canonical user ID, which the
S3 User Guide describes as an obfuscated form of the account ID. It now
matches the IAM identities of that account, as an account principal does.
Floci's canonical ID for an account is its account id, the owner ID its S3 ACL
responses report.

Integration tests (IAM and S3 enforcement, real SigV4) read and copy across
accounts under bucket policies naming the caller's account, a role under a
path, and the account's canonical ID; each fails on main. docs/services/iam.md
and docs/services/s3.md describe the matching.
2026-10-02 17:17:27 -05:00
Priamo Germosen 8581497b0a fix(secretsmanager): serialize DeleteSecret and a rotation's last save with the secret's other writes (#4962)
Follow-up from the review of #4873.

Every write to a secret goes through the same per-secret monitor, except two:
DeleteSecret, and the save that ends a rotation and records LastRotatedDate.
The in-memory store hands out the stored Secret object itself, so a delete
landing between that save's read and its write was undone by the write: a
secret deleted as its rotation finished came back. Both now take the secret's
lock, DeleteSecret resolving the secret again inside it as the other writes
do. A delete during the final save waits for it, and one before it makes the
rotation fail on a secret that is gone instead of restoring it.

The three rotation integration test classes also left what they created in
the shared emulator: rotation-other-region-secret, rotation-test-secret and
rotation-invalid-reference-secret under fixed names, and the rotate-* secrets
and sm-* users of the IAM-enforcement class. Each class now deletes what a test
creates after it. The IAM-enforcement class pushes each deletion as the
resource is created and runs them newest first, so a test whose setup stopped
partway deletes what it got to create, and a user's access key and inline
policy go before the user, as DeleteUser requires. A test that starts a
rotation waits, with a bounded poll, for DescribeSecret to report
LastRotatedDate before cleanup deletes the secret.

SecretsManagerWriteLockTest parks a write and checks that DeleteSecret waits
for an in-flight UpdateSecret and for a rotation's final save, and that the
secret stays deleted. Both fail on main.
2026-10-02 17:12:23 -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
Allen Sanborn 3e2d310eae fix(iam): return PermissionsBoundary from GetRole/GetUser and accept it on CreateRole/CreateUser (#4964)
CreateRole and CreateUser ignored the PermissionsBoundary parameter, and
roleXml/userXml never serialized a stored boundary, so GetRole/GetUser
(and the Create responses) returned none even after
Put{Role,User}PermissionsBoundary. Only GetAccountAuthorizationDetails
emitted it.

Emit the boundary on the detailed fragment only: ListRoles/ListUsers
document that they do not return PermissionsBoundary. The boundary is
validated before the role/user is created, so an unknown policy leaves
nothing behind. Existing createRole/createUser signatures are kept as
overloads for the CloudFormation and service-linked-role callers.
2026-10-02 17:51:50 -04:00
Allen Sanborn a4c952db54 feat(ec2): support Dedicated Hosts (AllocateHosts, DescribeHosts, ModifyHosts, ReleaseHosts) (#4816)
* feat(ec2): support Dedicated Hosts (AllocateHosts, DescribeHosts, ModifyHosts, ReleaseHosts)

terraform's aws_ec2_host failed at create with "Operation AllocateHosts is
not supported". Add the four host actions following the Capacity
Reservation pattern: region-scoped store, dedicated-host tags through
TagSpecification and CreateTags, released hosts kept in DescribeHosts with
state "released", and unknown ids as InvalidHostID.NotFound on describe.
ModifyHosts and ReleaseHosts answer per host, putting an unknown, released
or (on release) occupied host in the unsuccessful set rather than failing
the call.

RunInstances now honours Placement.HostId and Placement.Tenancy: the host
must exist, tenancy defaults to "host", the zone defaults to the host's,
and DescribeInstances reports placement.hostId. DescribeHosts lists the
instances placed on each host.

* fix(ec2): default AllocateHosts AutoPlacement to off and drop the non-AWS host-recovery filter

AWS documents AutoPlacement as defaulting to off; the host record defaulted it
to on. host-recovery is not a DescribeHosts filter in the EC2 API, so it is no
longer matched.

* fix(ec2): validate Dedicated Host zone, settings and launch placement, serialise release against launch

RunInstances now rejects a host placement whose zone, tenancy or instance type
contradicts the host, re-checked under a lock shared with ModifyHosts and
ReleaseHosts. AllocateHosts rejects unknown zones; on/off host settings are
validated on allocate and modify. The hosts store is final again, braces and
the Consumer import follow AGENTS.md, and the RunInstances mock matcher in
Ec2RunInstancesPublicIpParamTest gains the two host parameters.

* test(ec2): pin exact host placement error codes and the in-lock host re-check

* fix(ec2): validate AllocateHosts zone against modelled zones, import classes

* style(ec2): fix import order and hostLock indentation, match AWS occupied-host message

* style(ec2): put java.util.Arrays after the non-java imports in the dedicated host test

* style(ec2): brace the host tag update and host tag lookup conditionals
2026-10-02 17:18:58 -04:00
Allen Sanborn 5ad97781ef feat(kms): serve the AWS managed keys under alias/aws/* in every region (#4792)
* feat(kms): serve the AWS managed keys under alias/aws/* in every region

Every AWS account has a per-region AWS managed key for each service that
encrypts data on the account's behalf, published under a reserved
alias/aws/<service> alias. Floci had none, so a lookup that succeeds
against any real account failed here: DescribeKey on alias/aws/s3
returned NotFoundException and ListAliases returned nothing in that
namespace. Nothing declares these keys in a template, which is what made
their absence costly to diagnose. A module that leaves a service's
encryption at its default resolves one through a data source and fails at
plan time.

The catalog is data, in kms/aws-managed-keys.yaml, following the IAM
managed policy catalog: adding a service is a line there. A region's keys
are minted the first time anything reads that region's alias namespace,
which is ListAliases or a lookup naming one of the reserved aliases. That
mirrors AWS, where a service's key appears once the account first uses the
service, and it keeps an unused region free. Minting is idempotent, so the
ids survive a restart against persistent storage and ciphertext encrypted
under them keeps decrypting.

These are AWS's keys, not the account's, so DescribeKey now reports
KeyManager per key instead of the constant CUSTOMER it returned before,
GetKeyRotationStatus reports true for them, and the administrative
operations AWS reserves to a key's owner are refused with
AccessDeniedException: ScheduleKeyDeletion, CancelKeyDeletion,
PutKeyPolicy, UpdateKeyDescription, EnableKey, DisableKey,
EnableKeyRotation, DisableKeyRotation, RotateKeyOnDemand, TagResource and
UntagResource. The alias/aws/ namespace is reserved too: CreateAlias under
it is rejected with InvalidAliasNameException, and UpdateAlias or
DeleteAlias against one of these aliases with AccessDeniedException.
Cryptographic operations are unaffected, which is the point of the keys
existing.

Two deliberate simplifications, both documented: the key policy is the
standard account-root policy rather than the service-principal policy with
a kms:ViaService condition AWS attaches, and AWS distinguishes some of
those refusals as unsupported operations rather than access denials.

* fix(kms): seed only AWS managed keys, and rebuild them if the key store is lost

Five corrections to the alias/aws/* catalog and the code that mints it.

The catalog went from 40 entries to 23. An AWS managed key lives in the
customer's account and has an alias/aws/<service> alias; an AWS owned key
lives in an AWS-owned account and has no alias there, so DescribeKey on it
fails against a real account. Seeding the second kind makes a call succeed
here and fail against AWS, which is the worst error this emulator can
produce: a module looks compatible when it is not, and nothing reports it.
Seventeen entries could not be sourced to a customer-account context and
are gone, EKS among them, whose API-data envelope encryption uses an AWS
owned key by default. The YAML header now states the managed-versus-owned
test so the next line added has a bar to clear.

Minting is gated on the alias being present and the key that alias targets
being present, not on the alias alone. The two stores are different files
and PersistentStorage quarantines an unreadable one and starts that store
empty by itself, so a lost kms-keys.json used to leave every alias dangling
for the life of the instance: ListAliases advertised alias/aws/s3 while
DescribeKey on it reported NotFoundException. The catalog is in the
repository, so this is the one part of a damaged store that can rebuild
itself, and now it does.

ListKeys mints too. Real AWS returns the AWS managed keys from ListKeys
unconditionally, and a caller that reads ListKeys, then DescribeKey, then
filters on KeyManager saw them or not depending on whether something else
had read the alias namespace earlier in the same process.

Both stores are written once per region as a batch instead of once per
entry. PersistentStorage.put serialises the whole map, so the old path cost
two whole-file rewrites per catalog entry on the first read of every region,
while holding the mint lock. The aliases are written before the keys
deliberately: a crash between the two batches then leaves aliases whose
target is missing, which the gate above repairs, rather than keys with no
alias, which nothing repairs and which would sit in ListKeys forever.

CreateAlias and UpdateAlias no longer accept an AWS managed key as the
target. AWS excludes them, so a second alias on one of these keys is the
same false-pass shape as seeding a key AWS does not have. The refusal is
AccessDeniedException: it is an authorization outcome, the key's policy
grants the account nothing, and CreateAlias publishes no error code for
this case.

Two pre-existing tests asserted counts that ListKeys and ListAliases now
answer as AWS does; they select the customer-managed subset instead.

* docs(kms): group the AWS managed key catalog by the strength of its evidence

* fix(kms): drop alias/aws/elasticache and cite alias/aws/acm in the managed key catalog

The ElastiCache at-rest encryption guide describes the default as a
service managed key and serverless caches as using an AWS owned key; it
never names alias/aws/elasticache, so the entry failed the catalog's own
bar. The KMS ListAliases API reference prints alias/aws/acm with a
TargetKeyId in its example output, so acm joins the cited group.

* refactor(kms): fold requireCustomerManagedTarget into requireCustomerManaged

The two helpers had identical bodies. Also narrow the ensureAwsManagedKeys
Javadoc: writing aliases before keys helps only for a crash between the
two batches; losing kms-aliases.json alone still mints fresh keys and
orphans the old ones.

* fix(kms): refuse CreateGrant on AWS managed keys

An AWS managed key's policy allows kms:CreateGrant only via the owning
service (kms:ViaService), never to the account directly, so a direct
CreateGrant now gets AccessDeniedException like the other administrative
refusals.

* test(kms): concurrent cold reads mint each AWS managed key once

Sixteen threads read ListAliases on a cold region at once; the key store
must hold exactly the catalog's keys and each reserved alias must appear
once. Replacing the awsManagedKeyLock monitor with a fresh Object makes
this fail (138 keys minted against a 25-entry catalog).

* fix(kms): register the AWS managed key catalog for native and re-point squatted reserved aliases

- Add kms/*.yaml to quarkus.native.resources.includes. AwsManagedKeys reads
  kms/aws-managed-keys.yaml through a constant, which native resource
  analysis cannot follow (NativeImageResourceIncludesTest).
- Reconcile a reserved alias as present only when its target is an AWS
  managed key. A store persisted before alias/aws/ was reserved could hold
  alias/aws/s3 on a customer key, which DescribeKey then reported as
  CUSTOMER and the AWS managed key guards let through.
- When the alias store is lost but keys survive, re-alias the surviving
  AWS managed keys by description instead of minting a duplicate set.

* docs(kms): cite the sqs, sns, ses, s3 and ebs managed aliases
2026-10-02 17:09:12 -04:00
Cornelle Janse van Rensburg 39867e6bcb fix(stepfunctions): preserve Lambda service errors in tasks (#4845) 2026-10-02 16:48:32 -04:00
Allen Sanborn 6172451e0b feat(ec2): support DescribeIpamScopes (#4843)
* feat(ec2): support DescribeIpamScopes

CreateIpam already creates the private and public default scopes, but
DescribeIpamScopes answered UnsupportedOperation. Terraform's
aws_vpc_ipam_pool reads its scope through DescribeIpamScopes before
CreateIpamPool, so no IPAM pool could be created.

Accepts IpamScopeId.N (and IpamScopeIds.member.N, as DescribeIpams does)
and returns InvalidIpamScopeId.NotFound for unknown ids. Filter.N is not
supported.

* fix(ec2): report scope and IPAM on IPAM pools

The IpamPool shape carries ipamScopeArn, ipamScopeType, ipamArn and
ipamRegion, but pools were written without them. Terraform's
aws_vpc_ipam_pool Read splits ipamScopeArn on "/" and reads
ipamScopeType off the pool, so every refresh of a pool broke.

They are derived from the pool's scope and its IPAM, and omitted when
that scope is no longer visible.

* fix(ec2): count IPAM pools per scope in one pass; import XmlPath in test

* refactor(ec2): resolve IPAM scope lookup and its not-found error in one place
2026-10-02 16:42:25 -04:00
Simone Primarosa 548f4698c5 feat(eks): name cluster nodes after their EC2 instance (#4916)
* feat(eks): name cluster nodes after their EC2 instance

* fix(eks): prune legacy hostname nodes on finalize and test container recreation

* fix(eks): preserve active nodes when pruning legacy cluster nodes

* fix(eks): delimit jsonpath node records with newline outside condition range

* fix(eks): name nodes using EC2 private DNS name format and align synthetic instance

* fix(eks): implement DnsRecordSource to resolve node private DNS names

* fix(eks): prevent VPC forwarding rules from bypassing node private DNS resolution

* fix(eks): scope node DNS system rules to matching VPC only
2026-10-02 16:17:45 -04:00
danielxoi 73b8c6124c feat(lambda): bound the warm pool globally with LRU eviction (#4683)
* feat(lambda): bound the warm pool globally with LRU eviction

Adds warm-pool-max-per-function (replaces the hardcoded max(4, cpus)) and warm-pool-max-total (0 = unbounded). When the total would be exceeded, the least-recently-used idle container of any function is stopped before the released one is pooled, so the function that just ran keeps its container. Busy containers are not counted; their ceiling is region-concurrency-limit.

WarmPool now takes a Clock so LRU order and the idle sweep are testable without sleeping.

Closes #4682

* fix(lambda): warn when warm-pool-max-total is negative instead of treating it as unbounded

Math.max(0, value) turned -1 into 0, the documented opt-out, so a mistyped cap silently restored the unbounded pool. Resolve it like warm-pool-max-per-function: a negative value is logged and the total stays unbounded.

* docs(lambda): state the warm-pool peak bound per region

region-concurrency-limit applies independently in each region while warm-pool-max-total is emulator-wide, so a single sum understated peak container count with more than one active region. Describe the cap as an idle-only, emulator-wide bound and the peak as the cap plus in-flight invocations across every active region. Also document that a negative value is ignored with a warning.

* fix(lambda): do not stop a drained container again from the global cap eviction

evictIdleBeyond snapshots each idle deque, then removes the chosen handles under the pool lock. drainEnvironment and drainFunction detach the deque from the pool and stop its contents themselves, so a drain between the snapshot and the removal left the eviction holding the orphaned deque: remove(handle) still returned true and the container was stopped a second time. Check the deque is still the live one for its environment before removing from it.
2026-10-02 16:05:26 -04:00
Niels Kootstra 72788dfdb8 fix(eks): release the API server port when a cluster is deleted or fails to start (#4937)
stopCluster never returned the k3s API server port to the PortAllocator, so after about 100 create/delete cycles (the default 6500-6599 range) CreateCluster failed with "No free port" until restart. A start that failed after allocating its port leaked it the same way.

Release the port on delete and clear it from the cluster so a delete retried after a failed capacity-backup cleanup cannot free a port another cluster now holds. Release a newly allocated port when the launch fails; a port retained across a capacity restart still belongs to the surviving container and is kept.
2026-10-02 15:23:35 -04:00
Kenshin Okinaka 3597afda07 fix(ses): apply the v2 boolean coercion to the remaining boolean members (#4944)
* fix(ses): apply the v2 boolean coercion to the remaining boolean members

SigningEnabled, EmailForwardingEnabled, ReputationMetricsEnabled, an event
destination's Enabled, the account SendingEnabled and ProductionAccessEnabled
now coerce a JSON string the way SES v2 does instead of rejecting it with an
error of Floci's own. SigningEnabled, EmailForwardingEnabled and the account
SendingEnabled also accept a missing member as false, as SES v2 does, where
Floci required it.

* test(ses): create the event destination with "yes" so the create path is checked

* fix(ses): default a create-time ReputationMetricsEnabled to false when ReputationOptions omits it
2026-10-02 15:17:13 -04:00
Vũ Thế Huy 1d85e6bf6e fix(ecs): complete failed service deployment handling (#4874)
* fix(ecs): complete failed service deployment handling

* fix(ecs): address failed deployment review feedback

* fix(ecs): preserve rollback revisions across restarts

* fix(ecs): emit completion after service convergence

* fix(ecs): avoid duplicate completion events after upgrade

* fix(ecs): preserve completion event compatibility

* fix(ecs): read legacy deployment event state

* fix: report ECS rollback lifecycle and metadata

* fix: keep ECS deployment alarm metadata current
2026-10-02 14:09:33 -04:00
Vũ Thế Huy d7d2f73e99 feat(redshift): add external catalog statement parsing and metadata writers (#4679)
* feat(redshift): add external catalog statement parsing and metadata writers

* fix(redshift): harden external statement parsing and reference scanning

- Scanner: recognise dollar-quoted bodies, E'..\'..' strings and nested
  block comments; catch SELECT INTO, CREATE VIEW and CREATE INDEX writes;
  ignore FROM inside EXTRACT, SUBSTRING, TRIM and IS DISTINCT FROM.
- Parser: accept CREATE EXTERNAL SCHEMA IF NOT EXISTS, strip leading
  comments, support quoted names with dots, read TBLPROPERTIES and
  PARTITION values that contain parentheses or escaped quotes, validate
  IAM_ROLE as one quoted literal, and canonicalise Redshift type aliases
  to Hive types.
- Registry: percent-encode key parts so separators in identifiers cannot
  collide.
- Backend session: do not treat socket write failures as source read
  failures during COPY.
- Keep property order stable in statements.

* fix(redshift): address external catalog review findings

* fix(redshift): inherit omitted partition settings

* fix(redshift): preserve explicit empty partition settings

* fix(redshift): canonicalise character and varbyte external column types

* fix(redshift): default unsized character types

* fix(redshift): enforce Spectrum varchar default length

* fix(redshift): null surplus varchar values during Spectrum copy
2026-10-02 13:42:21 -04: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
Sam Fakhreddine a833551d03 feat(codepipeline): emit EventBridge state-change events and SNS approval notifications (#4616)
* feat(codepipeline): emit EventBridge state-change events and SNS approval notifications

Publishes pipeline, stage, and action execution state changes to the default bus and notifies NotificationArn topics for manual approvals.

* fix(codepipeline): match the approval message and event timestamps to the user guide

Mint the pipeline ARN with AwsArnUtils.Arn.of, publish the approval notification as the pipeline's account, emit expires and start-time as ISO-8601, add externalEntityLink, drop the dead console links, truncate the SNS subject to 100 characters, and use warnv.

* fix(codepipeline): restore the approval console links and keep event timestamp precision

consoleLink and approvalReviewLink point at the AWS console URLs from the user guide, expires is to the minute, and start-time keeps its milliseconds. Terminal event dispatch uses switch expressions.
2026-10-02 11:53:44 -04:00
Simone Primarosa 86c06247e3 feat(eks): support per-cluster kubelet and API server arguments (#4772)
* feat(eks): support per-cluster kubelet and API server arguments

* fix(eks): prevent security group leak and reject authorization-mode override

* refactor(eks): classify authorization-mode as refused argument

* fix(eks): strip modifier suffixes before collision validation
2026-10-02 11:16:31 -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
Kenshin Okinaka 5b6c53d0df fix(ses): coerce a v2 boolean string only when it names a boolean (#4887)
SES v2 accepts a JSON string for a boolean member only when it reads,
case-insensitively, as true/yes/y/t/1 or false/no/n/f/0; any other string
is a SerializationException. Floci turned every string into true, so
UnsubscribeAll "false" stored true. Affects UnsubscribeAll, SendingEnabled
and AutoWarmupEnabled.
2026-10-02 09:47:03 -04:00
Hector Ventura ae216f22a0 chore(core): gate comparisons of a partition with the literal "aws" (#4892)
* chore(core): gate comparisons of a partition with the literal "aws"

The five checks #4791 fixed compared a parsed ARN's partition with "aws", so
RDS, ElastiCache and RAM broke silently outside the commercial partition, and
make partition-check could not see them: a bare "aws" is not an arn:aws:
prefix. partition_literals.py gains a gated aws-partition-compare category,
scanned over the code with comments and text blocks blanked, that catches
"aws".equals(...), .equals("aws"), their equalsIgnoreCase forms and
Objects.equals with "aws". Run against main before #4791 it reports exactly
those five sites.

The three remaining uses compare an account, a command name and a reserved
SSM name prefix, not a partition, and are escaped with a reason. AGENTS.md
states the rule next to the other partition rules, so reviews flag it too.
The audit table sizes its columns to the longest category name.

Part of #4272.

* chore(core): end the Objects.equals match at its call and gate switch labels on "aws"

Greptile on #4892: the Objects.equals arm read past the call's closing
parenthesis, so foo(Objects.equals(a, b), "aws") matched a comparison that is
not there; each argument now allows one level of nested calls and the match
ends at the call's own parenthesis. And a switch on a partition branched on
"aws" without a match, so case labels naming "aws", alone or in a list, are
caught too. main has none, so no new escapes and the baseline stays empty.
2026-10-02 09:36:30 -04:00
Priamo Germosen 0460e51a6e refactor(core): move PEM reading out of ACM's certificate generator (#4878)
* refactor(core): move PEM reading out of ACM's certificate generator

parseCertificate, parsePrivateKey and isPair lived on
services.acm.CertificateGenerator, so anything needing to read a
certificate or key had to depend on ACM to do it. Six files across four
packages already did: config's TlsConfigSource, TlsCertificateManager and
FlociCertificateAuthority, plus IoT, the RDS proxy and ACM itself. None of
them has anything to do with ACM; they just wanted to parse a file.

Move the three to core.common.Pem as static methods and migrate every
caller. Generation stays on CertificateGenerator, which is genuinely ACM's;
only the reading side is shared. Being static also removes the need to
instantiate a generator purely to parse, which TlsConfigSource was doing.

CertificateGenerationException moves to core.common as
CertificateMaterialException, because core cannot throw a type that lives
under services.acm without recreating the inversion this removes. Nothing
outside ACM caught it, and it stays an unchecked RuntimeException, so the
rename is confined to ACM and its tests.

Behaviour is unchanged: the method bodies are the same, including the
sign-a-probe pair check that works for RSA and EC alike. The reading side
had no test of its own, having only ever been exercised through ACM's
generator, so PemTest now covers it directly: round trips, a matching and a
mismatched pair, EC as well as RSA, and the failure cases.

Prompted by IAM server-certificate support, which needs the same parsing
for UploadServerCertificate's MalformedCertificate and KeyPairMismatch. It
would have been the seventh caller reaching into ACM.

* test: drop generators the Pem migration left unused

Four test call sites still built a CertificateGenerator after their parse
calls moved to Pem: TlsCertificateHostnameTest's parseCertificate helper,
the learned-hostnames reissue test, and both RDS proxy trust-anchor tests.
None of them generates anything, so the instance goes.

Also drops the extra blank line left where IotMqttBrokerDeviceVerificationTest
lost its GENERATOR field, and updates the ApiGateway test comment that still
pointed at the generator's own parser.
2026-10-02 07:46:10 -05:00
Priamo Germosen a5379cd5d8 fix(secretsmanager): refuse a rotation function in another Region with InvalidParameterException (#4873)
Follow-up from the review of #4768.

A well-formed full function ARN in another Region passed the reference check,
then Lambda's lookup refused it with InvalidParameterValueException ("Region
'us-west-2' in ARN does not match request region 'us-east-1'") and RotateSecret
rethrew that unchanged. InvalidParameterValueException is not an error
RotateSecret declares, so an SDK client could not type the refusal.

The Region is now checked with the rest of the reference, before the caller's
lambda:InvokeFunction check, and refused with InvalidParameterException and
Lambda's reason in the message, like a reference Lambda cannot parse. Checked
only at the lookup, it came after the caller check, so under IAM enforcement a
caller not allowed to invoke that ARN got AccessDeniedException for a reference
that is invalid whoever sends it. Any other 400 Lambda gives at the lookup is
mapped the same way, through one helper; a missing function is still
AccessDeniedException and anything else still passes through. The secret is
left as it was.

Neither the Secrets Manager User Guide nor the API Reference says which error a
function in another Region gets, or that the function must share the secret's
Region. InvalidParameterException is the one RotateSecret declares for an
invalid parameter value.

An integration test runs RotateSecret against the real Lambda service with a
us-west-2 function ARN from us-east-1; it fails on main with
InvalidParameterValueException. Unit tests check the Region refusal comes
before the caller check and keeps a previously configured function, and that a
Lambda 400 at the lookup maps too. docs/services/secrets-manager.md describes it.
2026-10-02 07:45:59 -05:00
Aniket Shukla a82d8aacad fix(networkfirewall): honor dry run for rule groups and policies (#4799)
* fix(networkfirewall): honor dry run for rule groups and policies

* fix(networkfirewall): preserve update token on dry run
2026-10-02 08:29:26 -04:00
Vũ Thế Huy 60985b9a80 fix(cloudformation): skip unchanged resources during updates (#4442)
* fix(cloudformation): skip unchanged resources during updates

* fix(cloudformation): refresh dependent resources during updates (#4442)

* fix(cloudformation): support SQS rollback and scope dependent updates to replaced resources

- Implement replacement and in-place update rollback in SqsCfnProvisioner

- Scope dependent updates during stack update to only resources depending on replaced resources

- Compute and include dependent modified resources in ChangeSets to align DescribeChangeSet with execution

- Prevent unmodified resources such as S3 buckets from losing configuration when referenced resources update in-place

* fix(cloudformation): load create-only properties from schemas and handle condition changes

* fix(cloudformation): skip resources on outputs-only update and include create-only schema in native image

* fix(cloudformation): accurately assert unchanged queue events on outputs-only update

* fix(cloudformation): supply location constraint when creating nested stack templates bucket

* fix(cloudformation): revisit dependents on attribute changes and treat empty schema create-only lists as authoritative

* fix(cloudformation): preview in-place attribute dependents in changesets and support ASG rollback

- Include dependents of in-place modified resources with changed attributes in ChangeSet previews

- Snapshot and roll back in-place AutoScalingGroup updates on stack failure

- Implement LaunchTemplate update rollback to cleanly unwind launch template versions

* fix(cloudformation): restore ASG defaults during rollback

* fix(cloudformation): skip unchanged resources for empty updates

* fix(cloudformation): reconcile resources on identical updates and tolerate null attributes

* fix(cloudformation): skip unchanged resources on identical updates
2026-10-01 23:05:38 -04:00
Hector Ventura 2170c89d88 fix(lambda): include the resource namespace in code volume names (#4872)
* fix(lambda): include the resource namespace in code volume names

Code volumes, their completion markers and the populate helper container are
named through prefixedDockerName, so FLOCI_DOCKER_RESOURCE_NAMESPACE follows the
container name prefix as it already does for Lambda containers. Two namespaced
instances on one daemon no longer share a code volume, and one's superseded-volume
cleanup can no longer remove the other's. Names are unchanged without a namespace.

* fix(lambda): keep two resource namespaces from sharing a code volume

Greptile and pgermosen on #4872: a namespace and a function name may both
contain dashes, so namespace ci with function foo-code-bar and namespace
ci-code-foo with function bar spelled the same volume name for the same code,
and the superseded sweep, which works from a per-process map of names, could
remove the other instance's volume. A namespaced code volume name now ends with
a short hash of the namespace (names without a namespace are unchanged), and the
sweep checks the volume's floci_namespace label before deleting, so a volume of
another namespace is left alone however its name parses.

Also imports the Mockito types in ContainerLauncherCodeVolumeReuseTest instead
of qualifying them inline.
2026-10-01 23:00:33 -04:00
Hector Ventura 24c655050f feat(docker): give internal Docker labels io.floci.* names and keep the old keys as aliases (#4871)
* feat(docker): give internal Docker labels io.floci.* names and keep the old keys as aliases

Owner, ECS run, credentials-proxy, security-group and VPC network labels move to
io.floci.owner, io.floci.ecs.run, io.floci.ecs.credentials-proxy,
io.floci.security-group.helper/workload, io.floci.component and the standard
resource-identity keys. The previous keys (floci_owner_port, floci.ecs-run,
floci.ecs-task-role-credentials-proxy, floci.security-group-*, floci.component,
floci_component, floci_vpc_id, floci_vpc_region, floci_vpc_owner_port) are still
written as legacy aliases with the same value.

Readers take the new key first and fall back to the legacy one, label filters
query both key sets, and owner-scoped cleanup leaves an object alone when the two
disagree. All alias keys are reserved from extra-labels.

VPC networks are now owned by ownerIdentity (namespace and port) instead of the
bare API port, so two namespaced instances on the same port no longer reconcile
each other's networks.

* fix(ec2): keep pre-upgrade VPC networks of a namespaced deployment its own

Greptile and pgermosen on #4871: a VPC network created before the owner label
took the resource namespace carries only floci_vpc_owner_port with the bare API
port, so with a namespace set the deployment read its own surviving network as
a CIDR collision and the startup sweep left it behind. Such a legacy-only
network is now this deployment's when it holds this port and its
floci_namespace label names this deployment's namespace, the identity the new
io.floci.owner key encodes. Matching the bare port alone would also claim, and
let the sweep delete, the pre-upgrade networks of another namespace on the same
port.

Also imports List in ContainerStorageHelperTest instead of qualifying it inline.
2026-10-01 22:59:57 -04:00
XuJian bcb50b765f feat(cloudformation): provision Transfer Family servers (#4809)
* feat(cloudformation): provision Transfer Family servers

* fix(cloudformation): clear Transfer update snapshot after success

* test(cloudformation): cover Transfer tag rollback

* fix(cloudformation): match Transfer server return values
2026-10-01 22:28:47 -04:00
Priamo Germosen 2bdfe45207 fix(iam): match a resource policy's Principal by the kind of caller it names (#4839)
IamPolicyEvaluator matched a resource policy's Principal against one string,
the caller's ARN, and compared every principal type other than AWS and "*"
with it by glob. So {"Service": "*"} and {"Federated": "*"} matched every IAM
caller: under enforcement a bucket policy granting {"Service": "*"}, a form AWS
does not accept at all, let an IAM user from any account read the bucket.
Services could not be passed as a caller at all, so {"AWS": "*"}, which AWS
itself relies on to cover services (an FIS Deny pausing DynamoDB replication
names the replication service that way), could not match one. And a role
session matched a Principal naming its role only through a role ARN rebuilt
from the session ARN, which drops the role's path, so a policy naming
role/team/App never matched that role's sessions.

A new RequestPrincipal carries the kind of caller (IAM, service, anonymous),
and for a role session the ARN of the role it assumed. Each principal type now
matches only the callers it can name (IAM User Guide, "AWS JSON policy
elements: Principal"): "*" anyone; {"AWS": "*"} IAM identities and services;
any other AWS entry IAM identities only, a role session matching through its
role's own ARN; {"Service": "<name>"} that service exactly; {"Service": "*"}
nothing; Federated and CanonicalUser never an IAM caller. NotPrincipal is typed
the same way. The direct-IAM-user branch and the aws:PrincipalArn stand-in for
a missing caller stay IAM-only.

A new evaluateResourcePolicyFor takes a RequestPrincipal; the existing String
evaluateResourcePolicy reads its argument as an IAM caller and delegates to it.
The typed method has its own name rather than being an overload of the same
arity, so a call passing a literal null caller to the String form still
compiles. A new
evaluateServicePrincipal decides a call a service makes on its own behalf from
the resource policy alone, since a service principal has no identity policy,
boundary or session policy and SCPs do not apply to it: Deny denies, Allow
allows, silence denies. Nothing calls it yet; the shared service-call
authorizer will.

The enforcement filter now passes the typed principal, with a role session's
role ARN from IamService.resolveCallerArns, to both resource-policy
evaluations. S3's own bucket-policy checks still go through the String
overload; giving them the role ARN follows the change that splits the two ARNs
there.

docs/services/iam.md describes the matching rules.
2026-10-01 21:18:26 -05:00
Priamo Germosen b512d273e1 fix(s3): give a role session's aws:PrincipalArn as its role's ARN in S3's bucket-policy checks (#4838)
Follow-up from the review of #4810.

S3 evaluates bucket policies itself in two places: the signed-request check
(authorizeSignedBucketPolicy, behind s3.enforce-auth) and the CopyObject and
UploadPartCopy source check (signedPrincipalResourcePolicyDecision). Both took
the caller from S3Service.resolvePrincipalArn, which read IamService
.resolveCallerArn, so for a role session the same value, the assumed-role
session ARN, served both as the principal a policy's Principal is matched
against and as aws:PrincipalArn. AWS puts the ARN of the role that was assumed,
path included, in aws:PrincipalArn, as the enforcement filter does since #4810.
A bucket-policy Deny keyed on the session ARN therefore fired, and refused the
read or the copy, where AWS would not apply it.

S3 now reads both through IamService.resolveCallerArns, added in #4810: the
caller ARN still drives Principal matching and the same-account test, and the
principal ARN fills aws:PrincipalArn. A key IAM does not know keeps S3's
account-root fallback, which is both. The private helper is renamed
resolveCaller, so it is not mistaken for IamService.resolvePrincipalArn.

S3BucketPolicyEnforcementIntegrationTest gets a role under /team/ whose
session reads and copies from a bucket with two Denies: one keyed on the role's
ARN, which refuses it, and one keyed on the session ARN, which does not. It
fails on main, where the read the session-ARN Deny should not touch gets 403.
2026-10-01 21:18:14 -05:00
Priamo Germosen cd89be4a80 fix(codeartifact): treat identical-content maven redeploy as idempotent (#4837)
Reposilite's own redeployment:false setting rejects a redeploy to an
existing GAV path unconditionally, even when the new content is
byte-identical to what is already there (confirmed against a real
instance). AWS's own CodeArtifact docs ("Overwriting package assets"
in the packages overview) say a republish of an asset whose content
matches what is already published succeeds because the operation is
idempotent; only a genuine content mismatch is a real conflict.
Reposilite has no content-aware mode of its own, so this fetches the
existing artifact first and short-circuits to a 200 on an exact match
rather than ever sending Reposilite a PUT it would reject regardless
of whether the retry was actually harmless.
2026-10-01 21:18:01 -05:00
Priamo Germosen c7bb03ace3 feat(iam): model virtual MFA devices with real TOTP verification (#4820)
Replace the ListMFADevices stub with the virtual MFA device lifecycle:
CreateVirtualMFADevice, ListVirtualMFADevices, DeleteVirtualMFADevice,
EnableMFADevice, DeactivateMFADevice, ResyncMFADevice, ListMFADevices,
and the device tag readers/writers.

The seed is real rather than a placeholder. CreateVirtualMFADevice
generates a 160-bit secret from SecureRandom and returns it as an RFC
4648 base32 string, and EnableMFADevice/ResyncMFADevice verify codes
against it as RFC 6238 TOTP, so a caller that does not hold the seed
cannot enable a device. The codes must be consecutive, as AWS asks for.
Implemented on the JDK's own javax.crypto, with no new dependency.

The TOTP arithmetic is the shared core.common.Totp primitive (#4814):
CognitoTotp keeps its single-code window and attempt budget, and
VirtualMfaCodes holds the consecutive-pair rule that is specific to IAM.

Request shapes are validated against the wire model before the device is
resolved, so a malformed SerialNumber is a ValidationError rather than a
NoSuchEntity, and UserName is enforced as required on Enable and Resync.
VirtualMFADeviceName gets its own validator because it is the one IAM
name type with no documented maximum length, so borrowing the usual
1-to-128 name check would have rejected names AWS accepts.

Device state also reaches the places that report on it: DeleteUser now
returns DeleteConflict while a user still holds a device, GetAccountSummary
counts devices and their assignments, and the credential report's
mfa_active column is backed by real state instead of a constant.

Documented as out of scope: QRCodePNG is not returned (it needs a QR
encoder, and the otpauth URI it encodes is derivable from the seed that
is returned), GetMFADevice takes only FIDO security key ARNs, hardware
and FIDO devices are not modeled, MFA still has no effect on
authorization because the aws:MultiFactorAuth* keys are never populated,
and STS does not accept SerialNumber/TokenCode.
2026-10-01 21:17:50 -05:00
Priamo Germosen 44e9b1600e fix(secretsmanager): refuse an unreadable rotation function reference with InvalidParameterException (#4768)
Follow-up from the review of #4709.

A RotationLambdaARN that Lambda's reference parser cannot read was refused
with Lambda's own error, InvalidParameterValueException for a malformed
reference or ValidationException for a name outside the FunctionName pattern.
Neither is an error RotateSecret declares: its four are ResourceNotFoundException,
InvalidParameterException, InternalServiceError and InvalidRequestException,
so an SDK client could not type the refusal. It is now Secrets Manager's
InvalidParameterException ("The parameter name or value is invalid.", HTTP 400),
with Lambda's explanation kept in the message.

The unit test that pinned the old code used a Region-prefixed partial ARN,
which Lambda's documented FunctionName pattern accepts even though Floci's
parser does not yet. It now uses references that are invalid under that
pattern too: an empty function name, a character the name pattern excludes,
and an empty qualifier. They cover both of Lambda's codes. An integration test
checks the error type on the wire.
2026-10-01 21:17:37 -05:00
Kenshin Okinaka 62bcfb95ed fix(ses): refuse a list token whose scope only starts with the request's (#4870)
* fix(ses): refuse a list token whose scope only starts with the request's

A tenant-list token named its scope by plain concatenation, so a scope that
began with another one, which a name containing the token's own separator can
do, passed the prefix check and was read as a position in the wrong list. The
token now carries the scope's length.

* test(ses): replay a list token on a resource whose name it starts with

Cover the scope fix through ListResourceTenants itself: a token issued for an
identity whose name continues another identity's with the token separator is
refused on the shorter one and still continues its own list.
2026-10-01 21:05:34 -04:00
Hector Ventura d72923ab33 fix(core): compare ARN partitions with the resource's region, not the literal aws (#4791)
* fix(core): compare ARN partitions with the resource's region, not the literal aws

Part of #4272 (P10b). Running the Java SDK suite against a Floci deployed in
cn-north-1 (#4790) found five checks comparing a parsed ARN with "aws" and a
seeded ARN fixed to the commercial partition:

- RdsService.hasRdsResourceIdentity required partition aws, so DB instances,
  clusters, DB and cluster snapshots and subnet groups created outside aws
  failed their own ownership check and were not found right after creation.
  The proxy target group check had the same comparison, and CopyDBSnapshot
  refused any source ARN outside aws; it now requires the target region's
  partition, since a snapshot copies within its partition.
- ElastiCache ListTagsForResource rejected every arn:aws-cn: ARN; it now
  expects the request region's partition and names it in the message.
- RAM ignored organization principals outside aws; any published partition is
  accepted, the organization id ties the principal to the caller's.
- The seeded IAM Identity Center instance was arn:aws:sso:::instance/... in
  every deployment, so China permission sets never found it. It now takes the
  partition of the deployment's home region, and AddRegion compares against
  the instance's own primary region instead of a fixed us-east-1.

* fix(sso): move a persisted bootstrap instance to its partition, and drop the fixed China allowlist entries

Greptile on #4791: a deployment persisted before the seeded instance took its
partition keeps it as arn:aws:sso:::instance/..., while its permission sets were
already minted in the instance's own partition, so the fix would not reach it.
ensureBootstrapInstance now rewrites a stored bootstrap instance whose ARN is
not in its primary region's partition.

pgermosen on #4791: with #4790 on main, the cn-north-1 allowlist entries this
fixes would turn stale and fail the nightly. Measured against this branch in
cn-north-1: CloudFormationRdsDynamicReferenceTest, the ten RdsControlPlaneTest
entries, RdsJdbcCompatTest#createDbInstanceAndConnectWithPassword and
SsoPortalTest now pass and are deleted. The four IAM-token connection tests
still fail because they sign their tokens for a pinned us-east-1, which a
cn-north-1 database rightly refuses; they move to the group of tests that pin
commercial values.

* fix(ram): answer the listing operations for the request's region only

Greptile on #4791: with organization principals accepted in every partition,
a commercial GetResourceShares from a member of the organization returned a
China share. The cause predates this PR: GetResourceShares, ListResources,
ListPrincipals and GetResourceShareInvitations walked every stored share, so
a share created in eu-west-1 was listed through us-east-1 too, while a
resource share is a regional resource. RamController now passes the request
region and the four operations keep only shares (and invitations to shares)
in it, which also keeps a share out of another partition.

* fix(ram): resolve a share or invitation to mutate in the request's region only

pgermosen on #4791: after the listings were scoped to the request's region,
findOwnedShare still walked every stored share, so a share invisible to
GetResourceShares in one region could still be deleted, updated, associated,
disassociated or retagged from there; AssociateResourceShare would add a
resource the same endpoint's ListResources does not report. Accept and
RejectResourceShareInvitation had the same gap.

The six share mutations and the two invitation responses now take the request
region from RamController and resolve only a share or invitation in it: one
from another region gets UnknownResourceException or
ResourceShareInvitationArnNotFoundException, like an ARN that does not exist.
2026-10-01 21:00:35 -04:00
Simone Primarosa 9840b5a998 feat(eks): link containerd certs directory for launch template registry hosts (#4265) 2026-10-01 19:55:53 -05:00
danielxoi b5f053c587 fix(cloudformation): forward ProviderARNs on AWS::ApiGateway::Authorizer (#4704)
The REST API Gateway provisioner never read ProviderARNs, so a COGNITO_USER_POOLS authorizer was created with no user pool and CognitoUserPoolAuthorizer rejected every token with 401 before inspecting it. Resolve the list like the other list-shaped properties and forward it as providerARNs, which createAuthorizer already accepts.
2026-10-01 20:40:14 -04:00
Hyun Lee 9c3593f4d1 fix(cloudformation): reject more than one endpoint type on a RestApi update (#4728)
* fix(cloudformation): keep AWS::ApiGateway::RestApi on stack updates

UpdateStack runs provision again for every resource, and the RestApi
arm called CreateRestApi unconditionally. Each update minted a new API,
pointed the stack at it and left the previous one behind, so the API id
and invoke URL changed on every deploy.

No RestApi property requires replacement, so an update now keeps the
API from the previous provision and patches it in place:
- Name and Description go through UpdateRestApi, and a template without
  Name keeps the name the API has.
- A changed EndpointConfiguration is applied through the UpdateRestApi
  paths AWS documents for it, replace /endpointConfiguration/types/<type>
  and add or remove /endpointConfiguration/vpcEndpointIds, which
  UpdateRestApi now accepts under the rules CreateRestApi applies.
- A Body or BodyS3Location is resolved before anything changes and is
  still applied with PutRestApi in overwrite mode.
- RootResourceId comes from the API's root rather than the first
  resource listed, which is the root only on a freshly created API.
- An API removed out of band is created again, as a replacement that a
  rollback deletes.

The name, description and endpoint configuration are snapshotted before
the patch, so a later resource that fails the update puts them back, and
so does a Body that PutRestApi rejects. An update that re-applied a Body
still reports that rollback is not implemented: PutRestApi replaced the
API's resources, methods and models, which the snapshot does not hold.

The Resources and Methods on the kept API rely on the update and delete
handling from #4511.

* fix(apigateway): accept the index form of the endpoint type patch path

UpdateRestApi took replace /endpointConfiguration/types/<type> only
when the path named the API's current type, as the API Gateway guide
writes it. Terraform sends /endpointConfiguration/types/0 instead,
which AWS accepts too, and Floci answered it with a 400. An API has
exactly one endpoint type, so index 0 is accepted as well.

* fix(cloudformation): reject more than one endpoint type on a RestApi update

CreateRestApi rejects an EndpointConfiguration with more than one type,
but an in-place update of AWS::ApiGateway::RestApi used the first type
and reported success. The provisioner now rejects the list before it
changes anything, with the same BadRequestException as CreateRestApi,
and the stack rolls back with the API unchanged.

* fix(cloudformation): delete a recreated RestApi whose OpenAPI body is rejected

An update that recreates an API removed out of band, and whose Body
putRestApi rejects, left the new API behind. After the failed update the
stack keeps its previous resource, so nothing tracked the new API. The
provisioner now deletes it before it reports the failure.

* fix(cloudformation): list a recreated RestApi that cannot be deleted for cleanup

When the delete of an API recreated by a failed update also fails, list
that API for the next cleanup, which the restored resource inherits,
and report the rollback failure, as Ec2NetworkCfnProvisioner does for a
failed undo.

* refactor(cloudformation): log the failed RestApi cleanup with warnv

Use JBoss Logging's parameterized form, as AGENTS.md requires.
2026-10-01 20:28:35 -04:00
Michał Łomnicki cbc4cf9b91 fix(apigatewayv2): allow an idempotent override-id tag on UpdateApi (#4602)
* fix(apigatewayv2): allow an idempotent override-id tag on UpdateApi

A CloudFormation update resends the template's full tag set, so an
AWS::ApiGatewayV2::Api that pinned its id with floci:override-id failed
every stack update with "Reserved tag key floci:override-id can only be
supplied during resource creation" and rolled back.

UpdateApi now passes the api id to the reserved-tag guard, which already
treats an override equal to the existing id as a no-op (as TagResource
does since #3430), and stores the tags with the override keys stripped.
A different override value is still rejected.

docs/services/api-gateway.md now says a changed override is rejected on
TagResource and UpdateApi while resending the current id is accepted.
The TagResource half has been true since #3430 but was never documented.
CloudFormationIntegrationTest covers a stack update that resends the
pinned id and one that changes it.

* fix(apigatewayv2): validate UpdateApi tags before applying any field

UpdateApi set the name, description and other fields before the
reserved-tag guard ran, so a request it rejected had already changed the
stored API. A CloudFormation update that changed an api's override id
rolled back with the stack reporting UPDATE_ROLLBACK_COMPLETE while the
api kept the rejected update's description.

The guard now runs first, so a rejected update leaves the api as it was.
The CloudFormation test checks the description and tags after the
rollback.
2026-10-01 19:54:15 -04:00
Hyun Lee 955264cf5d fix(ecs): send container logs to the task's account (#4833)
The awslogs streamer was attached without an account. The lines are
forwarded from Docker's log threads, which have no request context, so
putLogEvents resolved the default account. In any other account the log
group and stream had been created in the caller's account, and every
line was dropped.

Attach with the account of the task's ARN, as Lambda, EKS, MSK and RDS
already pass theirs.
2026-10-01 19:45:10 -04:00
Goooooooooody 2316b2fc28 feat(appconfig): serve feature flag variants to the AppConfig Agent as Amazon Ion (#4674)
* feat(appconfig): serve feature flag variants to the AppConfig Agent as Amazon Ion

The AWS AppConfig Agent evaluates multi-variant feature flags itself: it asks
AppConfigData for application/ion;type=AWS.AppConfig.FeatureFlags and gets each flag's
variants and rules back as Ion. Floci returned the stored JSON document unchanged, which
the agent cannot read, so every variant flag failed with NoSuchFlag.

A caller that accepts that type now gets the Ion stream AWS sends: a symbol table
importing AWS's ops and anns tables, then a list per flag holding its variants (name,
rule, attributes) and its default. Rules of the form (eq $attribute "value") are encoded;
any other is left to the existing JSON path with a warning. The encoding reproduces a
captured AWS response for a real 22-flag profile byte for byte.

* fix(appconfig): honour q=0 for Ion, label the stored content type, read the stream back in tests

An Accept of application/ion;type=AWS.AppConfig.FeatureFlags;q=0.0000 was treated as
acceptable; any run of zeros now means the caller rejects it.

The content type of a response was inferred from its first bytes. It now comes from the path
that produced them, so a profile that is not a feature flag profile keeps its stored type
even if it holds Ion and the caller accepts the feature flag type.

The tests decode the stream with Amazon's ion-java (test scope), with the ops and anns
shared tables registered, instead of checking the encoder against itself.

* fix(appconfig): encode a basic flag in an Ion profile as an annotated string

AWS sends a flag without variants in the Ion format as its retrieval-time JSON, annotated with
its key, not as a list holding a default variant. The encoder now does the same, reusing the
JSON path's per-flag conversion, so a profile that mixes variant and basic flags reads as AWS's.

The encoder and docs cite the layout AWS documents for the agent's local development
mode rather than the captured responses.
2026-10-01 19:30:18 -04:00