Commit Graph
2569 Commits
Author SHA1 Message Date
vamsiakandVamsi Akavarapu f074dd3c40 feat(lambda): allow per-runtime image reference overrides (#4552)
* feat(lambda): allow per-runtime image reference overrides

* test(lambda): cover runtime image YAML configuration

* docs(lambda): show quoted runtime image env key

* test(lambda): verify quoted runtime image env key

---------

Co-authored-by: Vamsi Akavarapu <16164447+vamsiak@users.noreply.github.com>
2026-10-03 15:46:28 -05:00
Matheus Oliveira b112c62949 fix(lambda): pass ClientContext to synchronous invocations (#5014)
Emit Lambda-Runtime-Client-Context from the decoded X-Amz-Client-Context header.

* Fix #4968

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-10-03 15:16:00 -05:00
Mario Toffia ae0a591bb1 feat(cognito): provision user pool users (#4805)
* feat(cognito): provision user pool users

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

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

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

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

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

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

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

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

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

* test(wafv2): cover ResourceArn replacement and read stack outputs with XmlPath
2026-10-03 15:01:18 -05:00
Mario Toffia 7ebbe868ca fix(route53): store CloudFormation record names fully qualified (#4734)
* fix(route53): store CloudFormation record names fully qualified

Route 53 always stores and lists a record name fully qualified, ending in a dot, even when the request leaves the dot off. Floci's ChangeResourceRecordSets API already adds the dot, but an AWS::Route53::RecordSet created through CloudFormation was stored exactly as the template wrote it, so ListResourceRecordSets returned it without the dot. The CloudFormation provisioner now stores the dotted name and compares dotted names when it looks up a record to replace on update or remove on stack delete. The resource's Ref is unchanged and still returns the name as the template wrote it.

* fix(route53): create CloudFormation record sets instead of upserting them

An AWS::Route53::RecordSet was always written with an UPSERT, on stack create as well as update. A stack could therefore overwrite a record that someone had already created through the Route 53 API under the same name, and deleting the stack then removed that record too.

Real CloudFormation sends CREATE for a record the resource does not own yet, so the stack fails with "already exists" and the other record is left alone. The provisioner now does the same: it sends CREATE on stack create and on an update that changes the record's zone, name, type or set identifier, and keeps UPSERT when an update re-applies the record it already wrote. A failed create records no zone and no physical id, so neither the rollback nor a later DeleteStack touches the existing record.

* fix(route53): treat a blank CloudFormation SetIdentifier as no identifier

A record set whose template gave SetIdentifier as an empty string was written with that empty identifier, but the value saved for later updates and deletes dropped it. The next ordinary UpdateStack therefore saw a different record, sent CREATE, and failed as a duplicate. DeleteStack also looked for a record without an identifier and left the empty-identifier record in the zone.

Route 53 requires a set identifier of at least one character, so the provisioner now reads a blank SetIdentifier as absent. The written record, the saved value and the update comparison then agree. The class and change comments now also say that an update keeping the same record sends UPSERT, which replaces whatever record holds that identity.

* fix(route53): match CloudFormation records an earlier version stored as written

Before this branch, the provisioner stored a record set with the template's Name and SetIdentifier as written, so an undotted name or an empty identifier. With persistent storage that record survives an upgrade, and the stricter lookup no longer matched it: DeleteStack and a rename left it in the zone, where it blocks the zone's own delete. An update keeping the same identity sent a fully qualified UPSERT, which the zone stored beside the old copy instead of replacing it.

The lookup now compares names fully qualified on both sides and reads a blank SetIdentifier as none, so it finds the old record. After a same-identity UPSERT, the provisioner deletes any copy of the identity that is not stored in the canonical form it just wrote.

* fix(route53): treat a trailing dot and a blank set identifier as the same record

Route 53 treats a record name with or without the trailing dot as the same record, and requires a set identifier of at least one character. The service compared both literally, so a record an earlier CloudFormation provisioner stored with the template's undotted Name or empty SetIdentifier could sit beside the fully qualified form: a CREATE of the dotted name succeeded instead of failing as a duplicate, and an UPSERT added a second record instead of replacing the first.

The CREATE, UPSERT and DELETE checks now share one identity comparison, sameRecord, which compares names fully qualified and reads a blank set identifier as none. The CloudFormation provisioner's record lookup uses it too, so DeleteStack and a rename find a record stored either way. This replaces the provisioner's own legacy-copy cleanup, which deleted any non-canonical copy without knowing who owned it, and could remove another stack's record.

* fix(route53): remove one record per DELETE

An earlier version compared record names literally, so persistent storage can hold the same record both undotted and dotted, possibly for two owners, with the same values. Now that DELETE matches both forms, removing every match would also delete the other owner's copy. A DELETE now removes a single record, preferring the copy named exactly as the request names it.

* fix(route53): find the CloudFormation record named as its physical id first

An earlier version stored a record's name as the template wrote it, and could leave another owner's copy in the other form beside it. The lookup for stack delete and rename took the first record with the same identity, and the zone listing sorts the undotted copy first, so it could delete the other owner's record. It now prefers the record named exactly as the physical id, and falls back to the identity match for records this version wrote fully qualified.
2026-10-03 15:01:09 -05:00
Sam Fakhreddine 1531537559 fix(docker): retry transient daemon I/O at the transport seam and split streaming pools (#4614)
Under fan-out load the single Docker socket drops connections mid-call
(Broken pipe, Connection reset) and the operation fails. Split out of #2707.

- Retry transient I/O at the transport: RetryingDockerHttpClient retries
  replay-safe control-plane calls with capped backoff (policy in
  DockerRetry). Interrupted I/O is not retried, except
  SocketTimeoutException, and the interrupt flag is kept.
- Split log-follow streams onto their own @StreamingDocker client and pool
  (floci.docker.streaming-max-connections, default 512) so they cannot
  starve create/start/stop calls. Exec and wait streams stay on the main
  pool for now.
- Adopt the container a replayed named create already made (409 matched by
  a per-attempt label) instead of failing and leaking it. Unnamed container
  creates, network creates, restart and network connect/disconnect are
  never replayed.
- Retry tar copies at the call site with RetryingTarCopier (Lambda
  launcher, EC2 authorized_keys, EKS webhook kubeconfig and registries.yaml,
  MWAA); a local tar-writer failure is reported at once.
- Send Connection: close on control-plane requests, since the Apache
  transport reuses pooled sockets the daemon has already closed (Podman).
  Hijacked requests and the streaming pool are unchanged.
2026-10-03 14:56:35 -05:00
Kenshin Okinaka 32f2788c9c fix(ses): serve the POST list bindings and Filter of ListEmailIdentities and ListConfigurationSets (#5010)
* fix(ses): serve the POST list bindings and Filter of ListEmailIdentities and ListConfigurationSets

Since AWS SDK for Java 2.55.8 and botocore 1.43.105 the SES v2 model sends
ListEmailIdentities as POST /v2/email/list-identities and ListConfigurationSets
as POST /v2/email/list-configuration-sets, each with a new Filter member.
Floci only served the GET bindings, so these lists failed for current SDKs.

Both lists now answer on both bindings. The filter follows real SES, probed
on 2026-10-03: what it matches, its validation messages and their precedence,
and a NextToken that continues only the filter it was taken with. The filter
is applied before the page is cut, so filtered pages are exact.

* fix(ses): bind identity list tokens to an unambiguous filter scope

A name filter of "null" produced the same token scope as an absent name, so a
token from one filter continued the other. The scope now leads with the type
and status, which never hold the separator, and ends with the name. The name
filter also runs before the status refresh, so domains it excludes are not
checked against Route 53.

* docs(ses): mark the GET list bindings as the pre-Filter ones
2026-10-03 15:52:01 -04:00
David 9c49ecf255 feat(rds): restore DB instances and clusters to a point in time (#4963)
Serve RestoreDBInstanceToPointInTime and RestoreDBClusterToPointInTime,
and report the restorable window: LatestRestorableTime on
DescribeDBInstances, EarliestRestorableTime and LatestRestorableTime on
DescribeDBClusters.

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

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

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

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

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

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

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

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

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

* chore(lambda): say why the durable compat test ignores a failed cleanup
2026-10-03 14:35:12 -05:00
Priamo Germosen 583b2baf7f feat(codeartifact): bridge GetPackageVersionAsset to Maven, npm, and pypi sidecars (#5019) 2026-10-03 14:35:03 -05:00
Priamo Germosen 2e87534941 fix(s3): complete multipart uploads larger than 2 GiB in disk storage modes (#4976)
CompleteMultipartUpload built the whole object as one byte array, so an
object over Integer.MAX_VALUE bytes failed with an ArithmeticException,
and anything smaller still needed the full object in the heap.

In the persistent, hybrid and wal modes the parts are now copied file to
file into one assembled file in the upload's directory, before the bucket
lock is taken, and that file is renamed into place under the lock. A
versioned bucket hard-links the current file to the versioned one rather
than writing a second copy, which is safe because object files are only
ever replaced by a rename, never modified in place.

The full-object checksum is combined from each part's CRC and size,
which is how S3 linearizes full-object checksums and why it offers them
only for the CRC algorithms, so the object's bytes are never read for it
and a mismatched expected checksum is rejected before assembly.

Since the ETag and checksum now come from the part records, each
UploadPart stores its bytes under its own storage ID kept on the record
and drops the bytes it replaced only after publishing the new record.
CompleteMultipartUpload reads each record once and assembles exactly the
bytes those records name, so an UploadPart racing a Complete makes that
Complete fail with InvalidPart instead of storing a checksum that
describes different bytes.

Memory mode still holds an object in one byte array, so an UploadPart
that takes an upload past the largest array the JDK allocates, or a
CompleteMultipartUpload over it, now fails with EntityTooLarge instead of
exhausting the heap or overflowing the array size.

Multipart uploads are tracked only in memory, so the part files under
.multipart are removed at startup and on reset. Without that, a crash
during assembly would leave a file as large as the object on disk for
good. The S3 docs describe the memory-mode limit, the disk space a
completion needs, and the operations that still read a whole object into
memory.
2026-10-03 14:34:54 -05:00
Aniket Shukla ba944df922 fix(cloudformation): resolve change sets by ARN without stack name (#4885)
* fix(cloudformation): resolve change sets by ARN without stack name

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

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

* fix(cloudformation): tighten change set ARN validation tests
2026-10-03 15:25:07 -04:00
Matheus Oliveira 27434be88a fix(identitystore): persist model fields across a restart (#5013)
Fluent-accessor models serialized as empty objects; detect fields directly.

* Fix #4993

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-10-03 14:53:04 -04:00
Sam Fakhreddine 4c22aaad2e feat(codepipeline): evaluate V2 stage conditions and rules (#4617)
* feat(codepipeline): evaluate V2 stage conditions and rules

Evaluates beforeEntry/onSuccess conditions with VariableCheck and LambdaInvoke rules, records rule executions, and supports OverrideStageCondition.

* fix(codepipeline): bound MATCHES evaluation time and guard rule records and overrides against races

MATCHES: match against a deadline-checked CharSequence so a backtracking pattern fails the rule after 1s instead of hanging the run.
Rule records: mutate and serialize them under the execution lock, and build ListRuleExecutions from a locked snapshot.
OverrideStageCondition: when the run has failed on the condition but not yet left activeRuns, wait (bounded, outside the lock) so the override resumes it.

* fix(codepipeline): harden V2 stage conditions after review

Honor SKIP only before entry, resolve declared variable defaults, fail
rules on unresolved variable references, reject overrides after a pipeline
change, surface a busy-run override as a conflict, hide internal condition
state from GetPipelineExecution, and use the DeploymentWindow provider name.

* fix(codepipeline): keep an accepted stage-condition override when another waiter times out

* fix(codepipeline): reject stale OverrideStageCondition with ConditionNotOverridableException

* refactor(codepipeline): share the busy ConflictException across its four throw sites

* refactor(codepipeline): inject the override test hooks through the constructor

* fix(codepipeline): emit no stage events for a stage skipped by beforeEntry
2026-10-03 14:36:40 -04:00
Aniket Shukla 27bfb54c6e fix(apigateway): return integration defaults and patch timeout (#4798)
* fix(apigateway): return integration defaults and patch timeout

* fix(apigateway): read defaults for legacy integrations

* fix(apigateway): preserve response transfer mode in configuration

* fix(apigateway): reject malformed response transfer mode

* fix(apigateway): restrict stored stream mode to proxy integrations
2026-10-03 14:18:16 -04:00
Aniket Shukla d8a76d1376 fix(s3): return account owner IDs in bucket and parts listings (#4884)
* fix(s3): return account owner IDs in bucket and parts listings

* fix(s3): bind multipart uploads to bucket ownership

* fix(s3): coordinate multipart uploads with bucket deletion

* fix(s3): preserve parallel multipart operations under deletion guard

* refactor(s3): reuse default owner display name in responses

* fix(s3): serialize operations on the same multipart upload

* style(s3): order project imports before Java imports
2026-10-03 14:14:33 -04:00
Priamo Germosen cd57deac18 fix(iam): authorize a server-certificate rename against both names (#5016)
AWS requires the principal to hold permission on the old name and the new
one, so that a rename into a name they may not write fails. ResourceArnBuilder
named only the stored certificate, so a Deny on the destination did not match
and the rename went through.

UpdateServerCertificate now names both the current ARN and the one the
request would produce, which the filter authorizes once per resource. The
destination is built beside the stored ARN so it keeps the certificate's
partition and account, and an update that renames and moves nothing still
names a single resource.
2026-10-03 09:37:12 -05:00
Priamo Germosen a22de628e6 fix(core): stop MultipartFormParser.ParsedForm using Optional as a record field (#5011) 2026-10-03 09:37:02 -05:00
Hector Ventura 7ffe43f48f fix(cloudformation): roll back in-place Cognito user pool and client updates (#5006)
* fix(cloudformation): roll back in-place Cognito user pool and client updates

A stack update that changed a user pool or user pool client in place and
then failed on a later resource ended in UPDATE_ROLLBACK_FAILED, because the
provisioner kept no snapshot to put them back. It now snapshots the settings
an update can change before the update call and restores them on rollback,
spending the snapshot only once the restore succeeds.

UpdateUserPool and UpdateUserPoolClient only apply what a request names, so
they cannot clear a setting the update added. CognitoService gains
userPoolSettings/restoreUserPoolSettings and their client counterparts,
which copy exactly those settings, leave the pool's signing keys and the
client's secrets out of the snapshot, and put the settings back on the
stored entity.

* fix(cloudformation): drop the Cognito update snapshot when the update commits

Greptile on #5006: once a stack update commits, the engine calls
completeUpdate for every resource but clearUpdate only after a
replacement's cleanup, so an in-place pool or client update left its
settings snapshot in the stored stack metadata until the resource was next
provisioned. completeUpdate now drops it before delegating to the
replacement cleanup; the update committed and nothing will roll it back.

Also orders the test's org imports (org.junit before org.mockito), which
were already out of order on main.
2026-10-03 10:35:45 -04:00
Hector Ventura 0740adf9ae fix(core): stop accepting SigV4 scopes no SDK signs with (#5005)
ResolvedServiceCatalog declared apigatewayv2 and sesv2 as credential
scopes, but every SDK signs those services as apigateway and ses
(botocore signingName, Java v2 codegen, Go v2 endpoints, JS v3 auth
scheme). The extra names only widened what the unknown-service guard let
through: a REST request signed apigatewayv2 or sesv2 reached a route no
real client would send it to. Both are dropped; API Gateway v2 JSON
requests still route by their AmazonApiGatewayV2. target and REST
/v2/apis by its resource class. A hand-written client that signed with
either name now gets UnknownOperationException, and
floci.protocols.reject-unknown-service-scope=false still turns the guard
off.

The tests that signed with the dropped names now sign as their SDKs do,
and UnknownServiceScopeGuardIntegrationTest pins both rejections next to
the accepted scope.
2026-10-03 09:42:44 -04:00
vamsiakandVamsi Akavarapu a18aa246d3 fix(eventbridge): preserve target role ARN configuration (#4946)
* fix(eventbridge): preserve target role ARN configuration

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

---------

Co-authored-by: Vamsi Akavarapu <16164447+vamsiak@users.noreply.github.com>
2026-10-03 09:42:03 -04:00
Hector Ventura ab2c0def0a fix(cloudformation): apply every SQS queue property and reset dropped ones on update (#4972)
* fix(cloudformation): apply every SQS queue property and reset dropped ones on update

SqsCfnProvisioner applied five of the thirteen mutable AWS::SQS::Queue
properties: DelaySeconds, MessageRetentionPeriod, MaximumMessageSize,
ReceiveMessageWaitTimeSeconds, KmsMasterKeyId, KmsDataKeyReusePeriodSeconds,
SqsManagedSseEnabled and RedriveAllowPolicy never reached the queue. All of
them now do, on create and update.

An update also kept the old value of a property the template dropped, while
CloudFormation applies the whole template as the desired state. Each dropped
property is now put back as a fresh queue has it: the stored attribute is
removed, except MessageRetentionPeriod, which SQS rejects empty and is written
as 345600, and ContentBasedDeduplication on a FIFO queue, written as false.
FIFO-only attributes are left alone on a standard queue and
SqsManagedSseEnabled is not reset, as LocalStack's parity-tested provider
records for AWS.

* fix(cloudformation): treat an SQS queue property that resolves to AWS::NoValue as absent

Greptile on #4972: the engine resolves AWS::NoValue to blank, so
MessageRetentionPeriod: {Fn::If: [cond, 1209600, AWS::NoValue]} reached the
attribute map as an empty value. On update it skipped the 345600 reset and
SetQueueAttributes rejected it; on create the empty value replaced the
queue's default (VisibilityTimeout "" among them). Every scalar and JSON
property that resolves to blank is now absent, so a condition that drops a
property leaves the default on create and resets it on update.

* test(cloudformation): pin the AWS-recorded SqsManagedSseEnabled update behaviour

Review on #4972 asked to let a dropped SqsManagedSseEnabled reset to its
create default. AWS does not: LocalStack's AWS-recorded parity test
test_update_fifo_queue_remove_all_properties_except_queuename updates a
queue created with SqsManagedSseEnabled: false and a KMS key to name-only,
and AWS then reports DelaySeconds and MessageRetentionPeriod reset, no KMS
key, and SqsManagedSseEnabled still false. The integration test replays that
case, so the exception in resetDroppedAttributes cannot go without a red
test.

* fix(cloudformation): keep a dropped DeduplicationScope and FifoThroughputLimit as AWS does

Review on #4972: the AWS-recorded parity case that pins SqsManagedSseEnabled
(LocalStack test_update_fifo_queue_remove_all_properties_except_queuename)
also shows DeduplicationScope messageGroup and FifoThroughputLimit
perMessageGroupId unchanged after an in-place name-only update, while
ContentBasedDeduplication returns to false. The reset cleared both, which
also changed delivery: without DeduplicationScope, two messages sharing a
deduplication id in different message groups collapsed into one.

Both now join SqsManagedSseEnabled in RETAINED_ON_UPDATE, and
ContentBasedDeduplication still resets. The integration test replays the
FIFO half of the recording next to the SSE half.
2026-10-03 09:37:11 -04:00
Priamo Germosen fca7d87f2d feat(codeartifact): add PyPI format support via pypiserver sidecar (#4998) 2026-10-02 23:51:56 -05:00
Priamo Germosen d0c7c23f6b feat(iam): model server certificates (#4975)
Replace the ListServerCertificates stub with the server-certificate
lifecycle: UploadServerCertificate, GetServerCertificate,
UpdateServerCertificate, DeleteServerCertificate, ListServerCertificates
and the tag operations.

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

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

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

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

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

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

* fix(ecr): validate scanning configuration booleans

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

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

Add PutImageScanningConfiguration and BatchGetRepositoryScanningConfiguration
to the Supported Actions table. The table is not generated, so the docs check
does not catch a missing row.
2026-10-03 00:01:40 -04:00
Allen Sanborn 0260a42549 fix(servicequotas): curate real AWS VPC quota codes (#4997)
ServiceQuotas only curated codebuild, lambda and organizations; every
other service code got three CRC-synthetic quotas, so real VPC codes
such as L-FE5A380F answered NoSuchResourceException from
GetServiceQuota and GetAWSDefaultServiceQuota. Terraform's
aws_servicequotas_service_quota reads exactly these codes before
requesting an increase.

Add a curated "vpc" entry, plus its service name:
- L-FE5A380F "NAT gateways per Availability Zone" = 5
- L-2AEEBF1A "Rules per network ACL" = 20

Values are the AWS defaults rather than the generous GENERIC_QUOTA_VALUE,
following the organizations entry (L-E619E033 = 50): callers compare a
desired value against these defaults to decide whether to request an
increase, so a realistic default keeps them on the path they take
against AWS. The emulator does not enforce either limit. The synthetic
quotas are still appended.
2026-10-02 23:49:20 -04:00
Allen Sanborn 8e98c087fd fix(cloudformation): resolve a stack id only to the stack carrying it (#4973)
* fix(cloudformation): resolve a stack id only to the stack carrying it

resolveStack turned an ARN into its stack name and returned whatever live
stack held that name. After a stack was deleted and its name reused,
DescribeStacks with the old stack id returned the new live stack (new id,
CREATE_COMPLETE) instead of the retained deleted one, and DeleteStack with
the old id deleted the new stack.

An ARN now resolves to a live stack only when the stack ids match, so
DescribeStacks/DescribeStackEvents fall through to the retained deleted
record (DELETE_COMPLETE), DeleteStack on the old id is the existing no-op,
and other operations answer "Stack with id ... does not exist".

* fix(cloudformation): send the real stack id in custom resource events

The custom resource event carried a made-up StackId (stack/<name>/<random
uuid>), so a handler calling DescribeStacks(event.StackId) now gets
"does not exist" since stack ids resolve only to the stack carrying them.
Pass the engine's stack id on Create/Update and stash it for Delete, which
only sees the StackResource.
2026-10-02 23:25:05 -04:00
Abhigya 036f55b196 fix(apigateway): map authorizer context in HTTP integrations (#4992)
* fix(apigateway): map authorizer context in HTTP integrations

HTTP backends need verified authorizer context from parameter mappings. Resolve scalar context values and replace mapped headers regardless of casing so client claims cannot remain beside verified values.

* fix(apigateway): drop unresolved context headers

Remove inbound context-mapped headers even when verified context is absent or non-scalar. Cover missing authorizer claims, forged repeated headers, OPTIONS and unresolved method mappings.

* fix(apigateway): preserve original mapping inputs

Keep HTTP proxy header, query and path mapping sources separate from outgoing destinations. Cover both mapping orders with present and missing authorizer claims through both REST execution endpoints.
2026-10-02 23:17:57 -04:00
TiM b437e1cc32 fix(s3): honour CopyObject destination and copy-source preconditions (#4984)
* fix(s3): honour CopyObject destination and copy-source preconditions

CopyObject ignored every precondition. If-None-Match: * over an existing
destination, and If-Match with a stale destination ETag, both answered 200 and
overwrote it; If-Match against a missing destination created it; and the four
x-amz-copy-source-if-* headers were never read, on CopyObject or UploadPartCopy.

Destination If-Match / If-None-Match now travel into the write the copy already
performs, so they are checked by the same code and under the same bucket
monitor as a conditional PutObject: 412 on a failed condition, 404 NoSuchKey
for If-Match on a missing key. Other If-None-Match values keep the literal-ETag
meaning they have on PutObject.

The copy-source conditions are checked against the resolved source object
with the pairing rules S3 documents for CopyObject: a matching if-match makes
if-unmodified-since irrelevant, and a matching if-none-match fails whatever
if-modified-since says. Every failure is 412, never 304. Dates compare at
second precision, the resolution of an HTTP date and of Last-Modified.

* test(s3): pin CopyObject's condition names and pairing controls

Destination failures now assert the <Condition> they report, and each
pairing test first shows its date condition's result alone, so the pair's
outcome can only come from the precedence rule.

* test(s3): assert a rejected UploadPartCopy leaves the existing part intact
2026-10-02 23:07:44 -04:00
Allen Sanborn 2e09bb4efa fix(lambda): skip Runtime API ports held by other processes (#4969)
* fix(lambda): skip Runtime API ports held by other processes

PortAllocator only tracked ports handed out inside its own JVM. When
another process in the same network namespace held the lowest port of the
range, allocate() returned it anyway and RuntimeApiServer retried the same
bind for 5s before the cold start failed, while the rest of the range sat
idle. Probe each candidate by binding 0.0.0.0 (as RuntimeApiServer does)
and fall through to the next port; a held port is not kept reserved, so it
is handed out again once its holder lets go.

* fix(lambda): keep Runtime API port tests off host ports

The exhaustion message now says a port may be in use by this floci or
held by another process, since allocate() skips externally held ports and
the pool can run dry with few of its own ports out.

Pool-bookkeeping tests ran on 9200-9299 (OpenSearch's port) and 12000+,
which the bindability probe now binds for real. Make the probe injectable
through the package-private constructor and pass an always-bindable one
there, so those tests no longer depend on what is listening on the host.
The held-port test keeps the real probe and skips itself when the OS hands
out a port too close to 65535 for its range. Rewrap the class Javadoc.
2026-10-02 22:37:14 -04:00
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