Commit Graph
1645 Commits
Author SHA1 Message Date
Niels Kootstra 141b15939f fix(firehose): isolate streams by account and region (#3267)
* fix(firehose): isolate streams by account and region

* test(firehose): preserve default owner resolution

* fix(firehose): migrate owner-scoped state and source reads

* fix(firehose): avoid ambiguous legacy checkpoints
2026-09-08 23:44:13 -05:00
Niels Kootstra 8e10fd1ea6 fix(ram): enforce resource share principal visibility (#3266)
* fix(ram): enforce resource share principal visibility

* fix(ram): restrict resource share visibility

* fix(ram): handle reassociated invitations
2026-09-08 23:44:01 -05:00
Niels Kootstra 290559cff0 fix(lambda): scope extracted function code by region (#3265)
* fix(lambda): scope extracted function code by region

* fix(lambda): isolate new paths from legacy code

* chore(ci): retry transient pull request checks
2026-09-08 23:43:48 -05:00
Niels Kootstra e02accff4a fix(memorydb): scope resources by account and region (#3261)
* fix(memorydb): scope resources by account and region

* fix(memorydb): migrate legacy records during scans
2026-09-08 23:41:26 -05:00
Angel Abad 496b376da1 fix(ec2): nest cidrBlockState in AssociateVpcCidrBlock response (#3243)
AssociateVpcCidrBlock returned cidrBlockState as a bare string
instead of the nested <state> element that DescribeVpcs already
returns for the same association. terraform-provider-aws's SDK
waiter for aws_vpc_ipv4_cidr_block_association parses the nested
shape, so it never observed a valid state and polled DescribeVpcs
until giving up, hanging `terraform apply` on any
secondary_cidr_blocks entry.

Fixes #3241
2026-09-08 23:26:42 -05:00
Angel Abad eb3a6b23ef fix(ec2): match cidr-block-association filters on DescribeVpcs (#3257)
DescribeVpcs silently ignored the cidr-block-association.* and
ipv6-cidr-block-association.* filters: unrecognized filter names fell
through matchesFilter's default -> true, so every VPC in the account
matched regardless of the requested association.

terraform-provider-aws's waiter for aws_vpc_ipv4_cidr_block_association
polls DescribeVpcs filtered by cidr-block-association.association-id and
asserts exactly one VPC comes back. With more than one VPC in the
account that assertion failed with a too-many-results error, which the
SDK's retry machinery treats as not-found-yet rather than a fatal error,
so the waiter retried until its create timeout, hanging terraform apply
on any secondary_cidr_blocks entry.

Fixes #3256
2026-09-08 23:26:09 -05:00
TATSUNO “Taz” Yasuhiro f4954dec02 fix(dynamodb): word BatchWriteItem key rejections the way AWS does (#3227)
* fix(dynamodb): word BatchWriteItem key rejections the way AWS does

A key value can arrive on three surfaces, and AWS words the rejection
differently on each. The boolean that told a Key argument from a PutItem
item body is now an enum with a third value for BatchWriteItem.

BatchWriteItem reports a schema mismatch rather than naming the types,
and uses the "are not valid." form for an empty key value. PutItem and
TransactWriteItems keep the "Type mismatch for key" form.

An empty binary key value is now rejected on every surface. It was
accepted before, where the empty string was already rejected.

* fix(dynamodb): report a missing BatchWriteItem key as a schema mismatch

* fix(dynamodb): use the same empty string key wording on every surface
2026-09-08 23:18:52 -05:00
Hector Ventura 67198c7064 fix(elasticache): honor the requested Port on CreateReplicationGroup (#3276)
* fix(elasticache): honor the requested Port on CreateReplicationGroup

Port is a modeled optional input on CreateReplicationGroup ("the port number
on which each member of the replication group accepts connections"), but
allocateProxyPort took no argument and always handed out the next free port
from the base of the range. A caller that pinned a port read back a different
one, which Terraform reports as a replacement-forcing change and therefore as
permanent drift.

allocateProxyPort now takes the requested port and honors it when it is free
and inside the proxy range, matching NeptuneService.allocateProxyPort. Floci
multiplexes every group's proxy onto one host, so two groups genuinely cannot
share a port; when the requested one is taken or out of range this logs why
and falls back to the next free port rather than failing the create. In
cluster mode only the first node can take the requested port, because the
group reports its port from that node.

The compatibility fixtures pinned 6379, the bottom of the range and the port
floci would have allocated anyway, so they asserted nothing and passed by
coincidence. They now pin 6395, which fails without this fix.

* fix(elasticache): refuse a requested Port that cannot be honored

Honoring Port left one path that quietly ignored it: a requested port that was
already held by another replication group, or outside the range this emulator
serves, fell back to the next free one. The describe then reported the allocated
port, so a caller who pinned one still read back a different value and still saw
the replacement-forcing drift that honoring Port exists to remove. The narrower
case reproduced the bug the change was written to fix.

The fallback could only ever hit a caller who did ask for a port, since one who
does not care passes no Port at all and never reaches that branch, so it served
nobody. An explicit port is now either honored or refused with
InvalidParameterValue, the sender fault CreateReplicationGroup declares, naming
the port and the reason so the caller can pick another. Unpinned creates still
scan the range exactly as before, and the restore path for persisted groups is
unaffected because it asks for no particular port.

The two tests that pinned the old fallback are inverted rather than dropped, so
the new contract is held just as firmly, and one more proves an unpinned create
still falls back when the base port is taken.

NeptuneService.allocateProxyPort carries the same substitution and RdsService
ignores a requested port entirely; both are left for their own changes.

Raised by the review on this PR.
2026-09-08 22:42:22 -05:00
Franklin G. Mendoza d322d48bd5 fix(ram): emulate organization sharing side effects (#3279)
* fix: emulate RAM organization sharing side effects

* test(ram): add SDK organization sharing coverage
2026-09-08 22:30:08 -05:00
Franklin G. Mendoza ed116ae815 fix(guardduty): scope organization state across accounts (#3278)
* fix: scope GuardDuty state across accounts

* test(guardduty): add cross-account SDK coverage
2026-09-08 22:29:54 -05:00
Franklin G. Mendoza 9d4e71f8a2 feat(securityhub): add organization configuration operations (#3161)
* feat(securityhub): add organization configuration operations

* fix(securityhub): complete organization configuration contracts

* fix(securityhub): harden organization contracts

* test(securityhub): log tolerated organization state

* test(securityhub): clean organization fixture state

* test(securityhub): isolate organization cleanup failures

* fix(securityhub): return modeled invalid access error
2026-09-08 19:40:01 -05:00
Sam Fakhreddine fd3c4d9ab6 feat(cloudtrail): support AdvancedEventSelectors and CloudFormation Trail provisioning (#2720)
* feat(cloudtrail): support AdvancedEventSelectors in PutEventSelectors and S3 capture

Adds AdvancedEventSelector/AdvancedFieldSelector models, JSON wiring
through PutEventSelectors/GetEventSelectors, mutual-exclusivity
enforcement against basic EventSelectors, and field-selector evaluation
(Equals/NotEquals/StartsWith/NotStartsWith/EndsWith/NotEndsWith) in the
S3 data-event capture path. Lets a trail exclude its own log-delivery
bucket via resources.ARN NotStartsWith, avoiding the CloudTrail
circular-logging cost problem. Basic-selector behavior is unchanged.

* feat(cloudtrail): add CloudFormation provisioner for AWS::CloudTrail::Trail

Handles create/update/delete of AWS::CloudTrail::Trail via
CloudTrailService, applies EventSelectors or AdvancedEventSelectors
(mutually exclusive, same JSON shapes as PutEventSelectors), starts
logging when IsLogging is true, and sets the trail ARN as the
resource's physical id and Arn attribute. Delete is idempotent when
the trail is already gone.

* feat(cloudtrail): implement ListTrails and trail tagging

Adds ListTrails (returns Name/TrailARN/HomeRegion for trails visible
in the region, including multi-region trails), plus AddTags/ListTags
backed by per-trail stored state, keyed by trail name or ARN.

* fix(cloudtrail): emit data events for the trail's own log deliveries

CloudTrailLogWriter.flushTrail() wrote delivered log files via a direct
S3Service.putObject() call, bypassing S3Controller.emitCloudTrailEvent()
- the only place that recorded an S3 data event. A trail whose selector
matched its own destination bucket (the exact circular-logging config
from upstream issue #1192 / PR #1194) never saw its own deliveries,
so the emulator could prove the dangerous config was live but not
reproduce the loop it causes.

flushTrail now calls cloudTrailService.emitS3DataEvent() after each
delivery, so internal writes are evaluated against selectors identically
to API-driven ones. Closes issues/0034.

* docs: mark issue 0034 fixed

* fix(cloudtrail): resources.type reflects actual S3 resource, not hardcoded object

Advanced selector matching hardcoded resources.type to AWS::S3::Object for
every event, so an object-scoped AdvancedEventSelectors exclusion (the
real-world fix for the issue 0034 self-delivery loop) still let bucket-level
calls like ListObjects through against the excluded bucket. Now derived per
event from whether an object key is present.

Live-verified on 1160-ct: loop confirmed unbounded and compounding with
external writes, then confirmed stopped by the real AdvancedEventSelectors
remediation, with this gap found and closed in the same pass. Details in
issues/0034 and issues/0035.

* docs(0034): add raw delivery-size timeline from 1160-ct verification

Per-cycle size data showing the burst-compounding and the fix-stop point
concretely, not just summarized.

* fix(cloudtrail): match delete() to current CfnResourceProvisioner signature

Upstream/main dropped the accountId parameter from
CfnResourceProvisioner.delete() since this branch was originally
authored; the provisioner never used accountId in its body, so the
fix is a straight signature match with no behavior change.

* docs(cloudtrail): regen action table and register CFN Trail resource type

New ListTrails/AddTags/ListTags actions and the CloudFormation
AWS::CloudTrail::Trail resource type need doc entries per the repo's
docs-check gate.

* fix(cloudtrail): enforce AddTags 200-tag list limit

Botocore's AddTagsRequest.TagsList models a 200-item max (service-2.json,
cloudtrail 2013-11-01); the handler accepted an unbounded list. RED test
added first (addTagsRejectsMoreThanTwoHundredTags), confirmed failing
(200 instead of 400), then fixed by rejecting oversized lists with
TagsLimitExceededException, matching AWS's modeled error for AddTags.

* fix(cloudformation): close two audit-control gaps in CloudTrailCfnProvisioner

Local code review flagged two HIGH findings in the new CFN provisioner:

- physicalId was only set after selector validation and startLogging
  succeeded, so a create that failed on the mutually-exclusive
  EventSelectors/AdvancedEventSelectors check left a real trail with no
  recorded physical id for the engine to clean up. Now set immediately
  after createTrail returns.
- update only called startLogging when IsLogging was explicitly true,
  never stopLogging when it was explicitly false, so a template setting
  IsLogging: false on a currently-logging trail silently left logging
  enabled.

RED tests confirmed both failures against the pre-fix code, then GREEN
after the fix (6/6 provisioner tests, 51/51 CloudTrail suite).

* docs(issues): ledger deferred CloudTrail local-review findings

MEDIUM/LOW findings from the local code-review pass, plus a few
inherited-not-ours items on code this branch didn't touch, that are
real but out of scope for the CFN provisioner / advanced-selectors PR.

* style(cloudtrail): brace unbraced conditionals in ListTrails and event-matching traversal

Per AGENTS.md style rule (always use braces in conditionals).

* fix(cloudtrail): avoid NPE on List.of(trailName) when TrailName is missing

PutEventSelectors/GetEventSelectors called List.of(trailName) with a
possibly-null trailName before findTrailOrThrow could validate it,
throwing an NPE (500 InternalFailure) instead of the modeled
TrailNotFoundException. Guard the lookup so the null flows through to
the existing validation.

* fix(cloudtrail): do not re-queue records on self-delivery emission failure

flushTrail wrapped the self-delivery emitS3DataEvent call in the same
try/catch as the S3 write. A failure there re-queued records that were
already durably written, causing the next flush to redeliver the same
batch. Split the write and the emission into separate try blocks so
only a write failure triggers requeue.

* docs(cloudformation): register AWS::CloudTrail::Trail in the resource-type inventory

CfnResourceInventoryTest and the docs-sync resource-type table both
derived from supported-resource-types.tsv, which never picked up
CloudTrailCfnProvisioner's registration.

* docs(issues): drop fork-local ledger files from the PR

Per maintainer review, the issues/ ledger entries are fork-local tracking notes and are kept out of the upstream contribution.

* fix(cloudformation): wire CloudTrailCfnProvisioner into CfnProvisionerFixture

CfnProvisionerFixtureTest.everyProvisionerIsReachableThroughThePublicBuilderOrExplicitlyExempt
failed because CloudTrailCfnProvisioner had no field, setter, or
construction arm in the test fixture, so a test naming CloudTrailService
would silently fall through to the stub arm instead of exercising the
real provisioner.

Add cloudTrailService field, cloudTrail(CloudTrailService) setter, and
the discovered.add(new CloudTrailCfnProvisioner(...)) construction arm,
mirroring the existing Route53Service wiring.

* fix(cloudtrail): drop em-dashes from new test comments per AGENTS.md style check

* fix(cloudtrail): reject mixed basic and advanced selectors with InvalidEventSelectorsException

PutEventSelectors does not model InvalidParameterCombinationException; the
error it declares for an invalid selector combination is
InvalidEventSelectorsException (botocore cloudtrail/2013-11-01). Both the
JSON handler and the AWS::CloudTrail::Trail provisioner now throw that
code, and the integration test pins it. Also braces the remaining
one-line conditionals in matchesAdvancedFieldSelector.
2026-09-08 19:38:13 -05:00
Allen Sanborn c1e5cc239f fix(mq): match CreateBroker EngineType and DeploymentMode without regard to case (#3268)
* fix(mq): match CreateBroker EngineType without regard to case

CreateBroker compared EngineType with equals() against "RABBITMQ", so "RabbitMQ" --
the spelling AWS uses everywhere outside the enum itself -- was refused:

    BadRequestException: Only RABBITMQ EngineType is supported

The API reference gives the EngineType enum as ACTIVEMQ | RABBITMQ, but that is not
the form callers write. The Amazon MQ console, the developer guide and the
aws_mq_broker registry example all use "RabbitMQ" and "ActiveMQ", and SDK clients
transmit the caller's string verbatim rather than normalising it. A broker declared
the documented way therefore never reached the emulator's happy path.

Match case-insensitively and keep storing the canonical uppercase form, so
DescribeBroker still reports RABBITMQ however the request spelled it.

Also name the offending engine in the rejection message. The old text was reused for
ActiveMQ, which is a real capability gap rather than a malformed request, leaving
the two indistinguishable: someone who wrote "RabbitMQ" and someone who asked for
ActiveMQ got the same sentence.

References:
- EngineType enum and the CreateBroker input model --
  https://docs.aws.amazon.com/amazon-mq/latest/api-reference/brokers.html
- The developer guide and console consistently write RabbitMQ / ActiveMQ --
  https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/rabbitmq-basic-elements-broker.html

Worth a maintainer's eye: I have confirmed that clients send the mixed-case string
and that real-world Terraform modules are written that way, but I could not verify
against real AWS whether it accepts "RabbitMQ" or normalises it somewhere earlier in
the stack. If AWS is in fact strict here, the more faithful fix would be to keep
rejecting it and let the caller correct the spelling -- though that would break every
module written to the published examples.

* fix(mq): match CreateBroker DeploymentMode without regard to case

The EngineType fix (fix/mq-enginetype-case-insensitive) left the DeploymentMode
compare next to it on String.equals against the upper-case wire enum, so
`deployment_mode = "single_instance"` -- naming the one mode this emulator does
support -- came back as "Only SINGLE_INSTANCE DeploymentMode is supported".
Same defect, same line of reasoning, one guard away.

Both members are now matched with equalsIgnoreCase, and the canonical wire casing
is stored rather than the caller's so DescribeBroker reads back the enum value the
SDKs expect however the request happened to be spelled.

Consolidation note: this is the DeploymentMode half of cabe5ccc on
fix/messaging-terratest. That commit's EngineType and MSK serverProperties halves
were already carried by 2eb27421 and 3d167252 respectively, so only this remained.
2026-09-08 19:42:37 -04:00
Allen Sanborn 27d2de0479 docs(lambda): say blank LogGroup is deliberately read as not supplied (#3271)
* docs(lambda): say blank LogGroup is deliberately read as not supplied

LogGroup carries a 1-512 length constraint, so an empty string is a
length violation on paper, yet validateLogGroup exempts blank and
applyLoggingConfig then falls back to the /aws/lambda/ default. That
looked like the guard missing the minimum.

It is a choice, not an oversight. botocore enforces the 1-character
minimum client side, so an empty LogGroup never reaches the wire from
an SDK caller and nobody has observed what the service answers to one.
A 400 here would be inferred rather than measured, and rejecting a
request we have never seen AWS reject is the expensive side of the
trade; accepting it costs a caller nothing.

Say that in the javadoc, and pin the leniency with a test so a later
reader who wants the minimum enforced has to change the decision
rather than just the guard.

* test(lambda): pin the whitespace-only LogGroup case, not just the empty one

The javadoc says blank means "empty or whitespace-only" and the guard is isBlank(),
but the only test passed "". Narrowing isBlank() to isEmpty() left the suite green,
so half the documented contract was unpinned.

Adds the whitespace-only case. Verified load-bearing: with isEmpty() in place of
isBlank() this test alone fails, and nothing else does.
2026-09-08 15:35:35 -04:00
Niels Kootstra b6080ea4ff fix(cloudcontrol): scope resources by caller account (#3244)
* fix(cloudcontrol): scope resources by caller account

* fix(cloudcontrol): register persisted models for reflection

* fix(cloudcontrol): make persisted recovery idempotent

* fix(cloudcontrol): preserve request order across restart
2026-09-08 15:29:49 -04:00
BingEdward 8bc4891a9a fix(ec2): report NotFound for launch templates requested by name (#3246)
* fix(ec2): report NotFound for launch templates requested by name

DescribeLaunchTemplates filtered the launch-template collection and
returned whatever matched, so an explicitly requested LaunchTemplateName
that does not exist came back as an empty success. Karpenter creates a
missing launch template only when the lookup fails with
InvalidLaunchTemplateName.NotFoundException, so the empty list read as
"already there" and left EC2NodeClass validation stuck at
launch-template-count=0.

An explicit name or id is now checked against the region's templates
before filtering, mirroring DescribeKeyPairs. Unqualified listings and
filter queries that match nothing still return an empty list.

The lenient scan stays available as matchingLaunchTemplates for the
callers that treat "absent" as an answer: DescribeLaunchTemplateVersions
feeds AutoScaling's own ValidationError for an unresolved template, and
the reconciler must not abort a pass over a group whose template was
deleted.

Fixes #3234

* fix(autoscaling): only treat NotFound as a deleted launch template

The reconciler's launch-template lookup caught every AwsException and
returned null, so any other failure from DescribeLaunchTemplates would
have read as "the template is gone" and silently skipped the group's
scaling instead of surfacing.

Only InvalidLaunchTemplateName.NotFoundException and
InvalidLaunchTemplateId.NotFound mean the template is absent; anything
else now propagates, which reconcileAll already logs per group.

* fix(ec2): use InvalidLaunchTemplateId.NotFound on the mutating paths

DescribeLaunchTemplates reports a missing explicit id as
InvalidLaunchTemplateId.NotFound, while findLaunchTemplate — the lookup
behind ModifyLaunchTemplate, DeleteLaunchTemplate,
CreateLaunchTemplateVersion and resolveLaunchTemplateData — spelled the
identical condition InvalidLaunchTemplateId.NotFoundException, so the two
disagreed on the wire code for the same missing template.

EC2 has no Exception suffix on the id code, only on the name one; that
asymmetry is now noted where it is easy to "correct" by mistake.
2026-09-08 13:30:58 -04:00
Kenshin Okinaka 172765a808 fix(secretsmanager): serialize secret version updates with the rotation lock (#3247)
* fix(secretsmanager): serialize secret version updates with the rotation lock

PutSecretValue and UpdateSecretVersionStage rewrote a secret's version stages
without the per-secret lock that RotateSecret's "a previous rotation isn't
complete" guard reads under, so a rotation Lambda writing its AWSPENDING
version could leave that staging label momentarily unassigned. A RotateSecret
call landing in that window started a second rotation over a live one.

Both operations now take that lock, and PutSecretValue no longer strips a
staging label off the version it is about to replace under the same version
id, so the label stays attached for readers that do not take the lock.

* fix(secretsmanager): lock the non-immediate rotation lifecycle and name the staging label in two errors

RotateSecret with RotateImmediately=false retires AWSPENDING from its
background thread, and that read-modify-write ran outside the per-secret lock
the other staging-label updates now take, so a concurrent PutSecretValue could
still interleave with it.

UpdateSecretVersionStage's two RemoveFromVersionId errors formatted the
staging-label placeholder with the SecretVersion holding the label, printing
its identity instead of the label the sentence names. The strings themselves
were not re-probed against AWS.

* fix(secretsmanager): keep the version id in the RemoveFromVersionId mismatch error

The mismatch error names the staging label in its first placeholder, so only
that argument was wrong. Its second placeholder keeps the id of the version
that currently holds the label, which is the part a caller needs to correct
the request. The wording itself still wants an AWS probe.
2026-09-08 09:18:25 -04:00
Niels Kootstra 379910b008 fix(iam): use AWS-managed policy documents (#3237)
* fix(iam): use AWS-managed policy documents

* fix(iam): include managed policy documents in native images
2026-09-08 09:10:18 -04:00
Kenshin Okinaka 8a122d2b8c feat(firehose): validate and persist DataFormatConversionConfiguration (#3236)
* feat(firehose): validate and persist DataFormatConversionConfiguration

Accept, validate, store, and echo the extended S3 destination's
DataFormatConversionConfiguration instead of silently ignoring it.
Validation messages and precedence follow probed AWS behavior: Smithy
ParquetSerDe bounds first, then compression, buffering floor, and
member checks in AWS order, identical on CreateDeliveryStream and
UpdateDestination, which now merges the configuration member-wise and
validates the merged effective state. OrcSerDe is rejected as a
documented deviation (the planned DuckDB engine cannot write ORC).
Conversion itself is not applied yet: delivery logs a warning and
ships records unconverted.

* docs(firehose): match the conversion helpers' wording to what they do

The legacy-shape helper clears DataFormatConversionConfiguration alone, not
every extended-only member, and the create/update warning fires on each call
that leaves conversion enabled rather than once. Rename the first and reword
both so the contract a reader infers is the one the code keeps.
2026-09-08 09:01:31 -04:00
Mario Toffia af42564cb3 feat(lambda): provision AWS::Lambda::EventInvokeConfig (#3230)
* feat(lambda): provision AWS::Lambda::EventInvokeConfig

The physical id is the registry schema's composite FunctionName|Qualifier
identifier. A create puts the configuration, an update with the same identity
applies the template's settings through the merge-style update call, and a
changed function or qualifier is a replacement whose displaced configuration
the ReplacementCleanup record deletes once the update commits or restores on
rollback. The schema's MaximumRetryAttempts and MaximumEventAgeInSeconds
bounds are checked before any call, as CloudFormation validates them before
the handler runs.

The Lambda docs now list the five event invoke config operations, which the
page wrongly called not implemented, and say that asynchronous invocations do
not yet apply the settings.

* fix(lambda): update the event invoke config in place for equivalent names and roll back in-place changes

A short name and the function's ARN address one configuration, so an update
that changes between them updates in place under the prior physical id
instead of recording a replacement whose cleanup would delete that one
configuration. An in-place update keeps the settings it replaces on the
resource, and a failed stack update puts them back in full. DestinationConfig
is resolved before it is looked at, so a conditional that resolves to
AWS::NoValue is omitted rather than sent as an empty destination set. The
integration test reads stack events with XmlParser.

* fix(lambda): keep the event invoke config rollback snapshot until the restore succeeds

A restore that throws left no snapshot behind, so the next rollback attempt
reported success without restoring anything. The snapshot is now spent only
after the settings are back.
2026-09-08 07:34:52 -04:00
Ricky Rattlesnake d9cddc56cb fix(s3): honor per-object VersionId in batch DeleteObjects (#3232)
* fix(s3): honor per-object VersionId in batch DeleteObjects

DeleteObjects parsed request bodies with a flat extractAll(xml, "Key"),
discarding every <VersionId> before it reached S3Service. The batch path
then always called the 2-arg deleteObject(bucket, key), the
no-version-specified overload — so on a versioned bucket every batch
delete placed a new delete marker instead of removing the version named,
even when the request pointed at a specific version or a delete marker's
own version id. Repeated list-then-batch-delete cycles accumulate
delete markers without bound and slow down ListObjectVersions.

XmlParser gains extractDeleteObjectEntries, which pairs each <Key> with
the VersionId from the same <Object> block (absent VersionId -> null).
S3Controller.handleDeleteObjects and S3Service.deleteObjects now carry
that pairing through authorization and into the existing, already-correct
3-arg deleteObject(bucket, key, versionId) - the same code path #1045
fixed for the single-object DeleteObject API. That fix only touched the
single-object path; the batch path never reached it, which is the gap
this closes.

* fix(s3): authorize and report explicit-version batch deletes correctly

The batch DeleteObjects path introduced in the previous commit carried
each entry's VersionId through to deleteObject, but two spots still
treated every entry as an unversioned delete:

- handleDeleteObjects authorized every entry as s3:DeleteObject, even
  one naming an explicit VersionId. A bucket policy granting ordinary
  deletion but not s3:DeleteObjectVersion therefore let an unsigned
  caller permanently remove a retained version through the batch API,
  though the equivalent single-object DELETE (authorizeDeleteObject)
  already denies it. The batch loop now calls that same
  authorizeDeleteObject(bucket, key, versionId, authorization) helper
  instead of hardcoding the action, so both paths enforce identically.

- The <Deleted> entries in the response never serialized VersionId, so
  a successful explicit-version delete returned no version id to the
  caller even though S3Service.DeleteResult already carried it.
  handleDeleteObjects now emits <VersionId> when present.

Adds batchDeleteObjectsPolicyGrantDoesNotAuthorizeVersionedDelete,
mirroring deleteObjectPolicyGrantDoesNotAuthorizeVersionedDelete for the
batch endpoint, and extends S3DeleteObjectsIntegrationTest to assert the
response VersionId on explicit-version deletes and its absence on plain
key deletes.

* docs(core): remove em dash from extractDeleteObjectEntries javadoc

Replace the em dash in XmlParser.extractDeleteObjectEntries's javadoc
with a period, per the repository's prohibited-em-dash directive.
2026-09-08 07:27:27 -04:00
David ebd849a956 fix(lambda): serialise the version snapshot against function updates (#3010)
publishVersion copies roughly thirty fields off the live LambdaFunction
inside synchronized (lockForConcurrencyOp(...)), but neither updater took
that lock, so nothing was serialised. An update landing mid-copy produced a
snapshot that was part old code and part new configuration, carrying a
sourceRevisionId that identified neither state.

#2939 made extractZipCodeBytes publish the code identity fields under the
lock, which closed the CodeSha256 precondition hole specifically. The rest of
the snapshot copy stayed unprotected, and updateFunctionConfiguration never
took the lock at all.

Both updaters now take the same per-function lock. Their bodies move
unchanged into private *Locked methods behind a thin wrapper, so the change
is a small number of production lines rather than a few hundred lines of
reindentation. The monitor is one object per function ARN and synchronized is
reentrant, so the nested acquisitions inside extractZipCodeBytes, and
publishVersion's own when updateFunctionCode is called with Publish, are
no-ops rather than a second lock. Every existing acquisition is keyed to a
single function, so there is no cross-ARN ordering to invert.

Zip extraction now runs inside the lock. extractZipCodeBytes called extractTo
outside it and took the lock only to publish the code fields afterwards, so a
deploy could rewrite $LATEST's code directory while publishVersion held the
lock copying that directory into a version's own (#3041). Serialising the
whole updater closes that too.

UpdateFunctionConfiguration's structure members stay shape-checked ahead of
the function lookup, where #3051 put them, so a malformed member on a
function that does not exist still reports SerializationException rather than
404. The locked body re-reads them; structureMember is pure, so the second
read cannot fail once the first has passed. That ordering was not pinned by
any test, and now is.

This also corrects a comment from #2939 claiming the hash check ran "inside
the lock UpdateFunctionCode takes". UpdateFunctionCode did not take a lock.

Closes #3007
2026-09-08 07:23:24 -04:00
Niels Kootstra 1b1252505b fix(sts): validate SAML assertions before assuming roles (#3204)
* fix(sts): validate SAML assertions before assuming roles

* test(sts): use valid SAML fixture in SDK compatibility tests

* fix(sts): address SAML review findings

* fix(sts): align SAML fixtures with verifier

* test(sts): share compatibility XML parser
2026-09-08 07:14:38 -04:00
Langning ZhangandPriamo cc8b8e9f14 fix(core): quarantine unreadable hybrid storage (#2250)
Co-authored-by: Priamo <pgermosen@gmail.com>
2026-09-08 00:31:51 -04:00
Hector Ventura 725577416d refactor(cloudformation): move the EC2 networking types into Ec2NetworkCfnProvisioner (#3223)
* refactor(cloudformation): move the EC2 networking types into Ec2NetworkCfnProvisioner

Batch 4 of the CloudFormationResourceProvisioner split. AWS::EC2::Subnet, InternetGateway,
RouteTable, Route, NatGateway, EIP and SubnetRouteTableAssociation move into a new
Ec2NetworkCfnProvisioner that injects only Ec2Service; the seven arms, their switch cases
and type-list entries leave the monolith (SecurityGroup and Instance stay for now).

Behaviour is preserved: same physical ids (the EC2 id, a generated one for a Route, the
public IP for an EIP), same attribute keys, no delete arm (the switch had none for these
types, so stack teardown still leaves them alone; that follows separately), and the same
re-create-on-update path. The one addition is the Route's CidrBlock attribute, the read-only
property the registry schema declares, set to the destination the route was created with.
The read-only attributes Floci does not emulate (Subnet NetworkAclAssociationId,
Ipv6CidrBlocks, BlockPublicAccessStates; NatGateway EniId, AutoProvisionZones, AutoScalingIps,
RouteTableId) are recorded in getatt-attribute-gaps.tsv with reasons, since the coverage gate
starts auditing these types once they leave the switch.

The unit test covers each type's physical id and exact attribute set with a mocked service.

* fix(cloudformation): delete the EC2 networking resources a stack created

The legacy switch had no delete arm for Subnet, InternetGateway, RouteTable, Route,
NatGateway, EIP or SubnetRouteTableAssociation, so DeleteStack logged "No delete
implemented" and left all seven behind. Ec2NetworkCfnProvisioner now deletes each through
its own Ec2Service call, tolerating only that type's not-found code (InvalidSubnetID.NotFound,
InvalidInternetGatewayID.NotFound, InvalidRouteTableID.NotFound, InvalidRoute.NotFound,
NatGatewayNotFound, InvalidAllocationID.NotFound, InvalidAssociationID.NotFound); a
DependencyViolation still fails the stack delete, as on AWS.

A Route's physical id becomes <RouteTableId>|<destination>, the registry primary identifier
and what Ref returns on AWS; the generated LogicalId-<random> id identified nothing, so a
route could never have been deleted. An id without the separator, from a stack created under
the switch, is left alone rather than guessed at. An EIP's Ref is its public IP, so the release
uses the AllocationId recorded at create time and falls back to a lookup by address.

CloudFormationEc2NetworkingIntegrationTest provisions a public/private networking stack the
way CDK lays one out, checks the Ref and Fn::GetAtt shapes, and asserts the delete removes
every id from the EC2 describe calls.

* fix(cloudformation): keep EC2 networking resources across stack updates instead of re-creating them

provision runs again on every UpdateStack, and the switch created a new subnet, gateway,
route table, route, NAT gateway, EIP and association each time, re-pointing the stack at the
copies and leaving the originals behind. Ec2NetworkCfnProvisioner now describes the prior
entity and keeps it when its create-only properties are unchanged (Subnet: VpcId, CidrBlock,
AvailabilityZone; RouteTable: VpcId; NatGateway: SubnetId, AllocationId; association: both;
Route: table and destination; InternetGateway and EIP: nothing a template can change), applying
the mutable ones in place (MapPublicIpOnLaunch, a route's target through ReplaceRoute). A
changed create-only property creates the replacement, and the ReplacementCleanup record
deletes the displaced entity once the update commits or restores it on rollback, as
CloudFormation does; a prior entity gone out of band is created anew.

The end-to-end test deploys the same template twice and asserts every id survives, then
changes the public subnet's CIDR and asserts the subnet and the NAT gateway inside it are
replaced and the displaced ones removed. The VPC is created through the EC2 API and passed in
as a literal, since Ec2VpcCfnProvisioner still re-creates a VPC on every update (#3033).

* fix(cloudformation): apply Tags to EC2 networking resources

The switch ignored the Tags property on Subnet, InternetGateway, RouteTable, NatGateway and
EIP, so a tagged template produced untagged resources and DescribeSubnets and friends showed
no tagSet. Ec2NetworkCfnProvisioner now writes the resolved tags through CreateTags on create
(a NAT gateway takes them on its own create call) and reconciles them on an in-place update:
keys the template dropped are removed with DeleteTags, the rest rewritten. A template with
no Tags property leaves whatever the entity carries, as before.

* fix(cloudformation): honour ConnectivityType on a CloudFormation NAT gateway

The switch created every AWS::EC2::NatGateway as public, whatever the template said, so a
private NAT gateway (no EIP, the shape a private-only VPC uses) came out public with no
address. The provisioner now passes ConnectivityType through, defaulting to public as the
schema does, validates the pairing the way AWS does (a public gateway requires AllocationId,
a private one must not carry one) with ValidationError, and treats ConnectivityType as the
create-only property it is: a change replaces the gateway.

* fix(cloudformation): validate the required properties of the EC2 networking types

A template that omitted VpcId on a Subnet or RouteTable, RouteTableId or SubnetId on an
association, or RouteTableId or a single destination on a Route passed the null through to
Ec2Service, which answered with its own parameter errors or a NullPointerException. The
provisioner now fails the resource with ValidationError using the repo's wording
("AWS::EC2::Subnet requires VpcId"; a Route requires exactly one of the three destination
properties), before any service call, so the stack event names the property.

* fix(cloudformation): never orphan an EC2 networking entity when a step after its create fails

Tags were applied before the resource had its physical id, and the replacement record is
only written when provision returns, so a CreateTags failure after the EC2 create left the
new subnet, gateway, route table or EIP behind: the engine deletes a failed create only when
it can see the id (and the rollback-owned marker), and on a failed update it restores the
previous resource metadata and forgets what the attempt made. The provisioner now writes the
id and attributes right after the create and runs the following steps under a guard that, when
this provision created the entity, deletes it again before the failure propagates; a reused
entity is left as it is.

* fix(cloudformation): roll back in-place changes to EC2 networking resources

rollbackUpdate answered true for a reused gateway, route table, NAT gateway or EIP on the
grounds that nothing about them is mutable, which stopped being true once Tags were applied
in place: a later resource failing produced UPDATE_ROLLBACK_COMPLETE with the failed
template's tags still on the entity. A subnet or route changed in place reported not rolled
back and stayed changed.

The provisioner now snapshots what an in-place update is about to change on a reused entity
(the prior tags and the keys it writes, a subnet's prior MapPublicIpOnLaunch, a route's prior
target) into an internal __FlociEc2NetworkPrior attribute before the change, and
rollbackUpdate restores it: keys the update added are removed and the prior tags written
back, the subnet attribute and the route target put back through ModifySubnetAttribute and
ReplaceRoute. completeUpdate and clearUpdate drop the snapshot. Every one of the seven types
now rolls back for real; the one case left is the resource whose own provision failed
mid-way, whose previous metadata the engine restores before any rollback runs, as for every
provisioner.

The end-to-end test flips a route table tag and a subnet's MapPublicIpOnLaunch next to a
resource that cannot be created and asserts UPDATE_ROLLBACK_COMPLETE leaves both as before.

* fix(cloudformation): require SubnetId on a CloudFormation NAT gateway

The registry schema declares no required properties for AWS::EC2::NatGateway, but
CreateNatGateway cannot do anything without a subnet and Ec2Service answered a missing one
with InvalidSubnetID.NotFound for "null". The provisioner now fails the resource with the
repo's ValidationError wording before any service call, as it does for the other required
properties. Also bounds the test helper's varargs loop so an odd argument count cannot read
past the array, which CodeQL flagged.

* fix(cloudformation): key a CloudFormation route by the canonical CIDR the service stores

Ec2Service canonicalises an IPv4 destination on CreateRoute (10.40.0.18/24 is stored as
10.40.0.0/24), but the provisioner built the physical id, the CidrBlock attribute and the
reuse check from the template's raw value. A template with a non-canonical destination
therefore missed its own route on every unchanged update and tried to create it again,
which RouteAlreadyExists refused, and Ref exposed a string AWS would never return. The
provisioner now runs the IPv4 destination through the same CidrCanonicalizer before using it
as an identifier; IPv6 and prefix-list destinations are unchanged, and the create and replace
calls still pass the raw value, which the service canonicalises again.

* fix(cloudformation): undo a partial in-place change when an EC2 networking update fails mid-way

The in-place snapshot lived only on the attempted StackResource. When the update of a reused
entity failed after its first change (DeleteTags done, CreateTags refused), the engine
discarded that object, restored the previous metadata and never called rollbackUpdate, so
the entity kept the partial change under an UPDATE_ROLLBACK_COMPLETE. The guard that already
undoes a create when a later step throws now also restores a reused entity from its snapshot
before the failure propagates, and the NAT gateway's reuse-path tags and the route's in-place
re-target run inside it. The engine's metadata restore then matches the entity again.

* fix(cloudformation): report a failed compensation on an EC2 networking resource instead of hiding it

When the undo inside the guard failed too (the delete of an entity this provision created, or
the restore of a reused one from its snapshot), the failure was only attached as suppressed,
the snapshot was already gone, and the engine, seeing no failure marker on the attempted
resource, restored the previous metadata and reported UPDATE_ROLLBACK_COMPLETE over a
partially updated entity or a leaked create.

The guard now uses the engine's contract for exactly this, as IotCfnProvisioner and
IamRoleCfnProvisioner do: a created entity carries __FlociRollbackOwned while the steps run,
so a failed undo leaves it for the engine's create rollback to delete and report; a reused
entity keeps its snapshot when the restore fails, and the reason goes into
__FlociUpdateRollbackFailure, which the engine copies onto the committed resource so the
rollback walker reports UPDATE_ROLLBACK_FAILED with it. A successful undo or restore clears
both markers; the original failure still propagates.

* fix(cloudformation): keep a replacement that a failed update could not remove owed to the next cleanup

During a replacement update, when a step after the EC2 create failed and the undo delete of
the new entity failed too, the rollback-owned and failure markers sat on the attempted
resource, which the engine discards while restoring the previous one: the stack reported
UPDATE_ROLLBACK_FAILED, correctly, but the new entity's id went with the attempt and nothing
would ever retry deleting it.

The entity is now listed as a non-retainable entry in the ReplacementCleanup record (new
recordOrphan), and the engine's mergeFailedUpdateResourceTracking hook, which so far carried
only ApiGatewayV2 tracking, merges the attempt's record onto the restored resource (new
mergeDisplaced), for every provisioner that uses the helper. The engine already runs that
record before every committed update and before a stack delete, retrying up to three times
and reporting the failure otherwise, so the orphan is removed at the next opportunity.
ReplacementCleanupTest pins the helper; the merge hook is covered next to its existing case.
2026-09-07 23:29:35 -05:00
Franklin G. Mendoza 4944764fa3 feat(inspector2): add organization configuration operations (#3162)
* feat(inspector2): add organization configuration operations

* fix(inspector2): complete organization contracts

* fix(inspector2): scope organization account state

* test(inspector2): log tolerated organization state

* test(inspector2): isolate organization cleanup
2026-09-07 22:54:52 -05:00
e313ab5b1d fix(dynamodb): honor customer-supplied KMS key for table SSE (#1923)
* fix(dynamodb): honor customer-supplied KMS key for table SSE

CreateTable discarded SSESpecification.KMSMasterKeyId and always stored
the default AWS-managed key ARN, so CreateTable/DescribeTable responses
never reflected a customer-managed key. It also hardcoded SSEType to
KMS, ignoring AES256. UpdateTable had no SSESpecification handling at
all, so a table's encryption could not be enabled, rotated to a new
key, or disabled after creation.

* fix(dynamodb): persist post-create/update SSE state and validate SSEType

Address PR review feedback: CreateTable/UpdateTable mutated the table's
SSE fields after the service layer's own persistence call, so a
persistent/WAL storage backend would silently drop the encryption
settings (along with other post-create/update fields) on reload. Both
handlers now re-persist the fully mutated table before responding.

SSEType was also accepted verbatim with no enum check, letting an
invalid value be stored and echoed back in SSEDescription. Both
handlers now validate it against {KMS, AES256}.

Adds a reload test proving SSE settings survive a fresh
PersistentStorage instance reading the same file, an AES256 coverage
test, and validation-failure tests for both CreateTable and
UpdateTable.

* fix(dynamodb): validate SSEType before mutating, not after

Closes the remaining review items on this PR:

- Resolved the merge conflict with #1811 (global table v2 replicas) in
  handleUpdateTable. Also found and fixed a duplicate: main had
  independently added its own persistTable(...) flush for the same
  stream-persistence reason this PR added one for SSE, so the two
  collapse into one call.

- Moved SSEType validation ahead of createTable/updateTable in both
  handlers, mirroring the existing validateReplicaUpdates-before-
  updateTable pattern already used in handleUpdateTable. Previously an
  invalid SSEType threw only after the table (and possibly its stream)
  were already created/mutated, leaving real side effects behind a
  ValidationException -- real DynamoDB rejects the whole request first.

- The merge resolution deliberately does NOT follow the literal
  "replica block first" suggestion from review: applyReplicaUpdates
  re-fetches the table from storage for its own persist, and a
  persistent backend does not hold the live object (confirmed by
  reading both applyReplicaUpdates itself and the comment already on
  main's persistTable call). Running it before the stream/SSE
  mutations are flushed would silently drop them, not just SSE's.
  Kept main's original persistTable-then-applyReplicaUpdates ordering
  instead, with the SSE block slotted in before the flush, matching
  the same stream-then-SSE-then-persist shape CreateTable already uses.

- Added DescribeTable assertions to both existing invalid-SSEType
  tests confirming no side effects survive the failed request (no
  table for CreateTable, no SSEDescription change for UpdateTable) --
  meaningful now that validation actually runs first.

AES256 test coverage (createTableWithAes256SseOmitsKmsMasterKeyArn)
was already present as of the second commit on this branch; no
further gap there.

---------

Co-authored-by: Priamo Germosen <6233424+pgermosen@users.noreply.github.com>
Co-authored-by: Priamo <pgermosen@gmail.com>
2026-09-07 23:46:15 -04:00
Matheus André cf8466b58c feat(asl): add support for States.ArrayPartition, States.ArrayRange, States.ArrayUnique, and States.MathRandom intrinsics with comprehensive tests (#3224)
Signed-off-by: Matheus André <matheusandr2@gmail.com>
2026-09-07 23:42:34 -04:00
BingEdward d95ed9f8fe fix(pipes): restore a CloudFormation snapshot without re-validating it (#3218)
* fix(pipes): restore a CloudFormation snapshot without re-validating it

restorePipe went through the same source validation as UpdatePipe, so a
pipe whose persisted configuration predates a rule added since (a Kafka
source without TopicName, or a ParallelizationFactor outside 1..10 after
#3192) could not be put back after a failed stack update and the resource
ended up UPDATE_ROLLBACK_FAILED. Validation now runs on the UpdatePipe
path only; a restore writes the configuration that was already accepted.

Fixes #3209

* fix(pipes): validate an update against the pipe it mutates

UpdatePipe looked the pipe up once to validate the source configuration
and writePipeConfiguration looked it up again to mutate it, so a pipe
deleted and recreated between the two would be validated as the old pipe
and written as the new one. Validate inside writePipeConfiguration on
the single retrieved instance, skipped only on the restore path.
2026-09-07 22:40:16 -05:00
TATSUNO “Taz” Yasuhiro cbec02df04 feat(dynamodb): import tables from S3 and report new exports as IN_PROGRESS (#3138)
* feat(dynamodb): import tables from S3 and report new exports as IN_PROGRESS

ExportTableToPointInTime handed its worker the same description object it
returned, so a small export could already read COMPLETED in the initial
response. The worker now mutates a copy and runs under the request account.

ImportTable creates the table in CREATING, loads DynamoDB JSON lines from
every object under the S3 prefix on a virtual thread, and flips the table
to ACTIVE when done. DescribeImport and ListImports report it. DYNAMODB_JSON
with NONE or GZIP compression is accepted. CSV, ION and ZSTD are rejected
with a ValidationException.

* fix(dynamodb): item calls on a CREATING table return ResourceNotFoundException

* fix(dynamodb): concurrent ImportTable calls with one ClientToken share one import

* fix(dynamodb): import reads S3 as the caller and denies another account's bucket
2026-09-07 22:25:24 -05:00
TATSUNO “Taz” Yasuhiro fd21ac9a6d feat(sfn): publish history events for Parallel branches and Map iterations (#3167)
* feat(sfn): publish Parallel branch and Map iteration history events

The states inside a Parallel branch or an inline Map iteration now publish
their events into the execution history.

The cause of a failure the interpreter raises now carries the AWS prefix
"An error occurred while executing the state '<name>' (entered at the event
id #<n>). ". It is written once, at the innermost state.

Every shape was verified against real Step Functions in us-east-1.

* feat(sfn): record EvaluationFailed for JSONata failures

A JSONata expression that fails now leaves the EvaluationFailed event AWS
records, with error, the attributed cause, location and state. The location
names the field the way the cause does. The event is recorded once per
attempt when the state retries, and before the Failed event and the Catch.
A Catch clause whose own expression fails records it from where the state
stood before its first Failed event, then fails the state again.

Verified against real Step Functions in us-east-1

* fix(sfn): record every Distributed Map run so DescribeMapRun resolves its ARN

* fix(sfn): stop counting history events once the execution has ended
2026-09-07 23:18:05 -04:00
lex00 5eacd01636 fix(ec2): store instance metadata options and add ModifyInstanceMetadataOptions (#3215)
RunInstances stores the MetadataOptions it is given, with AWS's launch
defaults for anything left out, and DescribeInstances reads the stored
values back instead of a hardcoded block. A launch template's metadata
options seed the launch and explicit request fields override them.
ModifyInstanceMetadataOptions changes only the fields it names and
returns the instanceMetadataOptions shape. Values outside the AWS
enumerations and a hop limit outside 1 to 64 are InvalidParameterValue.

Ported from lex00/floci#116, whose SSM half is floci-io/floci#3173.
2026-09-07 21:50:06 -05:00
Franklin G. Mendoza d99675a512 feat(controlcatalog): add control lookup operations (#3130)
* feat(controlcatalog): add control lookup operations

* fix(controlcatalog): complete control lookup contracts

* test(controlcatalog): verify pagination continuation

* fix(controlcatalog): move control model to package

* fix(controlcatalog): integrate service storage lifecycle
2026-09-07 21:49:39 -05:00
Mario Toffia b88034cd1d feat(iot): rule SQL message functions, isNull, isUndefined, IN and array literals (#3036)
Add clientid(), timestamp(), accountid() and newuuid(), the isNull() and
isUndefined() functions, the IN operator against a payload array or an
array literal, and array literals such as [lat, long], each following
the tables in the AWS IoT SQL reference. Equality extends to arrays
(element by element, in order) and objects (by key, in any order).

clientid() needs the MQTT client that published, so publish and
handlePublish carry the client id: the broker passes its session's
client id and an IoT Data Publish over HTTP passes none, which the
function reports as n/a as AWS does.

principal() stays unparsed: it returns the certificate a device
authenticated with, and the broker does not verify one yet.
2026-09-07 21:49:18 -05:00
BingEdward 90fa707145 fix(sts): return ExpiredTokenException for an expired web identity token (#3210)
* fix(sts): return ExpiredTokenException for an expired web identity token

AssumeRoleWithWebIdentity mapped every WebIdentityTokenVerifier failure to
InvalidIdentityToken, so an expired but otherwise valid IRSA token got the
same wire error as a bad signature or wrong issuer. Real STS reports the
expiry case as ExpiredTokenException so callers can refresh and retry.

Fixes #3205

* test(eks): inject EksOidcService through the test constructor
2026-09-07 21:43:46 -05:00
Matheus Oliveira e31590bba5 feat(floci-core): resolve active Docker context when DOCKER_HOST is unset (#3197)
Docker context endpoint now ranks between DOCKER_HOST and the hardcoded
platform default, so Colima/OrbStack/Podman work without manual setup.

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>

* Fix #1990
2026-09-07 21:43:32 -05:00
lex00 703744c9fb feat(s3): support bucket analytics and inventory configurations (#3213)
PutBucketAnalyticsConfiguration, GetBucketAnalyticsConfiguration,
ListBucketAnalyticsConfigurations and DeleteBucketAnalyticsConfiguration,
plus the four inventory counterparts, follow the shape the metrics and
intelligent-tiering configurations already use. Each body is validated
against the published schema and re-serialized in the AWS element
order, stored on the bucket record under its id, and returned from the
single and list reads. The PUT and DELETE forms are routed ahead of the
unqualified CreateBucket and DeleteBucket so they cannot fall through.
2026-09-07 21:43:19 -05:00
Vũ Thế Huy ec2d678e6d fix(lambda): honor MaximumBatchingWindowInSeconds on SQS event source mappings (#3203)
* fix(lambda): honor MaximumBatchingWindowInSeconds on SQS event source mappings

CreateEventSourceMapping, GetEventSourceMapping and UpdateEventSourceMapping now
parse, validate (0 to 300), persist and return MaximumBatchingWindowInSeconds
instead of silently dropping it.

When the window is greater than 0 the SQS poller holds an underfilled batch open,
accumulating messages across polls, and invokes the function once the batch
reaches BatchSize or the window elapses since the first buffered message. A window
of 0 or unset keeps the previous invoke-on-first-receive behavior.

Closes #3155

* fix(lambda): cover the batching window in SQS message visibility and window-off transitions

Address review feedback on the batching-window poller:

- Visibility timeout is now fn.timeout + window + 30 instead of the max of the two,
  so a message buffered for the full window and then processed for the full
  function timeout stays invisible for the whole span. Otherwise a long invoke
  could outlive the visibility and another consumer would receive a duplicate
  with a stale receipt handle.
- When the window is changed from positive to zero (or unset) on a live mapping,
  the poller now drains and delivers any already-buffered batch on the next tick
  instead of ignoring it, so those messages are not stranded until their
  visibility expires and cannot be replayed alongside fresh copies if a positive
  window is later restored.
2026-09-07 21:43:06 -05:00
Mario Toffia 53a84c8890 feat(iot): configurable DescribeEndpoint address for published AWS IoT ports (#3202)
* feat(iot): configurable DescribeEndpoint address for published AWS IoT ports

AWS IoT's DescribeEndpoint returns a bare hostname and each client adds its
own port (8883, 443 or 8443). Floci returns host:4566 because its HTTP data
plane lives there and IoT Data clients build https://<endpoint> from it. Both
are right for their callers, and Floci inside a container cannot tell whether
the operator published the AWS ports.

floci.services.iot.endpoint-address (FLOCI_SERVICES_IOT_ENDPOINT_ADDRESS)
is returned as is for every endpoint type when set; unset or blank keeps the
host and port of the base URL. EmulatorConfig.iotEndpointAddress() resolves
it once for DescribeEndpoint and for the AWS-managed domain configurations,
which now follow a changed address instead of keeping the value they were
seeded with. The name joins the generated server certificate's SANs the way
FLOCI_HOSTNAME does, so devices verify it on 8883 and 443.

* docs(iot): DescribeEndpoint address when the AWS IoT ports are published

Describe FLOCI_SERVICES_IOT_ENDPOINT_ADDRESS on the IoT page with the
compose port layout it is meant for, note it on the TLS page next to the
other names the server certificate covers, and list the IoT Core variables
in the environment variable reference.

* fix(tls): accept only host or host:port as the IoT endpoint certificate name

A value with a query or fragment, such as host?x=1, still parsed to a host
and was added to the server certificate. The name now has to be exactly the
authority java.net.URI reads back, so anything beyond host[:port] is skipped
with the same warning as a URL or a path.

* test(iot): pin the address the concurrent seeding test asserts at the end

Every caller had already been joined, so the final describe could not race,
but setting the address explicitly before it makes that plain to read.
2026-09-07 21:42:38 -05:00
lex00 65db87d627 fix(cloudwatch): wrap TagResource and UntagResource in their declared Result element (#3211)
TagResourceOutput and UntagResourceOutput are empty structures with a
declared resultWrapper, so the Query responses must carry the
TagResourceResult and UntagResourceResult elements. The AWS Go SDK v2
unmarshaler behind the Terraform AWS provider fails on a response
without them even though the tag write succeeded.

Ported from lex00/floci#89.
2026-09-07 22:11:12 -04:00
Matheus André 991470e7c4 fix(cloudtrail): implement CreateTrail with tagging support and add integration tests (#3206)
Signed-off-by: Matheus André <matheusandr2@gmail.com>
2026-09-07 21:46:14 -04:00
Franklin G. Mendoza 84a7ce67e4 fix(autoscaling): validate monitoring booleans (#3219) 2026-09-07 20:36:48 -05:00
Priamo Germosen 9e9b0b6e91 fix(cloudfront): stop duplicating CachedMethods into AllowedMethods.Items (#3217)
DefaultCacheBehavior/CacheBehavior parsing tracked a single inAllowedMethods
flag across the whole <AllowedMethods> element, so <Method> entries nested
inside the sibling <CachedMethods> sub-object were folded into the parsed
AllowedMethods list too (and CachedMethods itself was silently dropped).
Since terraform-provider-aws's aws_cloudfront_distribution requires both
allowed_methods and cached_methods on every cache behavior, this produced a
permanent per-plan diff: AllowedMethods.Items came back duplicated
(["GET","HEAD","GET","HEAD","OPTIONS"]) and CachedMethods was missing
entirely.

Scope one of the two follow-up fidelity gaps flagged (but deliberately left
unfixed) by #3015, which fixed the TrustedSigners crash from #2767. The
other gap from that issue (ForwardedValues/MinTTL/DefaultTTL/MaxTTL dropped
on read-back for the legacy forwarded_values cache-behavior path) is a
separate, larger change, filed as #3208.
2026-09-07 20:28:44 -05:00
Matheus Oliveira 215a80208c fix(networkfirewall): model CreateFirewall* collisions and enforce UpdateToken (#3198)
Name collisions on CreateFirewall/CreateRuleGroup/CreateFirewallPolicy now
raise the modeled InvalidRequestException instead of an unmodeled
ResourceAlreadyExistsException. Every UpdateFirewall*/Associate*/
Disassociate* firewall mutation now checks a caller-supplied UpdateToken
against the firewall's current token and rejects a mismatch with
InvalidTokenException, matching botocore 2020-11-12.

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>

* Fix #2600
2026-09-07 21:06:30 -04:00
Matheus Oliveira d049875aaf fix(lambda): correct Function URL body encoding, cookies, and error status (#3196)
Base64-encode non-UTF8 request bodies instead of lossily decoding them,
map response cookies to separate Set-Cookie headers, and return 502
when the invoked function raises an unhandled error.

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>

* Fix #3153
2026-09-07 20:39:50 -04:00
BingEdward 9f442543e3 fix(cloudformation): preserve list intrinsics and conditional tags (#2986) 2026-09-07 19:23:33 -05:00
Vũ Thế Huy b9039fef1d feat(redshift-data): emulate the Amazon Redshift Data API (#3186)
* feat(redshift-data): resource resolver, connection factory, statement store, service registration

* feat(redshift-data): field mapper, column metadata, SQL parameter binding

* feat(redshift-data): execute, describe, and paged result retrieval

* feat(redshift-data): batch execution, list statements, cancel

* feat(redshift-data): schema introspection operations

* test(redshift-data): end-to-end Data API over a real cluster plus SDK compatibility test

* docs(redshift-data): document the Redshift Data API surface

* fix(redshift-data): address code review findings

- rejectMultiStatement now reuses the SQL tokenizer so a semicolon inside a
  comment, string literal, or dollar-quoted block no longer rejects a valid
  single statement
- GetStatementResultV2 gains unit coverage for the typed and CSV envelopes
- CSV output is RFC 4180 quoted (embedded comma, quote, CR, LF)
- batch rollback is asserted transactionally in the integration test
- RedshiftDataFieldMapper logs a swallowed blob-read SQLException
- RedshiftPid/RedshiftQueryId use a non-negative hash
- NextToken that decodes to a negative offset is rejected
- CancelStatement leaves a FAILED statement FAILED
- DescribeTable paginates ColumnList and emits NextToken
- DbUser is echoed on the SecretArn path
- the statement store no longer builds its sweeper executor in the test constructor

* fix(redshift-data): address PR #3186 review findings

- SQL scanner handles PostgreSQL escape strings (E'...'): a backslash-escaped
  quote no longer ends the literal and mis-detects a following :name as a bind
  marker; plain '...' literals still treat backslash as an ordinary character
- ListStatements clamps MaxResults to 1..100 so MaxResults=0 no longer emits the
  same NextToken forever
- DescribeTable matches Table / Schema exactly (=) instead of LIKE, so a name
  containing _ or % cannot merge other tables' columns into ColumnList
- register the service in the README category table
- drop a stray em dash from the neighbouring services.yaml comment

* fix(redshift-data): bind string parameters untyped so real PostgreSQL infers the column type

CI ran the integration test against a real Redshift (PostgreSQL 15) cluster and
parameterisedStatement failed: a string bound to an int column via setString
raised "operator does not exist: integer = character varying". H2 in PostgreSQL
mode coerces it, so the unit test missed it.

- RedshiftDataConnectionFactory adds stringtype=unspecified to the JDBC URL, so
  setString sends the value untyped and the server infers the target type,
  matching how AWS binds Redshift Data API parameters
- ListStatements now rejects MaxResults above 100 with ValidationException
  instead of silently clamping (PR #3186 re-review)
- RedshiftDataOperationsTest uses JBoss Logging, not java.util.logging (PR #3186 re-review)

* fix(redshift-data): back the statement store with StorageFactory

The store held a bare ConcurrentHashMap outside the configured storage and
lifecycle model. It now obtains an account-aware backend through StorageFactory
("redshift-data", statements.json), the same as Athena's query store, resolved to
the global storage mode via the catalog descriptor. Default mode stays memory, so
statements are still lost on restart as documented; the 24h TTL sweep now walks
every account partition and deletes per account since the sweep thread has no
request context. StoredStatement is annotated for reflection and field-visible
serialization so persistent modes round-trip it.

* test(redshift-data): cover StoredStatement serialization round-trip and values()

The StorageFactory-backed store serializes StoredStatement in persistent modes.
Adds a round-trip test through the exact mapper PersistentStorage builds,
covering the ArrayNode, enum, Instant, and nested sub-statement fields plus the
field-visibility annotation, and a values() test.

* fix(redshift-data): register the nested Status enum for reflection

PersistedModelReflectionTest walks every type reachable from a StorageFactory
persistence root; StoredStatement.status pointed at an unregistered enum, so
native-image deserialization of a persisted statement would fail on restart.
2026-09-07 20:18:22 -04:00
Matheus Oliveira 618f52e758 fix(sfn): fail States.Runtime on an unresolvable JSONPath in a payload template (#3199)
A ".$" Parameters/ResultSelector/ItemSelector field whose JSONPath does not
resolve against the input now fails the state with States.Runtime instead of
silently resolving to null, matching real AWS. An out-of-range array index
keeps resolving to null, the one leniency AWS actually has here.

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>

* Fix #2521
2026-09-07 20:12:03 -04:00
Danny 5fd89e27bc feat(pipes): validate ParallelizationFactor on Kinesis and DynamoDB sources (#3192)
* feat(pipes): validate ParallelizationFactor on Kinesis and DynamoDB sources

SourceParameters is stored as an opaque JsonNode, so ParallelizationFactor
already round-tripped through CreatePipe, UpdatePipe and DescribePipe with no
bounds applied at all. Apply the AWS constraints in validateSourceConfiguration,
which both the create and update paths already run:

- reject the field on a source its parameter block does not describe, for
  example KinesisStreamParameters.ParallelizationFactor on an SQS source
- require a numeric, then an integral value
- require a value in [1, 10], reported with the offending value

The tiering and message shape follow LambdaService.parseScalingConfig, which
applies the equivalent MaximumConcurrency bounds for SQS event source mappings.

The value is persisted and returned on the wire but not yet enforced: the poller
opens an iterator on a single hardcoded shard and delivers one batch at a time,
so there is no per-shard concurrency to scale. Record that on both iterator
initializers and in an enforcement-status note in the docs, matching how
ScalingConfig documents the same gap for Lambda.

* fix(pipes): reject a ParallelizationFactor wider than an int

asLong hands back the low 64 bits of a BigInteger, so a value such as
2^64 + 5 read as 5 and passed the [1, 10] bounds check: CreatePipe accepted
it over raw HTTP and persisted the original digits. Gate the bounds on
canConvertToInt and report the value with asText, so an oversized literal is
rejected and named in full. Real AWS rejects it too, the field being an int32.

Also correct the docs: ListPipes returns pipe summaries and omits
SourceParameters entirely, so only DescribePipe echoes the factor back.
2026-09-07 18:39:32 -04:00
Franklin G. Mendoza 5864b013d2 feat(detective): add organization member operations (#3190)
* feat(detective): add organization member operations

* fix(detective): align organization operations with AWS

* docs(detective): clarify member listing

* fix(detective): enforce organization administration contracts
2026-09-07 18:31:48 -04:00