Commit Graph
2671 Commits
Author SHA1 Message Date
Hector Ventura 9d49e619c1 fix(appsync): front custom domains with the partition's CloudFront zone (#5237)
* fix(appsync): front custom domains with the partition's CloudFront zone

CreateDomainName returned a random hosted zone id and an appsync-api
regional host as appsyncDomainName. AppSync serves a custom domain
through CloudFront: the CDK aliases appsyncDomainName into the
partition's CloudFront hosted zone (aws-route53-targets AppSyncTarget),
so a DNS alias built from Floci's answer pointed at a zone that does not
exist. The domain now gets a CloudFront distribution name on the
configured CloudFront suffix and the partition's CloudFront hosted zone
(Z2FDTNDATAQYW2 in aws, Z3RFFRIM2A3IF5 in aws-cn), as an edge-optimized
API Gateway domain does.

* refactor(appsync): share the CloudFront front with edge-optimized API Gateway domains

An AppSync custom domain and an edge-optimized API Gateway domain both
get a CloudFront distribution name and the partition's CloudFront hosted
zone, and the two services built that pair with the same copied
statements. CloudFrontEdgeDomain now builds it once for both.

RequestRegionArnIntegrationTest still expected appsyncDomainName to
carry the request region; it now asserts the CloudFront form, while its
domain ARN assertion keeps checking the region.
2026-10-07 09:34:02 -04:00
Allen Sanborn 73133b472a fix(mq): return CreateBroker members from DescribeBroker (#5211)
* fix(mq): return CreateBroker members from DescribeBroker

CreateBroker accepted securityGroups, subnetIds, logs,
maintenanceWindowStartTime, storageType, authenticationStrategy,
encryptionOptions and configuration, but discarded them, so
DescribeBroker never returned them. Carry them through
CreateBrokerParams to the persisted Broker and into the DescribeBroker
response, with configuration reported as configurations.current as in
the AWS shape. Absent members are omitted, and brokers persisted before
this change still load.

RabbitMQ users stay out of DescribeBroker (#1951).

* fix(mq): report DescribeBroker logs as a LogsSummary

general and generalLogGroup are required in LogsSummary; general defaults
to false and the log group is /aws/amazonmq/broker/<broker-id>/general.
audit/auditLogGroup are reported only when audit logging was requested.

* fix(mq): report only the general log group in LogsSummary

Audit logs are ActiveMQ-only, and Floci emulates RabbitMQ brokers.
Document DescribeBroker's logs as a LogsSummary rather than an echo.

* fix(mq): stream broker logs to the general log group DescribeBroker reports

RabbitMqManager streamed container logs to /aws/amazonmq/broker/<id>
while DescribeBroker named /aws/amazonmq/broker/<id>/general. Both now
take the name from Broker.generalLogGroup().
2026-10-07 09:14:41 -04:00
Priamo Germosen 5fc8b0418c fix(iam): separate a constraint failure from an invalid value in PutAccountProperties (#5240)
The key pattern and length checks answered InvalidInput while carrying the
"failed to satisfy constraint" wording that every other constraint check in
IamService pairs with ValidationError. The model declares InvalidInputException
on the operation and says nothing about which code a pattern miss produces, so
the two had drifted apart with nothing to settle them.

The API Reference settles it in Common Error Types rather than the operation's
own error table. ValidationError is a common error for every action, defined as
"The input doesn't meet the required format or constraints", 400. InvalidInput,
the one the operation declares, is "an invalid or out-of-range value was supplied
for an input parameter". PutAccountProperties publishes a Key Pattern of
^[A-Za-z][A-Za-z0-9/_-]*$, a key length of 1 to 50 and a value length of 1 to
1024, and the model declares all three on accountPropertyKeyType and
accountPropertyValueType. Violating a published pattern or length is a format
failure; a value that satisfies them and is still wrong is not.

So it is a split rather than a rename. The key pattern and length, and the value
length, are now ValidationError and keep the constraint wording, which was
already right for them. The Namespace/PropertyName rule stays InvalidInput: the
published pattern admits a key with no slash, with several, and with a trailing
one, so that rule only applies once the format is already good. Its message drops
the constraint wording and reads as prose, since that wording is what made the
pair look inconsistent. The same-namespace rule is unchanged.

aMalformedKeyIsRejected asserted one code for seven keys that fall on both sides
of that line, so it splits in two, each asserting its own code and the absence of
the other. As written it could not tell a pattern failure from the slash rule.

Not touched, though the same reading would question it: createServiceLinkedRole
answers InvalidInput for a check that is exactly the declared constraint on
AWSServiceName. Its message is prose rather than the front-end format, there is
no recording either way, and CreateServiceLinkedRole's error table is structured
identically to this one, so it proves nothing. Left alone rather than changed on
inference.

Refs #5177
2026-10-07 08:03:02 -05:00
Priamo Germosen 3a8f974554 fix(iam): answer AWS's own errors for a malformed service-credential id, and for DeleteUser (#5239)
Three answers on the service-specific credential operations did not match what
AWS sends. All three are recorded against real AWS in LocalStack's IAM snapshots,
under @markers.aws.validated.

A ServiceSpecificCredentialId that does not match the model's [\w]+ was looked up
regardless, so it came back NoSuchEntity 404. AWS checks the format first and
answers ValidationError 400 quoting the pattern, on UpdateServiceSpecificCredential,
ResetServiceSpecificCredential and DeleteServiceSpecificCredential alike. A
malformed id and an unknown one are different mistakes, and they now get
different answers.

An id that does satisfy the pattern and names no credential of that user was
"The Service Specific Credential with id <id> cannot be found." AWS says "No such
credential <id> exists", still NoSuchEntity 404.

DeleteUser named the credential in its refusal: "must delete service-specific
credentials first." This case gets no message of its own on AWS, unlike the
access-key and policy cases beside it, and falls back to the generic "Cannot
delete entity, must remove referenced objects first.", DeleteConflict 409.

The API Reference publishes a length of 20 to 128 on the id as well as the
pattern, so both are now enforced, and an id breaking both is reported as two
validation errors rather than one, which is what the counted prefix is for. Only
the pattern message is recorded; the length wording is the form AWS uses for a
member carrying both bounds, which validateLoginProfilePassword already spells
the same way.

The same snapshots show an invalid Status answered with "1 validation error
detected: Value at 'status' failed to satisfy constraint: Member must satisfy
enum value set", naming neither the offending value nor the permitted set, where
the code named both. statusType is one shape, validated by one front end, and
UpdateSigningCertificate, UpdateSSHPublicKey and UpdateServiceSpecificCredential
all take it, so the recording of one is the rendering of all three. They had the
same message copied three times and now share a helper, placed ahead of all three
rather than inside one family's section. Elsewhere in the tree this message does
carry the permitted set, and those are other services with their own renderings,
so they are left alone.

UpdateSSHPublicKey had no test for a status outside the enum at all, and the two
that did have one asserted only the code, so the message none of them pinned
could have been reverted with the suite still green. All three now assert the
counted prefix and the absence of both the value and the set.

UpdateAccessKey takes the same shape and is further off: "Status must be Active
or Inactive." is not AWS's format at all, it refuses the Expired that statusType
allows, and it validates the status only after looking the key up, so a bad key
and a bad status answer NoSuchEntity where the front end would answer
ValidationError first. That is a behavioural change with its own tests to write,
so it is not folded in here.

Refs #5084
2026-10-07 08:02:43 -05:00
Priamo Germosen a927c5aac6 refactor(codeartifact): split the Verdaccio sidecar into a manager and a client (#5234)
VerdaccioSidecarManager now owns only the container lifecycle: starting,
readiness, release, and teardown. The HTTP protocol moves to
VerdaccioSidecarClient, which implements RepositorySidecarManager and is what
the registry and the npm data plane use, matching the Reposilite pair.

Wire-contract tests move to VerdaccioSidecarClientTest against a JDK
HttpServer fake. No behavior changes.
2026-10-07 07:43:26 -05:00
Priamo Germosen 4495ade6bb fix(iam): route every dispatched IAM action, and require the parameters the model requires (#5227)
28 operations IamQueryHandler dispatches were missing from AwsQueryController's
IAM set. Without a usable credential scope the controller infers the service from
the action name alone, and that chain ends in `return "sqs"`, so those answered
UnsupportedOperation in the SQS namespace. IamEnforcementFilter resolves the
policy namespace through the same code, so they were also authorized as
sqs:<Action>, and a policy denying iam:* missed them.

The set now matches the handler exactly in both directions: 158 dispatched, 158
routed, nothing routed that is not dispatched. None of the 28 names is defined by
another service here, so this adds no ambiguity to the 14 action names that
already collide across services.

Separately, five operations in the permissions-boundary family read
model-required parameters through the nullable accessor, so a missing one reached
the service as null and surfaced as InternalFailure from a null map key:
UpdateAssumeRolePolicy, PutUserPermissionsBoundary, PutRolePermissionsBoundary
and DeleteRolePermissionsBoundary did, DeleteUserPermissionsBoundary happened to
fail cleanly. That was already reachable through an IAM credential scope, so it
predates this change; routing by action name adds a second way in. All five now
answer ValidationError, and the test supplies the name on the three that take a
second required parameter, so the check on PolicyDocument and PermissionsBoundary
is exercised rather than shadowed by the one on the name.

What this does not do is decide whether Version should disambiguate a shared
action name. That is a cross-service routing change, it affects 14 names in
services this does not otherwise touch, and it is the prerequisite for IAM
ChangePassword rather than for these 28.

Refs #5032
2026-10-07 07:42:39 -05:00
Hector Ventura 7f5a332620 fix(ec2): derive flow log az-id the way subnets do (#5238)
Flow log records derived az-id with a mapping of their own (use1-az1,
and cnnorth1-az1 for China), while subnets and DescribeAvailabilityZones
derive zone ids with Ec2Service.zoneIdForZoneName (us-east-1-az1), so a
record's az-id never matched the AvailabilityZoneId of the subnet it
came from. Flow logs now use the same derivation in every region.
2026-10-06 23:59:22 -04:00
danielxoi bcfb9c786c fix(cognito): surface sign-in denials with the exception classes Cognito uses (#5223)
* fix(cognito): surface sign-in denials with the exception classes Cognito uses

A disabled user was rejected with UserNotConfirmedException ("User is disabled");
Cognito returns NotAuthorizedException with "User is disabled.". A PreAuthentication
trigger that returned an error payload surfaced as NotAuthorizedException; Cognito
returns UserLambdaValidationException with "PreAuthentication failed with error
<errorMessage>.", the same mapping floci already applied to PreSignUp on
AdminCreateUser. PreSignUp on SignUp is aligned the same way (it reported
NotAuthorizedException "PreSignUp trigger denied signup: ...").

The five duplicated eligibility checks now share requireSignInEligible /
requireEnabled, and the three blocking triggers share blockingTriggerFailure.
Integration tests that pass against AWS failed on these two codes.

* test(cognito): cover trigger invocation failures and assert the SDK exception classes

PreAuthentication and PreSignUp now get cases for an uninvokable function
(UnexpectedLambdaException) and a malformed response
(InvalidLambdaResponseException). A new sdk-test-java compat test asserts
NotAuthorizedException for a disabled user and UserLambdaValidationException
for a PreAuthentication trigger that raises, through the AWS SDK v2 client.

* test(cognito): drop the em-dash from the compat test display name
2026-10-06 23:28:03 -04:00
Hector Ventura 8a1d1ddcd3 fix(partition): read strict-mode service availability from endpoint rulesets too (#5231)
* fix(partition): read strict-mode service availability from endpoint rulesets too

Strict partition mode refused services AWS serves. The per-partition
service list came from botocore's endpoints.json alone, which leaves out
IAM, Route 53, Budgets and Cost Explorer in aws-eusc and IAM and Cost
Explorer in aws-iso-e, although each service's endpoint ruleset has an
explicit branch for the partition (iam.eusc-de-east-1.amazonaws.eu). The
generator now adds those partitions, for services endpoints.json lists
somewhere, and records them under servicesFromRulesets.

The execute-api signing name was mapped to Connect Participant only, so
IAM-authorized API Gateway invokes were refused in China, EUSC and the
ISO partitions. A signing name is now left out of the alias map when a
service whose own endpoint prefix is that name is listed nowhere, so
strict mode no longer judges execute-api.

The docs and config comments no longer say IAM is absent from aws-eusc.

* test(partition): assert API Gateway answers the strict-mode execute-api probe

The execute-api strict-mode test accepted any response but a 200 that
lacked the strict-mode error, so a 500 or an unrelated rejection would
also pass. It now requires API Gateway's own answer for a missing API:
a 404 NotFoundException with "Invalid API id specified".
2026-10-06 23:07:22 -04:00
Hector Ventura e1cd6fe6d4 fix(partition): serve a pseudo signing region as its partition's global region (#5233)
A request whose SigV4 scope named a <partition>-global pseudo-region
(aws-cn-global) kept the label as its region, so regional services
stored state under it and minted ARNs such as
arn:aws-cn:sqs:aws-cn-global:... for a region that does not exist. AWS
never signs with a pseudo-region: endpoints.json maps each to a real
credential scope region. RegionResolver now serves such a scope as the
partition's implicit global region (aws-cn-global becomes
cn-northwest-1) wherever it reads the region from a request.

With floci.partitions.allow-unknown-regions in a non-commercial
deployment, an unknown label was scoped to the deployment's partition
but RegionResolver.buildArn minted it as aws. buildArn now uses the
same partition as the request. ARNs built directly with Arn.of keep
the commercial fallback, which partitions.md now states.
2026-10-06 23:00:22 -04:00
Salil Chincholikar c0b2b299b0 feat(sns): sign deliveries with a served RSA certificate like AWS (#5189)
* feat(sns): sign deliveries with a served RSA certificate like AWS

Replace the EXAMPLE Signature and SigningCertURL placeholders with real
signatures over the documented canonical string. Notifications and
subscription confirmations delivered to HTTP/HTTPS endpoints, Lambda
records and non-raw SQS envelopes are signed with SHA1withRSA, or
SHA256withRSA when the topic sets SignatureVersion to 2.

The RSA 2048 key and its self-signed certificate are kept in SNS storage
and the certificate is served at
/_aws/sns/SimpleNotificationService-<fingerprint>.pem, so a new key always
gets a new URL. The SQS envelope now carries UnsubscribeURL and the Lambda
record a real UnsubscribeUrl, as on AWS.

* fix(sns): drop a delivery when signing fails and regenerate the key on reset

A signing failure in the Lambda, SQS and HTTP builders was caught with the JSON
fallback and delivered an empty placeholder as if it had succeeded. Only a JSON
serialization error falls back now; a signing failure fails that delivery.

SnsMessageSigner is now Resettable: a reset drops the cached key instead of
writing it back to the cleared store, so the next delivery generates a new one.

* style(sns): sort SnsService imports

* refactor(sns): build the SQS envelope with the builder Firehose uses

buildSnsSqsEnvelope duplicated buildSnsEnvelope apart from the signature and UnsubscribeURL. buildSnsEnvelope now takes the subscription ARN and signature version and adds both only when a subscription is given, so SQS and Firehose share one builder again.
2026-10-06 22:50:56 -04:00
Hector Ventura 1b61945f28 fix(partition): hold escaped host regexes to the DNS suffix gate (#5232)
The partition literal gate's dns-suffix pattern matched amazonaws.com but
not a Java regex that escapes its dots (amazonaws\\.com), so hand-written
host patterns escaped it. With the dots allowed to be escaped, the gate
found two on main:

- ECR's pull-through cache recognised an ecr upstream only on the
  commercial and China suffixes, while Floci's own registry recognises an
  ECR image URI in every partition. The upstream host pattern is now
  built from AwsPartitions.dnsSuffixRegex() the same way.
- The console sign-in host pattern in SigninService has no published
  non-commercial form, so it carries a partition-literal escape like the
  console literals beside it.
2026-10-06 22:49:23 -04:00
Priamo Germosen a0a2a5f0d6 fix(s3): run S3 Select over CSV and JSON a record at a time (#5178)
SelectObjectContent loaded the whole object into a byte array and built
the whole response before sending it, so an object over about 2 GiB
failed with an internal error, and a large object or result could run
the heap out of memory.

The object is now opened as a stream, the snapshot GetObject uses. The
Java evaluator parses the statement before reading anything, then reads
CSV a line at a time and JSON a line or an array element at a time,
stops once a LIMIT is reached, and writes the result as it goes, in
Records events of whole records, then Stats and End. Queries floci-duck
runs read the object themselves and no longer load it just to count
BytesScanned.
2026-10-06 20:32:13 -05:00
Priamo Germosen 04a3b97346 feat(iam): model account properties and outbound web identity federation (#5177)
Adds GetAccountProperties, PutAccountProperties, SetSecurityTokenServicePreferences,
EnableOutboundWebIdentityFederation, DisableOutboundWebIdentityFederation and
GetOutboundWebIdentityFederationInfo, which completes step 9f of the IAM gap plan.

A property key is Namespace/PropertyName with exactly one forward slash and
neither a leading nor a trailing one, and every key in one request must share a
namespace, which AWS states directly. A request mixing namespaces is rejected
whole rather than partly applied.

Enabling federation twice is FeatureEnabled 409 and disabling it twice is
FeatureDisabled 404, an asymmetry AWS documents. The getter answers
FeatureDisabled too when the feature is off, reusing the disable operation's own
wording, which is matched rather than improved.

The issuer URL is derived from the request's partition rather than the literal in
the API Reference's example: api.aws is only the commercial partition's dual-stack
suffix. It is minted once per account and survives a disable, since a relying
party verifying tokens will have pinned it. AWS documents neither that nor
JwtVendingEnabled's source, so both are recorded in the docs as choices.

The OIDC discovery endpoints the issuer is documented to host, and the
GetWebIdentityToken API the feature references, are not modelled: these six are
the management operations only.
2026-10-06 20:32:03 -05:00
Priamo Germosen 2cf011f726 fix(codeartifact): make npm republish of identical content idempotent (#5163)
Real AWS CodeArtifact documents PublishPackageVersion as idempotent: republishing
an existing asset with identical content succeeds. Verdaccio, which backs the npm
data plane, and real npm registries reject every republish of an existing version
with 409, even for byte-identical content, so Floci inherited that behavior.

A PUT to a bare package path is now spooled to a temp file in bounded chunks and
scanned as a stream. Each attachment's base64 data is hashed as it passes, and the
publish answers 200 without reaching Verdaccio only when every version's integrity
matches the stored packument, every dist-tag the publish sends already points where
it says, and no attachment is left unaccounted for. Anything else forwards the
spooled body unchanged, so Verdaccio's response stays authoritative. Envelope size
never has to fit on heap.

At most four publishes run this check at once; a publish beyond that waits in a
bounded queue, and when the queue is full it is answered 429 with Retry-After.
2026-10-06 20:31:50 -05:00
outofplace a5db3975c4 feat(cognito): support TOTP MFA when MFA is optional (#5101)
* feat(cognito): store software-token MFA preferences and report MFA settings

* feat(cognito): challenge users with TOTP turned on when MFA is optional

* docs(cognito): document optional TOTP MFA and MFA preferences

* fix(cognito): report required TOTP and keep email-code sign-in for email MFA users

* docs(cognito): describe required TOTP reporting and the USER_AUTH choice
2026-10-06 17:33:00 -04:00
Vũ Thế Huy 950b6fe774 feat(redshift): add relational queries for Redshift Spectrum (#5095)
* feat: add relational queries for Redshift Spectrum

* fix(redshift): harden Spectrum relational query preparation

Catch RuntimeException during preparation so the client gets an ErrorResponse
instead of a dropped connection, skip preparation while the backend discards
until Sync, defer schema binding until the transaction commits, make the
catalog functions SECURITY DEFINER, and track COMMIT and ROLLBACK from the
command tag.

* fix(redshift): address review findings on transaction handling in Spectrum relational queries

- Undo Glue tables created inside a rolled back transaction (Data API batch and wire proxy)
- Keep bindings and Glue tables on ROLLBACK TO SAVEPOINT; only a closed transaction discards them
- Report the real transaction status for locally handled simple queries instead of idle
- Use a switch expression in BackendResponseCoordinator
- Map host.docker.internal into the floci-duck container on Linux

* fix(redshift): undo Glue tables across sessions and on rollback to savepoint

- Scope staged Glue tables by the backend socket so the proxy rollback finds tables created by another session
- Track SAVEPOINT, ROLLBACK TO and RELEASE so a Data API batch undoes only the tables created after the savepoint

* fix(redshift): defer Glue undo on rollback to savepoint until the backend confirms and bundle bootstrap catalog in native image

* fix(redshift): reject CREATE EXTERNAL TABLE inside a transaction like AWS

AWS does not allow CREATE EXTERNAL TABLE inside a transaction block, and a
Data API batch runs as one transaction. Return SQLSTATE 25001 instead of
staging Glue tables and undoing them on rollback, which removes the savepoint
tracking and cross-session undo code. Reuse ExternalTableMaterializer.quote.

* fix(redshift): reject CREATE EXTERNAL TABLE in a transaction for legacy schemas too
2026-10-06 15:30:53 -04:00
Younes Beriane a7e2447a34 fix(rds-data): reject an ExecuteStatement response over 1 MiB (#5120)
* fix(rds-data): reject an ExecuteStatement response over 1 MiB

* fix(rds-data): count records array brackets and commas in the response size limit

* fix(rds-data): throw UnsupportedResultException for a response over the size limit
2026-10-06 14:57:29 -04:00
jwoa95 45f45e590e fix(cognito): send email from the pool's EmailConfiguration sender (#5150)
* fix(cognito): send email from the pool's EmailConfiguration sender

Cognito email always came from no-reply@verificationemail.com. It now
follows EmailConfigurationType: with DEVELOPER, From when set, otherwise
the SourceArn identity's address; with COGNITO_DEFAULT, the SourceArn
address. A domain identity takes its address from From. Without a
SourceArn, the default address is kept.

* test(cognito): read captured mail without the ?email= filter

* fix(cognito): send from the configured sender only when SES has verified it

A pool's EmailConfiguration sender is now used only when its SourceArn
names an SES identity in the pool's account that SES has verified in the
SourceArn Region (the pool's Region for a wildcard Region), and a From
that supplies the sender is one mailbox at that address or in that
domain. Anything else sends from no-reply@verificationemail.com and logs
a warning, so a pool can no longer send as an address its account has
not verified.

When From has a sender name, the bare address now goes in ReturnPath.
SES takes Source as the default return path, so the captured message's
ReturnPath, and the envelope sender handed to the SMTP relay, was
"Name <address>". The relay's mail client happened to strip the name
from MAIL FROM; the envelope no longer depends on that.

* style(cognito): use one parameterised message in the sender fallback log

* fix(cognito): accept subdomains of a domain identity and match email identities exactly

A verified SES domain covers its subdomains, so a From in one of them now sends instead of falling back. Email address identities are case sensitive, domain part included, so the From must equal the identity. The SourceArn must also be in the user pool's partition, not only its account.

* refactor(ses): keep one definition of a verified identity

SesService.isVerifiedIdentity now delegates to SesIdentityService.isIdentityVerified, made package-private, instead of repeating its check.
2026-10-06 13:51:51 -04:00
Mario Toffia a33eea05cd feat(iot): enforce custom authorizer decisions on MQTT connections (#4835)
* test(iot): cover custom authorizer invocation and enforcement against AWS

* feat(iot): enforce custom authorizer decisions on MQTT connections

Serve TestInvokeAuthorizer and invoke an authorizer's function on an MQTT
CONNECT that names it, on the plaintext listener and the /mqtt WebSocket
bridge. The event, the request and answer checks, signed-token
verification and the refusal per MQTT version follow what was measured
against AWS IoT Core. The bridge hands the upgrade's headers, query and
server name to the broker keyed by its connection's local address.

Closes #4823

* fix(iot): evaluate WebSocket custom authorizer policies against the client's address

* docs(iot): note that a non-UTF-8 MQTT password reaches the authorizer altered

* test(iot): cover custom authorizer CONNECTs on the plain MQTT listener

* fix(iot): refuse TestInvokeAuthorizer tokens and signatures outside their length bounds

* fix(iot): refuse authorizer JSON with trailing content

TestInvokeAuthorizer, CreateAuthorizer and UpdateAuthorizer bodies, a custom authorizer's answer and each policy document it returns are now read with FAIL_ON_TRAILING_TOKENS, as the shared JSON controllers do, so a valid prefix followed by junk is refused instead of half-read.

* fix(iot): keep address literals out of the WebSocket server name

Over WSS without SNI the bridge fell back to the Host header unfiltered,
so a client dialing an IP got that IP as tls.serverName in the authorizer
event and as iot:DomainName in policy evaluation. Apply the same address
literal filter SNI already uses. Also name the context validation ceiling
in TestInvokeAuthorizer's ponytail note.
2026-10-06 10:44:28 -04:00
Mario Toffia e9f2463103 fix(cloudformation): replace Cognito user pool groups like CloudFormation (#4841)
* test(cloudformation): cover AWS::Cognito::UserPoolGroup replacement against AWS

* fix(cloudformation): replace Cognito user pool groups on create-only changes

AWS::Cognito::UserPoolGroup left the old group behind on a rename, kept
the explicit name when GroupName was dropped, and tried to update a
group that did not exist when UserPoolId changed.

The provisioner now creates the group whenever a create-only property
changes and hands the displaced group to ReplacementCleanup, which
deletes it once the update commits or deletes the replacement and
restores the prior name and pool when the update rolls back. A pool
move that keeps an explicit name keeps the physical id, so, as on AWS,
nothing is deleted and the old-pool group stays. A generated name is
kept only for an in-place update; a pool move or a dropped explicit
name generates a fresh one. Each provisioned name is recorded with its
pool so a displaced group is deleted from the pool it lives in.

Closes #4836

* test(cloudformation): cover a failed update after moving a named Cognito group against AWS

* fix(cloudformation): roll back named Cognito group pool moves and read legacy name modes

A named pool move keeps the physical id, so it now records a replacement that displaces nothing. A failed update points the group back at the old pool and, as measured on AWS, leaves the new pool's group, and the stack delete reads the pool from UserPoolId. A resource persisted without FlociGroupNameMode reads its name as generated only when it has the generated shape, so dropping an explicit GroupName replaces it.

* test(cloudformation): cover declaring a Cognito group's generated name explicitly against AWS

Measured on AWS (eu-west-1): updating an unnamed group to declare GroupName
equal to its generated name, same pool, fails the Group with UPDATE_FAILED
"CloudFormation cannot update a stack when a custom-named resource requires
replacing. Rename <name> and update the stack again." before anything is
created. The stack ends UPDATE_ROLLBACK_COMPLETE, Ref and the physical id stay
the generated name, and the group keeps its pool, description, precedence and
creation date.

* fix(cloudformation): refuse declaring a Cognito group's generated name explicitly

GroupName is create-only, so declaring an unnamed group's generated name
explicitly in the same pool requires a replacement that keeps both the pool
and the name. Measured on AWS, CloudFormation refuses it before creating
anything: the Group goes UPDATE_FAILED with "CloudFormation cannot update a
stack when a custom-named resource requires replacing. Rename <name> and update
the stack again.", the stack ends UPDATE_ROLLBACK_COMPLETE, and Ref and the
group stay unchanged. Floci updated the group in place and reported
UPDATE_COMPLETE; it now raises the same ValidationError.

* fix(cloudformation): keep only owed and current Cognito groups in the pool record

The group pool record added the prior and current name on every provision and
never dropped one, so it grew with every name the resource ever had. It is now
rebuilt after the replacement record, keeping only the names still owed a
delete, with their recorded pools, plus the current name.

* fix(cloudformation): refuse a declared generated Cognito group name only when the mode was recorded

The refusal of a declared generated name read the prior mode from the name's
shape when no mode was recorded, so a legacy group explicitly named in the
generated shape had a valid in-place update refused. Only a recorded generated
mode refuses now; a legacy record updates in place, as before the mode existed.

* test(cloudformation): read stack outputs with XmlParser

The Cognito group integration test read stack outputs by splitting the
DescribeStacks XML on tag strings. It now uses XmlParser.extractPairs, as the
other CloudFormation integration tests do.
2026-10-06 10:24:56 -04:00
jwoa95 69b4d17c67 fix(cognito): run the PreSignUp trigger on AdminCreateUser (#5149)
* fix(cognito): run the PreSignUp trigger on AdminCreateUser

AWS invokes the pre sign-up trigger when AdminCreateUser creates a user,
with triggerSource PreSignUp_AdminCreateUser, the request's ValidationData
and ClientMetadata, and ignores the response's autoConfirmUser,
autoVerifyEmail and autoVerifyPhone. A trigger error refuses the user.

The trigger runs before anything is stored, so a refused ForceAliasCreation
request no longer moves the alias off the existing user.

* fix(cognito): invoke PreSignUp outside the user lock on AdminCreateUser

AdminCreateUser held the lock stripe of the requested username while
the pre sign-up trigger ran. A function that called back into the pool
for an identifier on the same stripe, such as AdminCreateUser for the
same username, waited for that lock until the invocation timed out.

The trigger now runs with no lock held. A taken username or alias is
still refused before the trigger is invoked, and the checks run again
under the lock once it accepts, so a user created while the trigger ran
still fails the request with UsernameExistsException.

With ForceAliasCreation, the alias holder was read before the trigger
and written back after it, which could undo a change made to the holder
in the meantime or restore a deleted holder. The holder is now looked up
under the lock after the trigger, just before its alias is moved.

* fix(cognito): run PreSignUp once per in-flight AdminCreateUser username

With the pre sign-up trigger running outside the user lock, two
overlapping AdminCreateUser requests for the same free username could
both pass the existence check and both invoke the trigger. The later
one was then refused under the lock after its function had already run,
or failed with the function's own error instead of
UsernameExistsException.

AdminCreateUser now claims the username before checking it and gives
the claim up once the user is stored or the request fails. An
overlapping request for the same username, including one the function
makes for the username it was given, is refused with
UsernameExistsException before it invokes the trigger.
2026-10-06 08:18:14 -04:00
TATSUNO “Taz” Yasuhiro 6e6ce61eea feat(lambda): durable function chained invokes (#5164)
* feat(lambda): durable function chained invokes

A CHAINED_INVOKE operation runs another function. A durable target
needs a version or alias and runs as its own durable execution with a
random name; its close completes the operation as SUCCEEDED, FAILED,
TIMED_OUT ("CHAINED_INVOKE timed out after N seconds.") or STOPPED. Any
other function is invoked once, and an output over 1 MB fails the
operation. A missing function or an unqualified durable one fails the
operation at once. Stopping the parent leaves the child running.

A plain chained invoke lost with the process runs again after a restart,
and a durable child that closed before its report reaches the parent
reports then.

* fix(lambda): close the gaps in durable chained invokes

A durable child that closes during a restart reports to its parent
under its own lock, and recovery triggers an execution once. A durable
target invoked without Payload starts its child with no input, while a
plain target gets {}. A target started in the batch that closes the
execution still runs and its result is ignored, as on AWS.

* fix(lambda): reject a chained invoke of another account or region

AWS rejects the checkpoint with InvalidParameterValueException "Cannot
start a CHAINED_INVOKE on a function in another account." or "... in
another region." Cross-account chained invocations are not supported.

* fix(lambda): keep durable chained invokes across a crash

The parent is saved before the child it starts, so a crash in between
leaves no child the parent does not know. On restart a child the parent
recorded but the store lost is started again under the same ARN, and a
plain target started by the checkpoint that closed the execution runs
again until its result is recorded. A child reports only to the
operation that started it.

* fix(lambda): recreate a lost durable child on the version its ARN names

An alias the chained invoke named may point to another version after a
restart, and a child recreated there would not match the ARN the parent
saved.
2026-10-06 08:17:51 -04:00
Abhigya be668acefd fix(eventbridge): require EventPattern or ScheduleExpression in PutRule (#5172)
AWS rejects a PutRule that has neither field with a ValidationException,
"Parameter(s) EventPattern or ScheduleExpression must be specified."
Floci accepted it and stored a rule that matched every event on its bus.
Validate before the bus lookup, and give the existing tests that created
such rules a pattern or schedule.
2026-10-06 07:29:00 -04:00
Abhigya bb24ee09d1 fix(eventbridge): stop schedule-only rules from matching put events (#5168)
A rule with a ScheduleExpression and no EventPattern was matched by every
PutEvents call on its bus, because matchesPattern treats a missing pattern
as match-all. In AWS such a rule only fires on its schedule. Skip rules
without an event pattern when routing put events; archives keep the
match-all semantics they rely on.
2026-10-06 07:18:57 -04:00
Hector Ventura 957d49255a fix(core): replay a Docker request after a lost response only when it is safe to repeat (#5171)
* fix(core): replay a Docker request after a lost response only when it is safe to repeat

The transport retry replayed every control-plane request except exec calls
and an exclusion list (restart, network connect/disconnect, network create,
unnamed container create), so other mutating calls were still replayed after
a lost response: commit made a second image, pause, unpause and kill got a
409 for a state that had already changed, and rename hit a name conflict.

The policy is now an allowlist: GET, HEAD, DELETE (a replay answers 404,
which callers tolerate) and PUT archive uploads as before, and POST only for
start, stop, wait, image pull, volume create and a named container create.
Every other POST gets one attempt, including any call added later.

* fix(core): replay a volume create only when it names the volume

An unnamed volume create replayed after a lost response makes a second
volume and orphans the first; a named one returns the existing volume.
2026-10-06 07:08:30 -04:00
Hector Ventura df958117bb chore(core): own the Docker HTTP transport, with docker-java's settings unchanged (#5170)
* chore(core): own the Docker HTTP transport, with docker-java's settings unchanged

docker-java's ApacheDockerHttpClient builder exposes only the host, SSL
config, pool size and the connect and response timeouts. Idle-connection
validation and eviction, and a timeout for leasing a pooled connection, are
set inside a private constructor, so Floci cannot reach them.

FlociDockerHttpClient and HijackingHttpRequestExecutor are adapted from
docker-java 3.7.1's httpclient5 transport and apply exactly its settings:
unix, npipe and tcp hosts, TLS from the SSL config, a single-route pool, no
pooled socket read timeout, the request response timeout, no stale-connection
validation, and the hijacked exec/attach upgrade. DockerClientProducer builds
both pools with it. Nothing changes behaviour here; follow-ups turn on idle
validation and the lease timeout on this class.

docker-java is Apache License 2.0 and ships no NOTICE file, so the
obligations are the licence text, added as licenses/Apache-2.0.txt, and the
attribution, which each adapted file's header gives along with what changed.

* chore(core): pick the Docker host and path prefix with a switch expression
2026-10-06 07:00:11 -04:00
Hector Ventura 4115becdf2 fix(emr): use the cluster's regional private DNS domain for instances and the master (#5169)
* fix(emr): use the cluster's regional private DNS domain for instances and the master

ListInstances built every synthetic instance's PrivateDnsName as
ip-10-0-0-N.ec2.internal, the us-east-1 domain, in every region, while
RunJobFlow set MasterPublicDnsName to <region>.compute.internal, which is
wrong in us-east-1. Both now use the shared EC2 helper, so names end in
ec2.internal in us-east-1 and <region>.compute.internal elsewhere, as EC2
itself does since #5033.

* fix(emr): report the regional master DNS name for a cluster stored before the fix

DescribeCluster returned the stored MasterPublicDnsName, so a us-east-1
cluster persisted before the previous commit kept reporting
<region>.compute.internal after an upgrade. The name is now derived from the
cluster's region when the response is built.
2026-10-06 06:51:41 -04:00
Hector Ventura 899211e498 fix(cognito): keep tag operations and DescribeUserPoolDomain in the pool's region (#5133)
* fix(cognito): keep tag operations and DescribeUserPoolDomain in the pool's region

The region guard for user pools checked only requests naming a UserPoolId.
TagResource, UntagResource and ListTagsForResource name the pool by ARN, and
DescribeUserPoolDomain looks a domain up by its name in a store keyed by name
alone, so another region could still read or change a pool's tags and
describe its domain. The handler now applies the same guard to the pool an
ARN names, and refuses a domain whose pool lives in another region with the
not found an unknown domain gets.

* fix(cognito): answer a missing user pool domain with 400 and match the tagged pool's full ARN

ResourceNotFoundException carries no HTTP status of its own in the cognito-idp
model, so it goes out as the awsJson 400; the domain operations sent 404. The
tag operations now also refuse an ARN that names the pool's id under another
region or account, and the region test covers UntagResource.
2026-10-05 23:30:30 -05:00
Priamo Germosen 8fee66ae61 fix(s3): stream UploadPartCopy ranges into the part (#5162)
UploadPartCopy read the copied range into a byte array and stored it
through the byte-array UploadPart path, so one copied part was capped
near 2 GiB with EntityTooLarge, while S3 allows a part of up to 5 GiB.

The range is now read from the source stream as it is needed, by a new
CopyRangeInputStream that skips to the range on its first read and ends
after its last byte, and written straight into the part through the
streaming UploadPart path, so neither the source nor the part has to
fit in memory in the disk-backed modes. A range over S3's 5 GiB part
limit is rejected with EntityTooLarge, as the S3 API Reference error
table words it, before anything is copied. Memory mode keeps its limit
of about 2 GiB.
2026-10-05 23:04:48 -05:00
Priamo Germosen 9c0102559d feat(iam): model service-specific credentials (#5084)
Adds CreateServiceSpecificCredential, ListServiceSpecificCredentials,
UpdateServiceSpecificCredential, ResetServiceSpecificCredential and
DeleteServiceSpecificCredential, the five the wire model defines.

A credential takes one of two shapes, decided by the service: CodeCommit and
Keyspaces get a ServiceUserName and a ServicePassword, while the long-term API
key services get a ServiceCredentialAlias and a ServiceCredentialSecret and
accept CredentialAgeDays. The quota is two per service rather than two per user,
and the version behind a service user name's +n suffix is the lowest one free
rather than a count, so deleting out of order cannot mint a name already in use.

A credential blocks DeleteUser until it is removed, the last item on AWS's list
of what to delete first, and follows the user across an UpdateUser rename.
2026-10-05 22:57:54 -05:00
Sam Fakhreddine d4b7265b49 fix(lambda): check RevisionId before applying UpdateFunctionConfiguration changes (#4637)
* fix(lambda): check RevisionId before applying UpdateFunctionConfiguration changes

A stale RevisionId returned 412 but left the rejected fields on the live stored function; the precondition now runs before any mutation.

Fixes #4605

* fix(lambda): validate fields before checking RevisionId in UpdateFunctionConfiguration
2026-10-05 21:56:08 -04:00
TiM fa1268bcbb fix(s3): answer 501 for PutObject conditions S3 does not implement (#5128)
* fix(s3): answer 501 for PutObject conditions S3 does not implement

S3 implements two conditional PutObject forms: If-None-Match: * to create only,
and If-Match with an ETag to replace only if unchanged. It answers the other
two spellings, If-Match: * and If-None-Match with a literal ETag, with
501 NotImplemented. Floci gave both a meaning (If-Match: * as "must exist",
If-None-Match: <etag> as a literal comparison), so code relying on them passed
locally and failed against S3.

Both now answer 501 before the body is decoded or validated. A quoted "*" is
still the If-None-Match wildcard. The two tests that asserted the literal-ETag
behaviour now assert 501, and the quoting test keeps its unquoted-value
coverage on the If-Match path.

* test(s3): cover a malformed aws-chunked body in the 501 ordering test

The ordering test exercised checksum validation only, so it would still pass
with the guard moved after aws-chunked decoding. A truncated chunked body,
400 IncompleteBody without the header, now answers 501 with it.

* fix(s3): judge each member of a conditional header list

The precondition check splits If-Match and If-None-Match on commas and
treats a "*" anywhere in the list as a match, so If-Match: "<etag>", *
passed the 501 guard and then overwrote the object whatever its ETag.
The guard now reads the list the same way. If-Match: "*" was already the
wildcard to the precondition check and stays 501, now with a test.

* fix(s3): keep empty members when judging a conditional header list

String.split drops trailing empty strings, so If-None-Match: "," produced
no members, passed the 501 guard, and overwrote the object. A limit of -1
keeps them, and an empty member is not the wildcard.

* refactor(s3): judge unimplemented PutObject conditions with the service's ETag normalizer

The 501 guard ahead of PutObject and checkWritePreconditions after it must
read If-Match and If-None-Match the same way, or a spelling one accepts and
the other rejects slips through. The guard now calls S3Service's
normalizeEntityTag, made package-private static, instead of a copy of it.

* docs(s3): keep only the list rule in the 501 guard's comments

The normalizer comment claimed the guard reads If-Match and If-None-Match
exactly as the precondition check does, which the split limit contradicts
for a header of only commas. The guard's block comment restated its name
and the tests' ordering; the rule a reader cannot see from the code, that
a * in an If-Match list cannot stand in for the ETag beside it, stays.
2026-10-05 21:03:01 -04:00
Kenshin Okinaka 3f6fb371d1 feat(ses): add the S/MIME identity certificate operations (#5111)
* feat(ses): add the S/MIME identity certificate operations

Implement AssociateEmailIdentityCertificate,
DisassociateEmailIdentityCertificate and ListEmailIdentityCertificates
as a control plane only: associations are stored per region and Floci
never signs mail.

Request validation, messages and precedence follow real SES: a domain
identity needs a FromAddress in the domain or a subdomain, one
certificate per address regardless of case, the request members are
checked before the identity, and the certificate is not inspected on
association. The reported status is Floci's own rule: ACTIVE while the
ARN names an issued, unexpired ACM certificate (with its expiry as
CertificateExpiryTime), FAILED otherwise. Disassociation is immediate
and idempotent, and the list pages through SesListPaging.

DeleteEmailIdentity now refuses an identity that still has a
certificate associated, as SES does. The v1 DeleteIdentity and
DeleteVerifiedEmailAddress share the identities and refuse it too.

* fix(ses): apply the documented S/MIME certificate requirements

ListEmailIdentityCertificates now reports ACTIVE only when the
association meets the SES Developer Guide's S/MIME certificate
considerations: the identity is verified, and the certificate is
currently valid, has an allowed key (RSA 2048/3072/4096 or EC P-256,
P-384, P-521, read from the certificate itself since ACM's stored key
algorithm folds other sizes into those) and an RFC822Name SAN equal to
the From address, case-sensitively. The docs link that section instead
of calling the criteria undocumented.

* fix(ses): require an email-signing end-entity S/MIME certificate

A probe against SES found requirements beyond the Developer Guide's
list: a CA certificate fails even with the right usages, and the
certificate needs both a key usage including digitalSignature and an
extended key usage including emailProtection, while other usages may
sit alongside them. ListEmailIdentityCertificates now applies them, and
the docs list them next to the guide's link.

* refactor(ses): reuse SesIdentityService's verified-identity check
2026-10-05 20:24:51 -04:00
Hector Ventura c81290823b fix(cloudwatch): mint the regionless dashboard ARN AWS uses (#5135)
A dashboard's ARN carried the Region of the request
(arn:aws:cloudwatch:us-east-1:<account>:dashboard/<name>), while AWS's has
none: arn:<partition>:cloudwatch::<account>:dashboard/<name>. Floci now
mints that form, in the partition of the Region the dashboard was put
through, and a dashboard stored with the old ARN reads back with the new
one. The region-ful ARNs Floci handed out before still resolve for tagging,
for the dashboard's own Region only. Storage stays per Region.
2026-10-05 19:51:23 -04:00
Hector Ventura 22ff93365e fix(ec2): plan a VPC's CIDR against another Region's network for the same VPC id (#5134)
When planning a VPC's CIDR, Floci skips its own surviving Docker network
for that VPC so a restart does not read it as a collision. The match was
on the VPC id and owner only, but two Regions can hold a VPC with the same
id (the legacy vpc-default). Planning that id in one Region then skipped
the other Region's network, accepted an overlapping CIDR, and the Docker
network create failed, leaving instances without VPC connectivity. The
skip now also requires the network's Region label to match; every VPC
network has carried one since VPC networks were introduced.
2026-10-05 19:37:51 -04:00
Priamo Germosen a3118eb42b fix(sts): evaluate GetSessionToken and GetFederationToken sessions as the user that minted them (#5081)
Under IAM enforcement, credentials from the two STS operations that mint a
session from a long-term key were evaluated as the wrong identity:

- A GetSessionToken session was stored with no role ARN, which
  resolveCallerContext answered with null, and the enforcement filter lets a
  known credential it cannot map to policies through. A user allowed only
  sts:GetSessionToken got credentials that passed every check, IAM calls
  included, and since the session had no caller ARN, AssumeRole took it for
  the account root and let it assume any role whose trust policy names the
  account. AppSync's IAM authorization and RDS IAM database authentication
  also read a null context as allowed, so they let these sessions through too.
- A GetFederationToken session was stored with the federated user's ARN where a
  role session keeps its role's, and its permissions were read from the role
  whose name followed the last slash. A user allowed only
  sts:GetFederationToken that federated under an existing role's name got that
  role's permissions; any other name got none, even with a session policy.

The STS API Reference says GetSessionToken credentials "have the same
permissions as the IAM user", and that a GetFederationToken session with no
session policy "has no permissions", and otherwise the intersection of "the IAM
user policies and the session policies". Both handlers now record the identity
whose key signed the request. An active key of a user in the request's account
names that user, by ARN and unique ID. A key no account holds, the legacy test
key or the account id among them, names the account root, which is how Floci
already treats such a key.

A GetSessionToken session is evaluated as that user, policies and boundary
included, or as the root, whose context the filter still bounds by the
account's service control policies. A federated session is evaluated as that
user intersected with its session policy. Without one it has no permissions of
its own, but keeps the Deny statements of its user's policies and boundary: a
resource policy naming the federated user grants to the session past implicit
denies, not past explicit ones (IAM User Guide, "Resource-based policies for AWS
STS federated user principal sessions"). Whatever its policies allow, a
federated session cannot call any IAM operation, nor any STS operation except
GetCallerIdentity (STS API Reference, GetFederationToken), so its context
always carries an explicit Deny for iam:* and sts:*; the filter answers
GetCallerIdentity before reading any policy.

A session whose issuer is gone is no credential at all, refused like an unknown
access key, so neither a resource policy nor S3's fallback to the account root
acts on its behalf. That covers a session minted with any other key IAM holds
(another session's, which AWS does not accept here, or an inactive key or
another account's, which account routing can land in the default account), a
session whose user was deleted and recreated under the same name, and one
stored before the issuer was recorded.

The caller identity follows: a GetSessionToken session's caller and principal
ARN are its user's, and a federated session's are its federated-user ARN, with
account:name as its user ID, as GetCallerIdentity reports for a federated user.

The unit test that pinned the GetSessionToken bypass now checks that a session
stored without an issuer is no credential; unit tests cover each kind of
issuer, the deny-only context of a federated session without a policy, and
that the issuer survives persistence. Integration tests (IAM and S3
enforcement, real SigV4) cover the role-name federation, the intersection, the
no-policy session, the GetSessionToken session and its AssumeRole, a
bucket-policy Deny keyed on the user's aws:PrincipalArn, both kinds of session
staying within the user's permissions boundary, a session of a recreated user
under a bucket policy granting everyone, and a bucket policy naming a federated
user against its user's explicit Deny, and a federated session refused IAM
and AssumeRole although both its user and session policy allow them; the SCP integration test now also checks
a root-minted session. All of them fail on main. Tests that built an STS
session credential as a role-less session with no issuer, a shape Floci no
longer creates, now build one the account root minted, or a presigned-URL
session, as production does.
2026-10-05 17:12:00 -05:00
Priamo Germosen 583de3010c fix(s3): stream PutObject and UploadPart bodies to disk (#5106)
The object PUT endpoint took its body as a byte array, so a single
PutObject or UploadPart was held whole in the heap and capped near 2 GiB.

The body is now read as a stream. A streaming aws-chunked payload is
decoded as it arrives, and Content-MD5 and x-amz-checksum-* are checked
on the way through. In the disk-backed modes the body is staged under
.multipart/.incoming with no lock held, then a part is moved into its
upload under the upload's lock and an object is stored like an
assembled multipart object. Checks the request alone decides (bucket,
SSE-C headers, checksum algorithm, write preconditions, a malformed
Content-MD5) run before any of the body is read. Memory mode reads the
body into a capped array and fails past about 2 GiB with EntityTooLarge.
2026-10-05 17:11:47 -05:00
David f157d354f2 feat(rds): Aurora custom cluster endpoints (#5090)
Serve CreateDBClusterEndpoint, DescribeDBClusterEndpoints,
ModifyDBClusterEndpoint and DeleteDBClusterEndpoint.

A custom endpoint is stored per Region with the rules from the API
reference and the Aurora user guide: type READER or ANY, a static or an
exclusion member list but not both, members that are instances of the
cluster, no writer in a READER endpoint, an RDS identifier stored lower
case and unique in the Region, and at most five per cluster. Its ARN
(cluster-endpoint:<id>) works with the tagging actions.

DescribeDBClusterEndpoints lists each cluster's built-in WRITER and
READER endpoints with its custom ones, and supports the cluster and
endpoint identifiers, the four documented filters and paging. Deleting a
cluster deletes its custom endpoints, and a deleted instance drops out of
the member lists.

Custom endpoints are modelled, not routed: one reports the cluster's own
endpoint host, so connections through it go where the cluster endpoint
sends them.

Closes #5072
2026-10-05 14:48:06 -04:00
Mario Toffia 4be8309e8d feat(cloudformation): provision AWS::IoT::Authorizer (#4830)
* test(cloudformation): cover AWS::IoT::Authorizer against AWS

* feat(cloudformation): provision AWS::IoT::Authorizer

CloudFormation stubbed AWS::IoT::Authorizer with a fake ARN and created
nothing. IotAuthorizerCfnProvisioner now creates a real authorizer
through IotAuthorizerService.

Ref is the authorizer name and Fn::GetAtt Arn the ARN. A missing
AuthorizerFunctionArn fails with the registry's model validation error
before any call. Status, EnableCachingForHttp, AuthorizerFunctionArn and
the token settings update in place, sending only the declared
properties, tags are reconciled, and a failed stack update restores
them from a snapshot. Changing AuthorizerName or SigningDisabled
replaces the authorizer and deletes the old one once the update
commits; a replacement that keeps an explicit name is refused. Delete
deactivates the authorizer first and tolerates one already gone.

Closes #4822

* chore(cloudformation): move the IoT authorizer snapshot constant

It sat at the same insertion point as other pull requests' snapshot constants, so they could not be merged together.

* fix(cloudformation): treat only an empty intrinsic result as AWS::NoValue for IoT authorizers

* fix(cloudformation): undo an IoT authorizer update whose tag reconcile fails

* fix(cloudformation): report a SigningDisabled change on an IoT authorizer as a replacement

* fix(cloudformation): create an IoT authorizer over a dispatcher stub and refuse declaring its generated name

* fix(cloudformation): refuse an IoT authorizer boolean that is neither true nor false

* fix(cloudformation): never delete a dispatcher stub's id in replacement cleanup

* fix(cloudformation): tell a stub from a migrated resource and roll back a stub migration that kept its id

* fix(cloudformation): name an unnamed IoT authorizer <LogicalId>_<12 chars> as CloudFormation does
2026-10-05 14:37:54 -04:00
Aniket Shukla 4fb52e0b07 fix(ec2): use regional private DNS names (#5033)
* fix(ec2): use regional private DNS names

* fix(ec2): resolve private DNS for pattern regions
2026-10-05 14:16:58 -04:00
Allen Sanborn e7ca2ece22 feat(dms): add endpoint, replication instance and replication task lifecycles (#5001)
* feat(dms): add endpoint, replication instance and replication task lifecycles

DMS dispatched only replication subnet groups and tagging, so CreateEndpoint,
CreateReplicationInstance, CreateReplicationTask and their siblings answered
UnknownOperationException and no aws_dms_endpoint, aws_dms_s3_endpoint,
aws_dms_replication_instance or aws_dms_replication_task could be applied.

Adds Create/Describe/Modify/Delete for endpoints, replication instances and
replication tasks, plus Start/StopReplicationTask, which the provider calls for
start_replication_task and before modifying or deleting a running task.

- Resources are ARN-addressed (endpoint:, rep:, task:) with a 26-character
  generated id or the caller's ResourceIdentifier, and tagged through the
  existing tagging operations.
- Instances are available and tasks ready from creation, the states the
  provider's waiters target; describe filters follow the API reference and a
  filter that matches nothing is ResourceNotFoundFault.
- Endpoint settings structures round-trip, minus every SecretString member;
  ModifyEndpoint merges them unless ExactSettings is true.
- Deleting an endpoint or instance a task uses, a subnet group an instance
  uses, or a running task is InvalidResourceStateFault.

The unsupported-operation test now uses CreateReplicationConfig, which is still
unimplemented.

* style(dms): order DmsService imports alphabetically

* docs(dms): list CdcStartTime and the missing describe actions as unimplemented

* test(dms): cover tag add and remove on endpoint, instance and task ARNs

* fix(dms): runtime-init DmsService, resolve the default subnet group, reject reversed task endpoints

- Register DmsService under --initialize-at-run-time: its static SecureRandom
  otherwise lands in the native image heap (guard test and native builds).
- Store only the three members KerberosAuthenticationSettings models instead of
  a deep copy of whatever the caller sent.
- An instance created without a subnet group now describes the "default" group
  in full (VPC, subnets, status) from the region's default-VPC subnets.
- CreateReplicationTask rejects a source ARN that is not a SOURCE endpoint and a
  target ARN that is not a TARGET endpoint.

* fix(dms): name the swallowed default-subnet exception, sync the DMS matrix count

The default-subnet fallback deliberately swallows AwsException; name it
`ignored` and say why that is safe, per AGENTS.md.

docs/services/index.md listed DMS at 6 operations; the handler dispatches 20.

Add the reverse of the reversed-endpoints test: a source endpoint passed as
TargetEndpointArn, which is the only test reaching the TARGET type check.
2026-10-05 14:14:15 -04:00
Allen Sanborn 7a1f9dd826 fix(elasticache): report a memcached cluster's node count, type, ARN and nodes (#5000)
* fix(elasticache): report a memcached cluster's node count, type, ARN and nodes

CreateCacheCluster with Engine=memcached kept only the cluster id, so
DescribeCacheClusters answered with id, status, engine, version and
ConfigurationEndpoint alone. terraform's aws_elasticache_cluster reads
num_cache_nodes, node_type, parameter_group_name, subnet_group_name,
security_group_ids, arn and cache_nodes back from that describe, so every
memcached cluster planned a diff no apply could settle.

The memcached create now takes the same CreateCacheClusterRequest the redis
path does and stores NumCacheNodes (default 1, below 1 refused),
CacheNodeType (default cache.t4g.micro, as for redis), the parameter and
subnet group names, security group ids, PreferredAvailabilityZone and an
ARN. The describe emits them for memcached as it does for redis and, with
ShowCacheNodeInfo, one CacheNode per node (0001..000N), each reporting the
cluster endpoint since one container serves them all. A record persisted
before node counts were stored reports one node. Redis output is
unchanged.

* fix(elasticache): cap a memcached cluster at 40 nodes

A create with NumCacheNodes above 40 now fails with
NodeQuotaForClusterExceeded (400), as AWS does, instead of storing the
count and listing that many nodes on a ShowCacheNodeInfo describe.
2026-10-05 12:28:55 -04:00
Abhigya 7d9e38cf56 fix(iam): compare numeric and boolean condition values (#5086)
* fix(iam): compare numeric and boolean condition values

A condition value written as a JSON number, such as
{"NumericLessThan":{"s3:max-keys":10}}, or as a boolean under an operator
other than Bool, parsed to an empty value list, so the condition never
matched. Compare both as strings, as IAM does.

* fix(iam): never match an unparsable numeric or date condition value

compareNumeric and compareDates returned 0 when a value failed to parse, so
NumericEquals and DateEquals matched a non-numeric or non-date value and an
Allow could grant access. Numeric values were also compared as doubles, so
integers beyond 2^53 collapsed together. Compare numbers as BigDecimal, and
treat a value that does not parse as not satisfying the operator.

* fix(iam): never match a null numeric or date condition value

* fix(iam): accept epoch seconds and W3C short date forms in date conditions

* fix(iam): read lowercase date-time separators in date conditions

* chore(iam): keep the policy-variable comment next to its pattern

* test(iam): cover Null conditions with unquoted boolean values
2026-10-05 11:51:17 -04:00
vamsiakandVamsi Akavarapu d508a4e197 fix(apigateway): return embedded resource methods (#5109)
* fix(apigateway): return embedded resource methods

* fix(apigateway): guard method maps during concurrent reads

---------

Co-authored-by: Vamsi Akavarapu <16164447+vamsiak@users.noreply.github.com>
2026-10-05 11:44:40 -04:00
Vũ Thế Huy 840d1bb6c1 fix(sqs): set SenderId from caller principal instead of queue owner (#5066)
* feat(sqs): thread accessKeyId through RequestContext and AccountContextFilter

* fix(iam): resolve caller user id and align assumed role id with role id

* feat(sqs): stamp senderId on Message model and in SqsService

* feat(sqs): return message-specific senderId in SQS query and JSON handlers

* test(sqs): add integration tests for SenderId caller principal (#4829)

* fix(sqs): guard against unsatisfied CDI instance in resolveCurrentSenderId

* fix(sqs): address review findings and fix CI for caller principal SenderId

- Catch RuntimeException in SqsService to prevent compiler incompatibility
- Fallback SenderId to queue owner account when outside request context
- Deliver SNS fanout messages with SNS service principal SenderId
- Support presigned requests without X-Amz-Algorithm in AccountContextFilter
- Populate assumedRoleId and roleSessionName for ECS, EKS and Lambda sessions

* fix(sqs): validate session token for temporary credentials and fix CI regressions

- Validate session token matching when resolving caller principal for temporary credentials
- Generate unique session names for EKS Pod Identity to avoid sender ID collision
- Restore default floci-session session name for Lambda execution role sessions
- Align SqsService mock in SnsServiceTest with 9-parameter sendMessage signature

* fix(sts,lambda): pass sessionToken to resolveCallerUserId and scope Lambda assumed role IDs

* fix(lambda): align execution role session name and assumed role ID with function name

* fix(sqs): resolve SenderId caller in SQS handlers, not in sendMessage

Internal producers (S3 notifications, EventBridge, SNS) call sendMessage
on the thread of the request that triggered them, so SenderId picked up
that caller's role session. Resolve the caller in the SQS Query/JSON
handlers where a real SendMessage call is known, and pass it down.
sendMessage without an explicit senderId now defaults to the queue owner.
2026-10-05 11:36:34 -04:00
TATSUNO “Taz” Yasuhiro a1ed65c51d feat(lambda): durable function callbacks (#5100)
* feat(lambda): durable function callbacks

A CALLBACK operation started at checkpoint gets a callback id that
SendDurableExecutionCallbackSuccess, Failure and Heartbeat complete or
keep alive, after which the function is invoked again to see it.
TimeoutSeconds and HeartbeatTimeoutSeconds time it out with
Callback.Timeout or Callback.Heartbeat. A completed, timed out or
stopped callback answers CallbackTimeoutException, an unreadable id
"Invalid callback id". The callback id carries the execution ARN, which
IAM authorizes the callback actions against.

Option range errors now name the update, as AWS does
("updates.1.member.waitOptions.waitSeconds").

* fix(lambda): name a repeated durable update as AWS does

AWS rejects two updates of one operation in a batch, other than a START
closed by its STEP or CONTEXT action, with "Cannot update the same
operation twice in a single request."

* fix(lambda): leave a durable execution waiting after a body-less callback failure

AWS marks a callback failed with an empty request body as FAILED but does
not invoke the function again, so the execution keeps waiting. The SDKs
send {} when Error is omitted, which does invoke it.

* fix(lambda): bound a durable callback failure's error at 1 MB

AWS rejects an Error over 1048576 bytes, measured as compact JSON, with
InvalidParameterValueException "Error object size must be less than or
equal to 1048576 bytes."

* test(lambda): keep a pending durable callback across a restart

* fix(lambda): reject a durable callback failure body that is not a JSON object

AWS treats only an empty body as a failure with no Error. Whitespace,
null or broken JSON get 400 SerializationException and leave the
callback open.

* docs(lambda): note the durable callback result limit AWS enforces
2026-10-05 10:27:50 -04:00
Aniket Shukla a6df1dbb12 fix(cloudformation): apply stack tags during updates (#5031)
* fix(cloudformation): apply stack tags during updates

* test(cloudformation): cover tags-only and failed stack updates

* fix(cloudformation): distinguish empty tags from omitted tags

* fix(cloudformation): reject implicit CREATE with previous template

* test(cloudformation): validate stack tag updates with AWS SDK

* test(cloudformation): fail on SDK cleanup errors

* fix(cloudformation): allow previous template with omitted type
2026-10-05 10:20:35 -04:00
Kenshin Okinaka 523003972e fix(apigateway): format request times with an English locale (#5093)
* fix(apigateway): format request times with an English locale

The REST requestTime, the HTTP API requestContext.time and the Lambda
function URL requestContext.time were formatted with
"dd/MMM/yyyy:HH:mm:ss Z" under the JVM default locale, so on a
non-English machine the month came out localized (e.g. "10月"). A REST
context mapping forwards that value into an integration request header,
where the JDK HTTP client rejected it and the call failed with 500.

Pin the formatters to Locale.ENGLISH, as the WebSocket event builder
already does, and have the HTTP API proxy and authorizer events reuse
the shared formatter in UTC instead of the system time zone.

* test(apigateway): cover HTTP API event times under a non-UTC host

Build the HTTP API proxy and REQUEST authorizer events under a Japanese
default locale and an Asia/Tokyo default time zone, and assert that
requestContext.time has an English month, a +0000 offset and the same
instant as timeEpoch. buildRequestAuthorizerEventV2 becomes
package-private so the test can reach it.
2026-10-05 10:08:38 -04:00
Aniket Shukla b988a061b4 fix(apigateway): preserve and update method response parameters (#5030)
* fix(apigateway): preserve and update method response parameters

* fix(apigateway): serialize method response patches and decode header paths

* fix(apigateway): return created for method response updates
2026-10-05 09:38:09 -04:00