Commit Graph
2118 Commits
Author SHA1 Message Date
Kenshin Okinaka b8d78c8c9f refactor(ses): split the dedicated-IP endpoints into SesDedicatedIpController (#3692)
The nine /v2/email/dedicated-ip-pools and /v2/email/dedicated-ips
endpoints and their WarmupPercentage helper move out of SesController
into SesDedicatedIpController, which injects SesDedicatedIpService only.
SesService drops its eight dedicated-IP delegations and the unused
dedicatedIpPoolExists wrapper; the delivery-options pool probe now binds
the domain service directly, and the ARN tag dispatch stays. The
account-level auto-warmup setting remains under /account. The new class
is registered on the SES descriptor. No wire behavior changes.
2026-09-15 20:44:18 -04:00
TATSUNO “Taz” Yasuhiro 487cacb3bc fix(dynamodb): cancel TransactWriteItems on a key that does not match the schema (#3674)
* fix(dynamodb): cancel TransactWriteItems on a key that does not match the schema

AWS checks every member's key against the table schema before it looks for
duplicate items or evaluates a condition. A wrong type, a non-scalar value or a
missing key attribute cancels the transaction. The first such member gets a
ValidationError reason and every other member gets None. An empty key value
still fails the whole request. Floci returned a top-level ValidationException.

An Update that sets an index key to the wrong type now cancels as well, in both
TransactWriteItems and ExecuteTransaction.

Checked against DynamoDB in eu-west-2.

* fix(dynamodb): look up an active table in the transaction key check

The key check read the table through describeTable. That call counts every
item in the table on each member, and it accepts a table that is still
CREATING. DynamoDB answers ResourceNotFoundException "Requested resource not
found" for a CREATING table even when a member key is wrong. Use the same
active table lookup as the other transaction steps.

Checked against DynamoDB in eu-west-2.
2026-09-15 20:10:58 -04:00
Niels Kootstra 03d33350a7 fix(cloudformation): claim change set atomically before execution (#3564)
* fix(cloudformation): claim change set atomically before execution

ExecuteChangeSet checked that a change set was AVAILABLE and executed
it as two separate steps, with no lock held in between. Two concurrent
ExecuteChangeSet requests for the same change set could both pass the
AVAILABLE check before either flipped the status, so both would submit
the template for provisioning and create every resource in the stack
twice. The internal 4-arg executeChangeSet that CreateStack/UpdateStack
call directly had the same race against an external ExecuteChangeSet
call for the same change set, for example "initial-create" right after
CreateStack creates it.

Unify both entry points behind one atomic claim, claimAndSubmitExecution,
using the same ConcurrentHashMap#compute() idiom createChangeSet already
uses for its own check-then-insert race. The request path requires
ExecutionStatus AVAILABLE, matching AWS; the internal path only refuses
a change set whose execution has already started or finished, so a
failed SAM transform can still reach CREATE_FAILED. Inside the same
claim, every other change set on the stack is deleted, matching AWS's
documented ExecuteChangeSet behavior that executing a change set
deletes every other change set on that stack. After the background
execution finishes, the claimed change set's ExecutionStatus is set to
a terminal EXECUTE_COMPLETE or EXECUTE_FAILED so DescribeChangeSet
stops reporting EXECUTE_IN_PROGRESS forever. The rejection message now
reports the execution status that actually caused the rejection
instead of the change set's unrelated Status field.

* fix(cloudformation): mark pending change sets obsolete on direct stack updates
2026-09-15 17:35:53 -05:00
Chris Jovanovski 700d403fe9 fix(cloudformation): propagate nested stack failures to parent (#3609)
executeNestedStack detected a failed child only by checking for the
literal statuses CREATE_FAILED/UPDATE_FAILED. rollbackFailedExecution
always overwrites those into a ROLLBACK_* status before returning, so
the check could never match on a create: a nested stack whose own
resource loop failed and rolled back was reported to the parent as
CREATE_COMPLETE regardless, with its Outputs never computed. Every
later Fn::GetAtt on that child's Outputs then fell back to a garbage
literal string, and the parent kept going instead of rolling back.

Replace the failure-string check with a closed allow-list of the
terminal statuses under which executeTemplate actually finished and
computed Outputs. An allow-list rather than a deny-list deliberately:
an unrecognized future status now defaults to failure instead of
silently defaulting to success.
2026-09-15 17:34:54 -05:00
Chris Jovanovski e5bee4ac22 fix(cloudformation): resolve dynamic references after Fn::Join (#3610) 2026-09-15 17:33:48 -05:00
Ovidiu (Ovi) 1319ed19bc feat(sfn): honour ToleratedFailureCount and ToleratedFailurePercentage (#3605)
* feat(sfn): apply ItemBatcher to distributed Map children

ItemBatcher was parsed and then ignored: every child execution received one
item regardless of MaxItemsPerBatch, so a state machine that batches ran with a
different payload shape locally than on AWS, silently.

Items are now grouped into batches and each child execution receives
{"BatchInput": ..., "Items": [...]}. A batch closes on MaxItemsPerBatch or
MaxInputBytesPerBatch, in their literal, Path and JSONata expression forms, and
with neither set every item lands in one batch. ItemSelector still runs per item
before grouping, so the transform sees $$.Map.Item as it did before.

MaxConcurrency now bounds concurrent batches, and DescribeMapRun separates the
two counters it used to share: itemCounts counts items, executionCounts counts
child executions.

* fix(sfn): cap a batch at the 256 KiB child-input ceiling

MaxInputBytesPerBatch being optional let MaxItemsPerBatch alone build a child
input larger than Step Functions would ever start, and the byte count measured
the items alone, so a declared cap could still be exceeded by the envelope,
BatchInput and separators.

Batching now measures the serialized child payload and closes a batch at the
declared limit or at 256 KiB, whichever is smaller.

* fix(sfn): fail an item too large to start a child execution

An item whose serialized batch input already exceeded 256 KiB was added anyway,
because the split branch is skipped while the batch is empty, producing a child
input AWS would refuse to start.

Such an item now fails the state with States.DataLimitExceeded, naming its size
and pointing at ItemSelector as the way to reduce it.

* feat(sfn): honour ToleratedFailureCount and ToleratedFailurePercentage

Both fields were accepted and ignored: any failed item failed the Map run, and
DescribeMapRun reported a hardcoded zero for each, so a state machine that
relies on a failure budget behaved differently here than on AWS.

A declared tolerance now absorbs failed items while the run stays within it. An
absorbed failure contributes no result, so the Map output and any ResultWriter
export cover the successful children only. Exceeding the budget fails the state
with States.ExceedToleratedFailureThreshold. Both fields accept their literal,
Path and JSONata expression forms, the percentage is taken over the item count,
and declaring both applies the stricter of the two.

DescribeMapRun now reports the declared values. A Map that declares neither is
unchanged: the first failed item still fails the state with its own error.

* fix(sfn): export tolerated failures to FAILED_0.json

Filtering the ResultWriter input down to the successful children dropped every
absorbed failure from the export, which is exactly what the tolerance is meant
to keep observable.

Failed children now keep their input, timings and error, and are written to
FAILED_0.json with Status FAILED and the child's Error and Cause, listed under
ResultFiles.FAILED in the manifest.

* refactor(sfn): resolve every integer Map field through one helper

MaxConcurrency and the ItemBatcher limits read the same three forms, literal,
Path and JSONata expression, through two near-identical methods. The batcher one
already parameterized the field name, so the pair collapses into a single
resolver with a minimum: 0 for MaxConcurrency, where it means the service
ceiling, and 1 for a batch limit, where it is meaningless.

The shared resolver also clamps an oversized value to Integer.MAX_VALUE, which
only the MaxConcurrency copy did before.
2026-09-15 16:44:41 -04:00
Allen Sanborn 97cbce205b feat(config): add aggregation authorization CRUD (#3627)
* feat(config): add aggregation authorization CRUD

PutAggregationAuthorization, DescribeAggregationAuthorizations and
DeleteAggregationAuthorization were unrouted, so the JSON handler answered
InvalidAction and aws_config_aggregate_authorization could not be created.

Authorizations are keyed by (AuthorizedAccountId, AuthorizedAwsRegion) within
the request region, persisted through StorageFactory like the other durable
Config resources. Put is an upsert that preserves the ARN and creation time of
an existing authorization, and accepts Tags, which land in the same tag store
that ListTagsForResource reads. Delete of an absent authorization succeeds: the
Config model declares no not-found error for that operation.

* fix(config): remove aggregation-authorization tags on every delete attempt

Tag cleanup ran only when the delete found an entry to remove. A delete that
removed the authorization but did not reach the tags left them behind, and the
retry that should have cleaned them up skipped the cleanup because the entry
was already gone. Put reuses a deterministic ARN, so those tags reappeared on
the next authorization for the same account and region.

The ARN is now derived from the key instead of read off the removed entry, and
its tags are dropped on every attempt. The authorization map is still persisted
only when an entry was actually removed.

* fix(config): apply PutAggregationAuthorization tags at creation only

PutAggregationAuthorization is idempotent, and AWS applies request tags at
creation only: a later Put that finds the authorization already there ignores
its Tags and leaves the existing ones alone. Tagging the existing ARN on every
Put let a local test retag by re-putting, which production would silently
refuse.

Return the existing authorization untouched and tag only the one just created.
Tags still change through TagResource/UntagResource, which is the only way AWS
offers.

* fix(config): make aggregation authorization put/delete atomic

putAggregationAuthorization did a get-then-put on the region map with nothing
holding the two together, and deleteAggregationAuthorization removed-then-
persisted the same way. Two concurrent Puts for one (AuthorizedAccountId,
AuthorizedAwsRegion) could both find nothing and both create: the second
overwrote the first's CreationTime and re-applied creation tags over a set
TagResource may already have changed, so the documented idempotency held only
probabilistically.

Both now take the same per-key lock putConfigRule/deleteConfigRule already use
for rules. The lock keys are namespaced apart from the rule keys in the shared
map rather than relying on rule names never containing '|'.

The regression runs many short rounds rather than one wide one, because the
unlocked window is a few instructions: repeated fresh starts land the race,
more threads on one start do not. It asserts reference identity, which is what
distinguishes the two cases -- the store is keyed on the pair so its size is 1
either way, the ARN is derived from the key so it is equal either way, and
CreationTime is epoch seconds so a racing pair created inside one second is
indistinguishable by timestamp. Verified to fail with the lock removed
(17 mismatches) and pass with it, five runs.
2026-09-15 14:48:11 -04:00
lex00 026abe4878 fix(elbv2): round-trip the authenticate-oidc and authenticate-cognito configs (#3664)
* fix(elbv2): round-trip the authenticate-oidc and authenticate-cognito configs

Action carried no fields for either authentication action, so CreateListener,
CreateRule, ModifyListener and ModifyRule accepted an AuthenticateOidcConfig
or an AuthenticateCognitoConfig and kept only Type and Order. DescribeListeners
and DescribeRules then echoed an action with no Issuer, no UserPoolArn and no
other sub-field, and a client that read its own configuration back saw the
listener as changed on every read.

Both configs are now parsed on all four write operations, stored on the action
and written into the Describe response. SessionCookieName, Scope and
SessionTimeout take the defaults their shapes document, since AWS reports the
resolved value rather than the caller's gap, and the members each shape marks
required are rejected with ValidationError when absent.

ClientSecret is stored but never reported. Real AWS omits it from every
Describe call, which is why Terraform's provider carries it forward from local
state instead of reading it back.

* fix(elbv2): require the OIDC client secret on create and keep it on modify

Review feedback on #3664. parseAuthenticateOidc accepted a missing ClientSecret
on every write and never read UseExistingClientSecret. AuthenticateOidcActionConfig
requires the secret when creating and lets a modify omit it only when
UseExistingClientSecret is true, so a create without one was accepted where AWS
refuses it.

The sharper half is the modify path pgermosen described. Both modify operations
replace the action list wholesale through this same parser, so the documented way
to keep a secret, sending UseExistingClientSecret with no ClientSecret, blanked
the secret instead of preserving it.

parseActions now knows create from modify. A create without the secret is
rejected. A modify may drop it only by asking for the stored one, and
applyExistingClientSecrets puts that secret back before the action list replaces
the old one. A modify that drops the secret without the flag is rejected.

Three tests cover create-without-secret rejection, the modify that preserves and
can then preserve again, and the modify that drops it with no flag. Also imports
RequestSpecification rather than spelling it inline, per the review nit.
2026-09-15 14:46:01 -04:00
lex00 7da4ee0b6b fix(ecs): report serviceConnectConfiguration on the service's deployment (#3662)
* fix(ecs): report serviceConnectConfiguration on the service's deployment

CreateService and UpdateService accepted a serviceConnectConfiguration and
dropped it. DescribeServices then reported nothing, so a client that sets one
saw it missing on every read.

AWS's Service shape declares no serviceConnectConfiguration member. The field
lives on Deployment, which is where a generated client reads it and where
Terraform's aws_ecs_service reads it. Storing it on the service and reporting
it on each deployments[] entry matches the model, and a client that reads it
back no longer sees a pending change on every plan.

The widest createService and updateService overloads take the configuration;
the previous signatures delegate to them, so existing callers are unchanged.

* fix(ecs): roll the deployment when serviceConnectConfiguration changes

Review feedback on #3662. UpdateServiceRequest.serviceConnectConfiguration is
documented as "This parameter triggers a new service deployment", and the
rollover below only fired on a task-definition change or forceNewDeployment. A
Service-Connect-only change therefore reported the new configuration under the
old deployment id and skipped SERVICE_DEPLOYMENT_STARTED.

updateService now treats a changed configuration as deployment-triggering state,
alongside the two conditions already there. An omitted parameter stays a no-op,
and resending an identical configuration is not a change.

Three tests cover it. A changed configuration rolls the deployment id, an
identical one does not, and an update that omits the parameter does not. None of
the original four asserted on deploymentId, which is why they passed.
2026-09-15 14:43:12 -04:00
Alexy GrabovandAlexy Grabov 7813d14ee4 feat(network): add opt-in security group enforcement (#3681)
* feat(network): add opt-in security group enforcement

* fix(ec2): make security group tests order independent

* fix(network): emit valid ICMP nft rules and restart protected instances

Three review findings on the opt-in security-group enforcement foundation:

- SecurityGroupNftCompiler built "icmp type 8 code 0 accept" for an AWS
  ICMP rule carrying both FromPort (type) and ToPort (code). nftables
  header fields are separate expressions, so nft rejected the whole
  compiled policy and the manager then quarantined every endpoint. Each
  field now repeats the protocol keyword, and a protocol rule with no
  type or code becomes "meta l4proto icmp accept", which was equally
  invalid as a bare "icmp accept".
- StartInstances followed the legacy restart path for a protected
  workload and waited for a Docker bridge IP on a container that shares
  the helper's network namespace and so has no attachment of its own.
  The helper survives the workload's stop, so start now reuses its
  transport address exactly as launch does, and skips the reachable
  private address rewrite the same way.
- Replaced the newly introduced var declarations with explicit types and
  imported the inline java.util/model FQCNs, per AGENTS.md.

* fix(network): scope the firewall helper to CAP_NET_ADMIN

The helper only has to program nftables inside the namespace Docker already
gave it, so full --privileged granted far more than the feature needs.
ContainerLifecycleManager now adds CAP_NET_ADMIN for the container carrying
the floci.security-group-helper label, mirroring the capability drop already
applied to protected workloads at the same choke point, and the helper spec
no longer asks for privileged mode.

Also replaces the inline java.util FQCNs the previous commit missed in
Ec2Service with imports, per AGENTS.md.

---------

Co-authored-by: Alexy Grabov <Alexy.Grabov@cyberark.com>
2026-09-15 14:30:49 -04:00
lex00 a180c140a7 fix(cloudwatch): return DatapointsToAlarm from the JSON DescribeAlarms response (#3660)
* fix(cloudwatch): return DatapointsToAlarm from the JSON DescribeAlarms response

The Query/XML handler has always written DatapointsToAlarm, TreatMissingData
and Unit into its alarm element. The JSON/CBOR builder in
CloudWatchMetricsJsonHandler.handleDescribeAlarms never emitted any of the
three, so a client speaking smithy-rpc-v2-cbor or application/x-amz-json-1.0
to CloudWatch saw them missing from every DescribeAlarms response. Recent
botocore and AWS CLI versions default to CBOR for this service, so that is the
common path.

PutMetricAlarm already parsed and stored all three on both protocols, so only
the response builder needed the fields.

* fix(cloudwatch): report DatapointsToAlarm only when the caller set one

Review feedback on #3660. Emitting the field unconditionally broke Terraform
idempotency, and native arm64 / compat-terraform caught it. PutMetricAlarm
defaulted DatapointsToAlarm to EvaluationPeriods at storage time for the
evaluator's M-out-of-N maths, and the primitive int on MetricAlarm left nothing
to distinguish a caller's value from that default. Every alarm then reported a
number nobody asked for, and compat-terraform's alarm, which sets no
datapoints_to_alarm, drifted on every re-plan.

MetricAlarm now holds a nullable Integer carrying only what the caller sent.
AlarmEvaluator supplies EvaluationPeriods for the maths instead, so evaluation
is unchanged. Both response builders emit the member only when it is set, which
closes the same latent gap on the Query path.

CloudWatchCfnProvisioner also minted a value from EvaluationPeriods, so a
template that names no M now leaves the alarm without one. Its two tests move
with it, and a third covers a template that does name one.
2026-09-15 14:28:21 -04:00
XuJianandxujiantop-crypto 374b80eb65 fix(codepipeline): handle legacy pipelines without versions (#3677)
Co-authored-by: xujiantop-crypto <265865031+xujiantop-crypto@users.noreply.github.com>
2026-09-15 13:53:31 -04:00
XuJianandxujiantop-crypto 0962adaf23 fix(s3): allow presigned CORS preflight (#3675)
Co-authored-by: xujiantop-crypto <265865031+xujiantop-crypto@users.noreply.github.com>
2026-09-15 13:51:44 -04:00
Matheus Oliveira 2f2a9bed0d docs(core): list the current callers in the ContainerReachableEndpoint Javadoc (#3682)
The class is shared by LaunchedContainerAwsEnv, EC2 and CloudFormation, not
only Lambda. Follow-up to the #3579 review.

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-09-15 13:45:46 -04:00
Ovidiu (Ovi) d3bfe2609c feat(redshift): implement zero-ETL integrations (#3559)
* feat(redshift): implement zero-ETL integrations

DescribeIntegrations had no implementation, so an application that
discovers its zero-ETL integration at runtime could not run against the
emulator.

Implementing that action alone would have been worse than leaving it out.
A caller matches its integration by SourceArn and treats "no match" as a
hard error, so an action that always answered with an empty list would turn
a clean "unsupported" into a confusing "no integration whose source is the
X table". CreateIntegration and DeleteIntegration come with it, so an
integration can exist and the empty list means what it says.

Shape captured from a live integration in us-west-2:

  - Status is lower case ("active"), not ACTIVE
  - Errors is present but empty on a healthy integration
  - the record carries IntegrationArn, IntegrationName, SourceArn,
    TargetArn, Status, CreateTime, KMSKeyId, Tags and
    AdditionalEncryptionContext
  - describing with an unknown IntegrationArn is IntegrationNotFoundFault,
    "The requested integration doesn't exist."
  - an account with no integrations answers with an empty list, not an
    error
  - no Marker element is emitted when there is no further page, which is
    what stops a caller's pagination loop

This is metadata only: nothing replicates from the source, and the
integration settles as active immediately rather than passing through
creating, because there is no work for it to do.

* fix(redshift): correct the integration Query contract

Three gaps against the modelled Query API, each confirmed in the bundled
botocore service model rather than taken on trust.

Tags arrive under TagList, not Tags. The shape is a list whose member
carries locationName Tag, so a real client sends TagList.Tag.N.Key and
.Value. Reading Tags.Tag.N meant every tag an SDK sent was silently
dropped, which a hand written form-encoded test did not catch because it
used the wrong name too.

DescribeIntegrations is paginated and filterable. MaxRecords, Marker and
Filters.DescribeIntegrationsFilter.N were all ignored, so the operation
only worked while every record fitted in one response and a caller using
filters got unrelated integrations back. MaxRecords honours the documented
20 to 100 range, the marker is the last ARN already returned rather than an
offset, and no Marker is emitted on the terminal page. The four modelled
filter names are implemented: integration-arn, source-arn, source-types and
status. An unrecognised name is rejected rather than ignored.

CreateIntegration advertises Description and AdditionalEncryptionContext.
Both are now parsed, stored and rendered, with the documented rule that the
encryption context is only valid alongside a KMSKeyId, and Description
capped at the modelled 1000 characters.

* test(redshift): cross a real page boundary in the marker regression

The previous test created three integrations and asked for twenty, so it
only proved the terminal case: no Marker when everything fits. It never
forced a second page, never asserted a non-terminal page carries a Marker,
and never sent one back.

It now creates twenty-one records against the smallest legal page size and
walks every page, asserting that a full page carries exactly MaxRecords
records and a Marker, that no record appears on two pages, that the final
page omits the Marker, and that the traversal returns the same set as a
single large page. Other tests in this class share the store, so the
assertions are about the traversal rather than absolute counts.

* feat(redshift): validate IntegrationName against the modelled pattern

CreateIntegration only checked IntegrationName for non-blank, so a name
real AWS refuses was accepted: the member is modelled min 1, max 63,
pattern ^[a-zA-Z][a-zA-Z0-9]*(-[a-zA-Z0-9]+)*$. A leading digit or
hyphen, an underscore, a doubled hyphen and a trailing hyphen all got
through, as did a name over 63 characters.

Validate both constraints in createIntegration, alongside the existing
Description length and encryption-context rules.

Three regressions cover the rejected shapes, the over-length case and
acceptance at the 63 character boundary.
2026-09-15 13:36:10 -04:00
Simone Primarosa 3c23784ca7 feat(s3): evaluate bucket policies for authenticated callers (#3632) 2026-09-15 13:09:26 -04:00
Vũ Thế Huy 631d98be64 refactor(redshift): deduplicate RedshiftContainerManager startup and adoption sequence (#3679)
* refactor(redshift): deduplicate RedshiftContainerManager startup and adoption sequence

Extract the shared post-acquisition initialization and registration sequence into a private helper method used by both start() and adoptOrStart().

Add unit test coverage verifying log streamer attachment and failure tolerance across both container startup paths.

Closes #3653

* test(redshift): use static Mockito answer import
2026-09-15 13:05:54 -04:00
Niels Kootstra 144b90e6fa fix(apigateway,appsync): sandbox VTL rendering with SecureUberspector and execution limits (#3542)
* fix(apigateway,appsync): sandbox VTL rendering with SecureUberspector and execution limits

VtlTemplateEngine and AppSyncVtlEngine rendered templates with Velocity's
default UberspectImpl introspector, which allows arbitrary reflection
through any context object (e.g. $util.getClass().forName('java.lang.Runtime')),
and had no cap on #foreach iterations, output size, or execution time,
making them vulnerable to both sandbox escapes and denial of service via
runaway loops or #set string doubling.

Add a shared VtlSandbox helper that both engines call to switch to
SecureUberspector and restrict introspection on java.lang.Class,
ClassLoader, Runtime, ProcessBuilder, System, Thread, java.io.File and
related reflection/scripting/process packages, plus three independent
limit layers: a native #foreach loop cap that truncates the loop without
failing the template, a cooperative execution deadline checked from a new
SandboxedForeach directive before each loop iteration, and a BoundedWriter
output-size cap. The latter two throw the new VtlLimitExceededException,
an unchecked RuntimeException that flows through each engine's existing
error handling exactly like any other Velocity evaluation failure, with
no new error shape. Limits are configurable via EmulatorConfig
(vtlMaxLoops, vtlMaxOutputChars, vtlTimeoutMillis; application.yml keys
vtl-max-loops, vtl-max-output-chars, vtl-timeout-millis), mirroring the
project's existing per-service numeric-tunable config pattern, and
documented in api-gateway.md and appsync.md.

The classpath-shadowed velocity.properties resource is kept for any
embedding that resolves it normally, but is not the actual enforcement
point: under this project's test/runtime classloader, Velocity's own
getResourceAsStream lookup for that exact resource path can resolve to
the copy bundled inside the velocity-engine-core jar instead of this
project's shadowed copy, silently leaving the insecure UberspectImpl
active even with a correct properties file on disk. VtlSandbox configures
SecureUberspector and swaps in SandboxedForeach directly via the
VelocityEngine Java API instead, which is unaffected by that ambiguity.

* docs(apigateway): correct foreach registration documentation
2026-09-15 13:03:51 -04:00
Vũ Thế Huy c63c834c0e fix(s3): support virtual-hosted routing via X-Forwarded-Host and prevent unintended bucket creation (#3621)
* fix(s3): support virtual-hosted routing via X-Forwarded-Host and prevent unintended bucket creation

- Respect X-Forwarded-Host when resolving host for reverse proxy compatibility
- Support tail-agnostic .s3.<region>.<domain> qualifier and fallback lookup against existing buckets
- Reroute misplaced single-segment object/multipart uploads or reject with InvalidBucketName/MalformedXML
- Add unit and integration tests for virtual-hosted requests forwarded through proxies

* docs(s3): translate virtual host routing comment
2026-09-15 13:01:39 -04:00
Ovidiu (Ovi) ce5c5b4cfa fix(apigateway): reject method request parameter names AWS refuses (#3549)
* fix(apigateway): reject method request parameter names AWS refuses

API Gateway restricts a method request parameter name to
^[a-zA-Z0-9:._$-]+$. floci applied no validation, so a spec that real AWS
refuses imported cleanly against the emulator and only failed on deploy,
which is the direction that costs the most to discover.

The limitation is undocumented. Measured against real AWS (us-west-2),
both entry points reject a name outside the set:

  PutMethod
    BadRequestException: Invalid mapping expression specified:
    Validation Result: warnings : [], errors : [Parameter name should
    match the following regular expression: ^[a-zA-Z0-9:._$-]+$]

  ImportRestApi
    BadRequestException: Errors found during import:	Unable to put
    method 'GET' on resource at path '/items': <the message above>

$ : . _ - are inside the set, so a JSON:API style filter[a] cannot be
imported while filter.a can, which is the workaround applications adopt.
The rule covers query string, header and path parameters alike, and
applies whether or not the parameter is required.

Validation lives in putMethod, the choke point both entry points share.
The import path rethrows it under the envelope AWS uses there, naming the
method and resource path.

Only the declared name is restricted. At runtime a request carrying
?filter[a]=1 reaches a proxy integration with the brackets intact, so
this is not a general ban on the character in a query string, and nothing
on the execute path changes.

* docs(apigateway): attach the parameter-name javadoc to the method it describes

The javadoc for validateRequestParameterNames sat above
importParameterNameFailure, which carried its own javadoc directly
beneath it. Move it down onto the method it documents.

No behavior change.
2026-09-15 12:56:40 -04:00
luiseterc 46b66ffa40 fix(ec2): honor RunInstances dry run before provisioning (#3599)
* fix(ec2): honor RunInstances dry run before provisioning

* fix(ec2): validate launch input before dry-run success

* fix(ec2): validate dry runs through the launch service
2026-09-15 12:51:51 -04:00
Kenshin Okinaka 872463f83a refactor(ses): split the contact endpoints into SesContactController (#3680)
The ten /v2/email/contact-lists endpoints and their six helpers move out
of SesController into SesContactController. Every one of them is a
single-domain call, so the new controller injects SesContactService only
and never touches the facade; SesUnsubscribeController switches to the
same service for its one call. SesService drops its twelve contact
delegations and keeps the send-path opt-out collection and the ARN tag
dispatch. The contact and dedicated-IP endpoints were interleaved in the
monolith, so the move is per method and the two contact section headers
go, leaving the dedicated-IP methods under their own headers.
SesServiceTestBuilder exposes the contact service it builds so the
list-management unit test seeds contacts through it. The new class is
registered on the SES descriptor. No wire behavior changes.
2026-09-15 11:29:44 -04:00
XuJianandxujiantop-crypto 561aa32283 fix(lambda): deliver DynamoDB stream failures to S3 (#3622)
Co-authored-by: xujiantop-crypto <265865031+xujiantop-crypto@users.noreply.github.com>
2026-09-15 10:32:43 -04:00
luiseterc 169101233c fix(ec2): return user data from DescribeInstanceAttribute (#3601)
* fix(ec2): return user data from DescribeInstanceAttribute

* fix(ec2): preserve original encoded instance user data
2026-09-15 09:46:48 -04:00
Kenshin Okinaka ff1c930519 refactor(ses): split the template endpoints into SesTemplateController (#3671)
The six /v2/email/templates endpoints move byte-for-byte out of
SesController into SesTemplateController, which calls SesTemplateService
directly and keeps only DeleteEmailTemplate on the facade for its
tenant-association guard. SesQueryHandler's template actions and the
facade's own templated send read the service the same way, and the
residual SesController resolves a stored template for SendBulkEmail
through it too, so the facade drops its five pure template delegations.
The new class is registered on the SES descriptor. No wire behavior
changes.
2026-09-15 09:03:42 -04:00
Hector Ventura de15e9666f refactor(cloudformation): move AWS::StepFunctions::StateMachine into a per-service provisioner (#3658)
Moves the last type that answered in the dispatcher's update-cleanup hooks out of
the monolith. Monolith 4,521 to 3,886 lines, legacy types 28 to 27, and no
reference to StepFunctions or StateMachine remains in the class.

The prize is the five hooks. Each one delegated to the provisioner that owns the
type and then fell through to a StepFunctions arm for the types that had none.
StepFunctions was the last of those, so all five collapse to plain delegation:
completeUpdate 60 lines to 6, rollbackUpdate 79 to 5, updateCleanupPhysicalId 28
to 8, hasReplacementUpdate 18 to 5, clearUpdate 5 to 4. A replacement's
bookkeeping, its retry budget and its rollback now live beside the code that
creates the replacement.

The provisioner wraps three collaborators rather than one. StepFunctionsService is
its own. ObjectMapper reads and writes the update snapshot. S3Service is there
because a state machine's definition may arrive as DefinitionS3Location rather
than DefinitionString, so resolving it means fetching and parsing the object;
s3Service stays in the monolith as well, since ApiGateway and Lambda also read
from S3.

Two constants are copied rather than moved: NAME_MODE_EXPLICIT and
NAME_MODE_GENERATED are also used by Lambda, and GENERATED_NAME_SUFFIX_LENGTH by
generatePhysicalName. Copying is what keeps this move behaviour-preserving.

CloudFormationYamlParser's constructor becomes public. The parser is already a
public class, but its constructor was package-private and the provisioners live
in a subpackage, so the definition-from-S3 path could not reach it.

Tests: 2,862 green across the cloudformation, provisioners and stepfunctions
packages. The rollback path is the one worth proving rather than assuming, since
a status-only assertion would not notice its loss: neutralising rollbackUpdate to
return false fails five integration tests across three classes, with the stack
reporting UPDATE_ROLLBACK_FAILED and naming InitialStateMachine.
2026-09-15 07:40:03 -05:00
Aniket Shukla 8c61a01c8d refactor(core): deduplicate KMS and XML parsing (#3670) 2026-09-15 07:46:05 -04:00
Aniket Shukla 7d58be1d4f fix(s3): return copy destination version id (#3669) 2026-09-15 07:45:44 -04:00
BingEdward e1e98fd8dc fix(rds): apply IAM auth toggles to running proxies (#3668)
Signed-off-by: 7487 <1042653432@qq.com>
2026-09-15 07:45:24 -04:00
Matheus André 2ee3aa67c0 feat(apigateway): support Gateway Responses on REST APIs (#3326) (#3585)
Add the PutGatewayResponse / GetGatewayResponse / GetGatewayResponses /
UpdateGatewayResponse / DeleteGatewayResponse family, keyed per REST API by
responseType across the 21 AWS types. Uncustomised types are reported with
defaultResponse=true, their AWS default statusCode and the default
{"message":$context.error.messageString} template; UpdateGatewayResponse
patches /statusCode, /responseParameters/<name> and
/responseTemplates/<content-type>, and DeleteGatewayResponse restores the
default.

ImportRestApi and PutRestApi read the x-amazon-apigateway-gateway-responses
extension, and AWS::ApiGateway::GatewayResponse is provisioned by a new
CloudFormation provisioner whose Ref / Fn::GetAtt Id is
<restApiId>-<responseType>.

On the execute plane every gateway-generated answer (unmatched path or
method, AWS_IAM and Lambda authorizer rejections, missing API key, request
validation, unsupported media type, integration configuration errors and
Lambda proxy failures) resolves the customisation for its type, then
DEFAULT_4XX / DEFAULT_5XX, and applies the configured statusCode, the
gatewayresponse.header.* parameters (static, method.request.*, context.*,
stageVariables.*) and the response templates, with $context.error.* exposed
to VTL. An expired SigV4 signature selects EXPIRED_TOKEN and a malformed or
mismatching one INVALID_SIGNATURE, as AWS keeps those two contracts apart.
This is what puts Access-Control-Allow-Origin on a browser-visible
401/403/400 so the frontend can read the real status instead of a CORS
failure. Without a customisation every answer is unchanged.

Closes #3326
2026-09-15 07:44:45 -04:00
Ovidiu (Ovi) 6f05442218 feat(bedrock-agentcore): implement InvokeHarness (#3557)
* feat(bedrock-agentcore): implement InvokeHarness

InvokeHarness was the last gap keeping an application's agent chat on real
AWS. #3556 added the Memory event data plane, so conversation history works
locally, but the invoke call itself had nothing to answer it.

There is no agent loop here and no model. What is emulated is the wire
contract an application integrates against: POST /harnesses/invoke returns
an application/vnd.amazon.eventstream response carrying messageStart,
contentBlockStart, one contentBlockDelta per chunk, contentBlockStop,
messageStop and metadata, in that order. The reply echoes the caller's last
user message, which makes a chat client visibly work end to end and leaves
a request that failed to parse obvious rather than hidden behind a fixed
string.

The wire bindings are the part worth knowing, and they are not what the
request model suggests. harnessArn and qualifier are query parameters,
runtimeSessionId and runtimeUserId are headers
(X-Amzn-Bedrock-AgentCore-Runtime-Session-Id / -User-Id), and only
messages, model and tools travel in the JSON body. Reading them from the
body compiles, passes a hand-written test, and then fails against the real
SDK with "harnessArn is required".

A request carrying no user message is legitimate rather than an error: a
caller whose memory already holds the current turn sends none, so that case
answers with a canned line. harnessArn is not resolved, because the
emulator models no harness resource; InvokeAgentRuntime is permissive for
the same reason.

BedrockStreamEncoder moves to core/common as AwsEventStreamWriter and
becomes public, next to the AwsEventStreamEncoder it already delegates to.
Both services now share one frame writer rather than duplicating the
header-map wrapper. bedrock-runtime keeps its behaviour and its streaming
tests are the regression guard.

Tool execution, skills and multi-turn iteration are not emulated, so no
tool-use block is produced even when a request supplies tools.

* fix(bedrock-agentcore): validate the InvokeHarness request contract

messages is a required member. Treating a missing or non-array field the
same as an empty array made an omitted required member indistinguishable
from a legitimate empty one, so the two are now separated: an empty array
still gets the canned reply, an absent member is a ValidationException.

harnessArn and runtimeSessionId were only checked for being non-blank.
Both carry modelled constraints, taken from the bundled botocore service
model rather than guessed:

  harnessArn        arn:...:bedrock-agentcore:<region>:<account>:harness/
                    <name>-<10 alphanumerics>
  runtimeSessionId  33 to 100 characters, [a-zA-Z0-9][a-zA-Z0-9-_]*

Real AgentCore enforces the ARN shape before anything else: an ARN of
harness/h-1 comes back as "Invalid harness ARN format" even when the rest
of the request is wrong too, which is why the test values in this branch
had to change.

The ARN's shape is checked but the harness is still not resolved, because
the emulator models no harness resource. A well formed ARN naming nothing
is accepted, and has a test saying so.

* fix(bedrock-agentcore): report a malformed harness ARN before a missing session id

The ARN shape was checked after both presence checks, so a request carrying a
malformed ARN and no runtimeSessionId header came back as "runtimeSessionId is
required" rather than the ARN error AWS returns. No test exercised two bad
fields at once.

The ARN is now validated whole, presence and shape together, before
runtimeSessionId is read.
2026-09-15 07:44:22 -04:00
Ovidiu (Ovi) 917e94914f feat(sfn): apply ItemBatcher to distributed Map children (#3604)
* feat(sfn): apply ItemBatcher to distributed Map children

ItemBatcher was parsed and then ignored: every child execution received one
item regardless of MaxItemsPerBatch, so a state machine that batches ran with a
different payload shape locally than on AWS, silently.

Items are now grouped into batches and each child execution receives
{"BatchInput": ..., "Items": [...]}. A batch closes on MaxItemsPerBatch or
MaxInputBytesPerBatch, in their literal, Path and JSONata expression forms, and
with neither set every item lands in one batch. ItemSelector still runs per item
before grouping, so the transform sees $$.Map.Item as it did before.

MaxConcurrency now bounds concurrent batches, and DescribeMapRun separates the
two counters it used to share: itemCounts counts items, executionCounts counts
child executions.

* fix(sfn): cap a batch at the 256 KiB child-input ceiling

MaxInputBytesPerBatch being optional let MaxItemsPerBatch alone build a child
input larger than Step Functions would ever start, and the byte count measured
the items alone, so a declared cap could still be exceeded by the envelope,
BatchInput and separators.

Batching now measures the serialized child payload and closes a batch at the
declared limit or at 256 KiB, whichever is smaller.

* fix(sfn): fail an item too large to start a child execution

An item whose serialized batch input already exceeded 256 KiB was added anyway,
because the split branch is skipped while the batch is empty, producing a child
input AWS would refuse to start.

Such an item now fails the state with States.DataLimitExceeded, naming its size
and pointing at ItemSelector as the way to reduce it.

* refactor(sfn): resolve every integer Map field through one helper

MaxConcurrency and the ItemBatcher limits read the same three forms, literal,
Path and JSONata expression, through two near-identical methods. The batcher one
already parameterized the field name, so the pair collapses into a single
resolver with a minimum: 0 for MaxConcurrency, where it means the service
ceiling, and 1 for a batch limit, where it is meaningless.

The shared resolver also clamps an oversized value to Integer.MAX_VALUE, which
only the MaxConcurrency copy did before.
2026-09-15 07:43:59 -04:00
Ovidiu (Ovi) 38d1d0a8e4 feat(glue): implement partition indexes (#3551)
* feat(glue): implement partition indexes

CreatePartitionIndex and DeletePartitionIndex were missing, and
GetPartitionIndexes was a stub that resolved the table and then always
returned an empty list. A client could create an index and read back
nothing, and Terraform's aws_glue_partition_index could not apply at all.

Behaviour captured against real Glue in us-west-2, on a table partitioned
by tenant/year/month/day:

  - an index key must name a partition column, else InvalidInputException
    "IndexKeys not a part of PartitionColumns. Verify the indexKeys : [x]"
  - keys need not be a prefix of the partition keys, and need not be in
    partition order: [year] and [month, tenant] are both accepted
  - a repeated index name gives AlreadyExistsException "... already exists
    with the same name."
  - a repeated key list under a new name is refused too: "... already
    exists with the same keys." The comparison is order sensitive, so
    [year, month] and [month, year] are distinct indexes
  - a fourth index gives ResourceNumberLimitExceededException "Partition
    index limit exceeded. Maximum: 3", and the cap is evaluated before the
    duplicate checks
  - deleting an unknown index gives EntityNotFoundException "Index with the
    given indexName : x does not exist."
  - a read resolves each key to its name and type from the table's
    partition keys, while a create carries names only

Indexes live in their own store keyed by the table key, so the existing
deleteTable cascade sweeps them and a recreated table starts clean.

One deliberate divergence: an index is stored ACTIVE immediately. Real
Glue creates asynchronously, reports CREATING while it backfills, and
refuses a concurrent create on the same table. Settling immediately keeps
tests free of polling, and a client that waits for ACTIVE (the Terraform
provider does) completes on its first read.

Verified end to end against a local floci: the SDK round-trips create,
read and delete, every error above matches the capture, and a real
aws_glue_partition_index applies and destroys cleanly.

* feat(glue): expose the partition index lifecycle

The first cut stored an index ACTIVE on create and removed it on delete,
treating the lifecycle as an internal detail. It is not: a caller reads
IndexStatus from GetPartitionIndexes and can branch on it, so collapsing
the states changed an AWS-visible contract.

Captured against real Glue in us-west-2:

  - a new index reports CREATING for roughly 12 seconds, then ACTIVE
  - a deleted index reports DELETING before it disappears
  - while either is in progress, another create on the same table gives
    ResourceNumberLimitExceededException "Index <name> is in <STATE>
    state. Only 1 index can be created or deleted simultaneously per
    table."
  - an index that is still CREATING cannot be deleted: Glue reports
    EntityNotFoundException "Index with the given indexName : <name> does
    not exist." even while a read lists it as CREATING. Measured in
    isolation, with nothing else in flight

The transitions are driven by reads rather than wall-clock time, so they
stay deterministic and tests need no sleeps: each GetPartitionIndexes
reports the current state and settles it, so the next read sees the
outcome. A client that polls converges on its second call.

FAILED is not emulated; it only arises from a backfill failure.

Verified with a real aws_glue_partition_index against a local floci:
apply polls CREATING to ACTIVE and completes, a refresh reports no drift,
and destroy passes through DELETING.

Also replaces var with explicit types and drops inline fully-qualified
names in the tests, per the AGENTS.md rule.

* docs(glue): correct two javadocs left behind by the index lifecycle

Both still said an index is stored ACTIVE immediately, which stopped being
true when createPartitionIndex started storing CREATING and letting
GetPartitionIndexes settle it.

* fix(glue): serialize partition index writes against their own reads

createPartitionIndex reads the stored indexes, checks the cap and the duplicate
rules, then writes, with nothing holding that together. Two concurrent creates
on a table at two indexes both saw room under the cap of three and both wrote,
leaving four. Nothing repairs that afterwards.

create, delete and the settling loop in getPartitionIndexes now carry the same
synchronized treatment updateTable already uses for its own check-then-write.
2026-09-15 07:43:35 -04:00
TATSUNO “Taz” Yasuhiro 43a0d737e9 perf(iam): cache parsed policy and lowercase patterns once (#3635)
* perf(iam): cache parsed policy documents in IamPolicyEvaluator

Every evaluate call parsed each policy document with Jackson again. A caller
with a large managed policy such as ReadOnlyAccess (94 KB) paid that parse
on every request under IAM enforcement.

The evaluator now keeps the parsed statements per document text in a
ConcurrentHashMap. Parsing is a pure function of the text, so entries never
go stale. The map is bounded at 2048 entries and cleared when the bound is
reached, which only matters for many distinct session policies. A document
that fails to parse is cached as failed, so the warning is logged once
instead of on every request.

AWS managed policy catalog has 1566 documents. All 1566 parsed take about
9.5 MB of heap, and AWS caps a customer managed policy at 6144 characters
and a session policy at 2048, so 2048 entries stay within tens of MBs in
the worst case.

* perf(iam): store policy patterns lowercased in the parsed statement cache

Action and Resource matching is case-insensitive. globMatches lowercased
both the pattern and the request value on every comparison, which for a
policy like ReadOnlyAccess meant about 5800 new strings per request.

The patterns are now lowercased once when the document is parsed and
cached, and the request action and resource are lowercased once per
evaluation. The public globMatches helper used by the trust policy and S3
public access evaluators is unchanged.

* fix(iam): compare resource ARNs case-sensitively

AWS documents the Action element as case-insensitive, but the Resource
element is not: the IAM user name in a Resource ARN is case sensitive, and
so are S3 object keys. The evaluator lowercased both sides of every
Resource and NotResource comparison, so a grant on user/Bob also matched
user/bob and a grant on bucket/Private/* also matched bucket/private/*.

Resource and NotResource patterns are now kept as written in the parsed
statement cache and the request resource is compared as is. Action and
NotAction patterns stay lowercased once at parse time.
2026-09-15 07:42:56 -04:00
Priamo Germosen ca18ad22f0 refactor(bcmdataexports,cur): extract shared S3 destination validation (#3666)
BcmDataExportsService and CurService each carried identical
requireValidBucketName and requireSafeKeySegment helpers used to validate
an export configuration's S3 destination. Move them into a new
core.common.S3DestinationValidation utility and have both services
delegate to it instead of maintaining two independent copies.

Fixes #3651
2026-09-15 07:35:31 -04:00
Priamo Germosen c7b4a393d9 fix(rds): support IPV6 and DUAL network types on RDS Proxy (#3639)
CreateDBProxy/AWS::RDS::DBProxy rejected EndpointNetworkType/TargetConnectionNetworkType
outright for anything other than IPV4 ("Floci currently exposes IPv4 proxy networking only").
Both fields are now accepted and stored on the DbProxy record:

- EndpointNetworkType: IPV4, IPV6, or DUAL
- TargetConnectionNetworkType: IPV4 or IPV6 (no DUAL, matching AWS's own constraint)

They round-trip through DescribeDBProxies and CloudFormation the same way the proxy's other
control-plane settings (pool sizing, TLS, idle timeout) already did.

AWS's RDS Proxy network prerequisites require both the VPC and every selected subnet to carry
an associated IPv6 CIDR block for IPV6/DUAL. floci already modeled VPC-level IPv6 CIDR
associations; subnet-level association is now modeled too (Subnet.ipv6CidrBlockAssociationSet,
CreateSubnet's Ipv6CidrBlock parameter, and the DescribeSubnets/CreateSubnet response), and
createDbProxy validates both the VPC and every VpcSubnetIds entry before accepting a non-IPV4
network type, rejecting with InvalidParameterValue otherwise. Genuinely invalid enum values are
still rejected at both the RDS Query API and CloudFormation provisioner layers.

The CloudFormation update path now also refuses a changed EndpointNetworkType or
TargetConnectionNetworkType the same way it already refused a changed DBProxyName, EngineFamily,
or VpcSubnetIds: both are createOnlyProperties in the AWS::RDS::DBProxy registry schema, and
ModifyDBProxy has no such parameters, so silently accepting a changed value on UpdateStack would
report UPDATE_COMPLETE while the proxy's actual network type stayed put.

Added a Terraform compatibility scenario (rds-proxy-network-type-tf) with a genuinely
dual-stack VPC and subnets, plus negative cases for an IPv4-only VPC and for a dual-stack VPC
whose subnets lack an IPv6 CIDR block.
2026-09-15 07:35:11 -04:00
Priamo Germosen 315dfe69f0 fix(rds): support tagging DB snapshots (#3649)
TagResource/UntagResource/ListTagsForResource rejected a snapshot ARN
outright ("not yet implemented by Floci"), and CreateDBSnapshot
silently dropped its Tags parameter even though DbSnapshot already had
a tags field. Both are now wired up: CreateDBSnapshot stores Tags, the
generic tag-resource dispatch resolves a "snapshot" ARN type against
the snapshot store, and DescribeDBSnapshots echoes DBSnapshotArn and
TagList like the other tagged resource types already do.

Snapshots are now region-scoped the same way DB instances and clusters
already are: CreateDBSnapshot/DescribeDBSnapshots/DescribeDBSnapshot-
Attributes/ModifyDBSnapshotAttribute/RestoreDBInstanceFromDBSnapshot
all thread the request's signed region through to snapshot storage and
lookup (via the same dbResourceKey/hasRdsResourceIdentity scoping the
instance/cluster stores use), so DBSnapshotArn reflects the request's
actual region and a snapshot created in one region is not visible to
Describe/Tag calls signed for another.

Verifying this live against a real floci instance via Terraform
surfaced two more gaps blocking any use of aws_db_snapshot at all,
regardless of tagging: DescribeDBSnapshotAttributes (called on every
read of the resource) and ModifyDBSnapshotAttribute were both
completely unimplemented. Added minimal support for both (the
"restore" attribute, i.e. cross-account copy/restore authorization,
modeled as plain in-memory state, no real cross-account sharing).

DeleteDBSnapshot is also unimplemented and was not added here — a
snapshot can be created and tagged but not destroyed via Terraform.
Noted in docs/services/rds.md as a follow-up, along with the other
resource types the original gap report mentioned (Aurora cluster
snapshots, reserved instances) that aren't modeled in Floci at all, so
tagging doesn't apply to them either.

Added a Terraform compatibility scenario (aws_db_snapshot with tags,
verifying create, tag read-back, a clean second plan, and an in-place
tag update) and ran it against a live floci instance before
committing, including a re-run after the region-scoping fix.
2026-09-15 07:34:42 -04:00
Priamo Germosen 9356c95edc refactor(apigateway,appsync): extract shared SigV4 header-auth verification (#3657)
ExecuteApiSigV4Authorizer (API Gateway execute-api IAM auth) and
IamAuthValidator (AppSync GraphQL IAM auth) each carried an identical
CredentialScope record and identical signing-key/HMAC/hash/log-sanitizing
helpers. Move CredentialScope into core.common.auth and widen
SigV4RequestValidator (introduced in #3581) with the crypto and
normalizeHeaderValue helpers both verifiers already relied on, so both
delegate to one shared copy instead of two independently-maintained ones.

Fixes #3650
2026-09-15 00:09:30 -04:00
Priamo Germosen de27308bd9 refactor(rds,docdb,neptune): extract shared DescribeGlobalClusters into RdsFamilyQuerySupport (#3648)
DocDbQueryHandler, NeptuneQueryHandler, and RdsQueryHandler each carried their own
byte-for-byte identical handleDescribeGlobalClusters: global clusters aren't modeled by
any of the three, so all three validate MaxRecords/GlobalClusterIdentifier/Marker the
same way and always answer with an empty GlobalClusters list, since DocumentDB and
Neptune both accept the RDS-family wire protocol and claim compatibility for this
operation.

Extracted into a new RdsFamilyQuerySupport under core.common (a static utility, not a
CDI-injected sibling handler like RdsQueryHandler's existing DocDbQueryHandler/
NeptuneQueryHandler dependencies: those exist for real cross-service data composition,
this operation has no state to share, just identical logic). Each handler's own
handleDescribeGlobalClusters is now a one-line delegation, keeping its own LOG so log
lines still attribute to the right service.

Scope note: CPD also flagged the two other pairwise overlaps this issue names (33-line
DocDb/RDS, 26-line Neptune/RDS), but those turned out to be the same
handleDescribeGlobalClusters match window overlapping into neighboring methods, not a
separate duplicate; this extraction covers them too. A much larger set of CPD matches
between DocDbQueryHandler and NeptuneQueryHandler (cluster/instance CRUD, tag parsing,
XML builders, effectively most of both handlers) is a separate, pre-existing
architectural duplication between those two services well beyond what this issue asks
for, and is not touched here.

No behavior change. Full docdb, neptune, and rds test suites pass unchanged (one
NeptuneOpenCypherIntegrationTest Bolt-protocol timeout is a pre-existing environmental
flake, confirmed by reproducing it identically against unmodified main).
2026-09-14 22:09:36 -05:00
Hector Ventura 04a6ad6cbb refactor(cloudformation): move AWS::CloudFront::Distribution into CloudFrontCfnProvisioner (#3587)
Moves the last CloudFront type out of the monolith switch and into the provisioner that
already owns the four configuration types a distribution references by id. Monolith 4,702
to 4,521 lines, legacy types 29 to 28. No new class: the type joins an existing
provisioner that already injects CloudFrontService and is already wired into
CfnProvisionerFixture.

Nine private helpers move with it, every one exclusive to the distribution: cfnOrigins,
cfnDefaultCacheBehavior, cfnCacheBehaviors, cfnCustomErrorResponses, putIfPresent,
cfnStringList, cfnText, cfnTextOrDefault and cfnBool. cfnText shows 21 references in the
monolith and looks shared until each is resolved to its enclosing method: they are all
CloudFront. All nine are carried over byte for byte.

The provision method itself changes in exactly two places. It takes a ProvisionContext
rather than a bare engine, and it decides create versus update from ctx.isUpdate() and
ctx.priorPhysicalId() rather than reading the physical id off the resource, which is what
AGENTS.md asks for because provision assigns the new id as it runs. The two are the same
value on the same call: the engine sets resource.setPhysicalId(existingPhysicalId) and
passes that same variable into the context.

Delete keeps the monolith's behaviour. removeDistribution is the stack-level delete, with
no disable or If-Match guard, and it tolerates an id that is already gone, so unlike the
policy arms beside it there is no not-found code to list.

Also deletes blankToNull, which #3582 left behind with no caller. It had 9 references
before that PR and 1 after, its own definition.

Tests: three cases added to the existing CloudFrontCfnProvisionerTest covering create with
the exact Fn::GetAtt keys, an in-place update under the prior id, and the stack-level
delete. servesTheFourConfigTypes pinned the served set at four types and is renamed and
widened to five, which is the assertion doing its job rather than an inconvenience.
Registration is proved rather than assumed: removing the type from resourceTypes(), which
is what a missed registration looks like, fails both CfnResourceInventoryTest and the
provisioner test. Without that, the dispatcher's stub arm reports CREATE_COMPLETE with a
synthetic ARN and the suite stays green.
2026-09-14 22:08:33 -05:00
Priamo Germosen 74d4782b51 feat(batch): support array and multi-node parallel jobs (#3595)
SubmitJob previously rejected arrayProperties/nodeProperties/nodeOverrides
outright. Array jobs now fan out real child jobs (<parentId>:<index>) that
run through the existing single-job pipeline; the parent's status and
arrayProperties.statusSummary are computed live from its children on every
DescribeJobs/ListJobs call instead of being stored and incrementally
updated, which avoids a race between concurrently finishing children.

Multi-node parallel jobs are supported via a new "multinode" job
definition type (numNodes/mainNode/nodeRangeProperties, validated for full
node coverage). SubmitJob runs one Docker container per node concurrently;
per AWS's documented MNP semantics, the job's status, retry decision, and
started/stoppedAt/statusReason are all determined solely by the main node,
not by any node that happens to fail. nodeOverrides.numNodes is supported
with AWS's real validation (requires an open-ended node range).

ListJobs gains arrayJobId and multiNodeJobId support.

dependsOn (job dependencies), CancelJob/TerminateJob (not implemented at
all, pre-existing), EventBridge forwarding of these new fields, and
CloudFormation-provisioned multinode job definitions remain out of scope
and are noted in docs/services/batch.md.
2026-09-14 23:02:04 -04:00
Matheus André b2b43dfb3c fix(rds): enhance DB cluster handling by recording createOnly properties and updating rollback logic (#3636)
Signed-off-by: Matheus André <matheusandr2@gmail.com>
2026-09-14 22:55:48 -04:00
Hector Ventura a5ebda01fb feat(ui): publish a console contract so any web console can be the sidecar (#3641)
Floci could run exactly one web console, the image it ships. This publishes the contract
between Floci and a console so any image can take that slot, and an operator gets there by
setting one image name rather than by configuring seven fields.

Three things make a console a Floci console: it listens on the port in PORT, it serves
GET /api/health, and it talks to Floci at AWS_ENDPOINT_URL. Everything else is detail the
contract spells out, including the AWS baseline every launched container already receives,
so a console built on any AWS SDK is configured by that SDK's ordinary endpoint and
credential discovery.

Floci learns a console's shape from three sources, in order. The image's own
io.floci.console.* labels come first, so a console describes itself and needs no operator
input at all. A built-in profile covers the consoles Floci already knows. The contract
defaults (/api/health, port 4500, status: ok) cover the rest. Configuration overrides all
three, for a console that describes itself neither way.

That ladder is why the new config keys ship commented out in application.yml. They exist for
the console that fits none of the three sources, and setting one silently disables the
discovery that would otherwise just work. Every accessor is Optional or OptionalInt, so
nothing is required and the test configuration needs no entry.

A malformed label is ignored rather than fatal: a console that declares port="banana" starts
on the default instead of failing the emulator, and the reason is logged.

Docs: docs/ui/console-contract.md is the contract itself, written for console authors, and
docs/ui/index.md is the operator's page. Both are in the mkdocs nav.

Tests: 608 lines. ConsoleProfileResolverTest covers the resolution ladder including the
precedence between its three sources; ContainerLifecycleManagerImageLabelsTest covers reading
labels off an image; FlociUiManagerTest grows to cover the manager against the contract.
Neutralising the label arm fails 5 of the 13 resolver tests, so the ladder is genuinely
exercised rather than the tests only asserting defaults.
2026-09-14 21:53:59 -05:00
Amogh Bhat Nagri ea88947865 fix(ssm): apply every DescribeParameters filter and page the results (#3646)
DescribeParameters honoured only Key=Name, Option=Equals and silently
dropped every other ParameterFilters entry. With no Name/Equals filter
left it returned every parameter in the region, so a Path, Type or
Name BeginsWith filter widened the result instead of narrowing it.

The filters now follow the ParameterStringFilter reference: Name, Type,
KeyId, Path, Tier, DataType and tag:<key>, with Equals and BeginsWith
(Name also Contains, Path OneLevel and Recursive). Filters combine with
AND and a filter's values with OR. The deprecated Filters shape matches
Name, Type and KeyId exactly. An unsupported key, option or value is
InvalidFilterKey, InvalidFilterOption or InvalidFilterValue instead of
being ignored, and MaxResults/NextToken page through the shared cursor.

Closes #3642
2026-09-14 22:49:15 -04:00
Kenshin Okinaka 190c556940 refactor(ses): extract the shared v2 JSON helpers and guard controller registration (#3640)
SesController's 13 request-parsing helpers that more than one URL group
uses (body and member shape checks, the Tags array, the v1-to-v2 error
remapping) move byte-for-byte into a package-private static SesV2Json so
the per-domain controllers that follow can share them without
inheriting from or duplicating the monolith; readOptionBody now takes the
caller's ObjectMapper. SesV2JsonTest pins each helper's accept/reject
split and wording directly, and SesV2ControllerRegistrationTest asserts
that every /v2/email resource class in the package is registered on the
SES descriptor, since an unregistered controller still serves signed SDK
calls and only silently loses the service-enabled gate and the
x-amzn-errortype header for unsigned requests. No endpoint moves and no
wire behavior changes.
2026-09-14 22:30:09 -04:00
Priamo Germosen efdef71527 refactor(cloudfront): extract repeated marker/maxItems pagination into the existing paginate helper (#3586)
CloudFrontService.java already has a private generic paginate(List<T>, marker, maxItems, keyFn)
helper, used by seven of its list* methods (functions, continuous deployment policies, public
keys, key groups, realtime log configs, field-level encryption configs/profiles). Six older
list* methods (listDistributions, listInvalidations, listCachePolicies,
listOriginRequestPolicies, listOriginAccessControls, listCloudFrontOriginAccessIdentities)
were never migrated to it and kept their own inline copy of the same 18-line marker-lookup and
maxItems-truncation block, the duplication CPD flagged.

Wired all six onto the existing helper. listResponseHeadersPolicies keeps its own inline
version untouched: unlike the others, it treats an unmatched marker as InvalidArgument instead
of silently starting from the beginning, a genuine behavioral difference from paginate() that
this issue does not ask to change.

No behavior change for the six migrated methods. Full CloudFront and CloudFront CloudFormation
test suites pass unchanged.
2026-09-14 21:55:25 -04:00
Priamo Germosen bd13c7f9ce refactor(s3): point PreSignedUrlFilter at the shared SigV4RequestValidator crypto helpers (#3596)
S3's PreSignedUrlFilter carried its own private copy of deriveSigningKey/hmacSha256/
sha256Hex/hexEncode, the same SigV4 signing-key derivation block that SigV4Validator
(ElastiCache) and RdsSigV4Validator (RDS) used to carry independently before #3581
consolidated those two into core.common.auth.SigV4RequestValidator. S3's copy was out
of scope there and left as a third independent copy of the same crypto logic.

S3's canonical-request construction is real REST SigV4 (method/path/headers/payload
hash), a different shape from SigV4RequestValidator's own validate() method, which
handles the simplified query-token form ElastiCache/RDS presigned URLs use. So this
doesn't reuse validate() itself, only the four low-level crypto primitives, now made
public on SigV4RequestValidator for exactly this kind of reuse. PreSignedUrlFilter's
own copies are removed and its one call site now delegates to the shared methods.

S3HeaderSignatureFilter, which reused PreSignedUrlFilter's helpers directly (they were
package-private), is updated to call the shared class as well.

Adds SigV4RequestValidatorTest: the shared crypto primitives were previously only
exercised indirectly through each caller's own request flow. Now that they're public
specifically for cross-service reuse, this pins them directly against an independently
computed value (cross-checked with Python's hmac/hashlib, not derived from this code).

No behavior change otherwise. Full S3 test suite (over 1000 tests across all S3 files)
and the ElastiCache/RDS/Redshift SigV4 validator tests pass unchanged.
2026-09-14 21:54:13 -04:00
Priamo Germosen 3c96327ac4 refactor(bedrock-agentcore): extract shared error/JSON helpers into BedrockAgentCoreControllerSupport (#3637)
BedrockAgentCoreControlController, GatewayController, GatewayRuleController,
IdentityController, MemoryController, ResourcePolicyController, and ToolsController each
carried their own byte-for-byte identical copy of error(Exception, String) (AwsException
maps to a structured JSON body with an X-Amzn-Errortype header, anything else falls back
to a 400 ValidationException), the single most duplicated area CPD found across src/main.
Three of them (Control, Gateway, Memory) also carried an identical stringMap(JsonNode)
JSON-object-to-map helper, and four (Control, Gateway, Identity, Memory) carried an
identical text(JsonNode, String) field-extraction helper found along the way.

Extracted all three into a new package-private BedrockAgentCoreControllerSupport. Each
controller keeps its own private error/stringMap/text methods as one-line delegations
(error still takes the caller's own LOG so log lines keep attributing to the right
controller), so no call site elsewhere in any of the seven files needed to change.

putInstant deliberately stays out: it's duplicated too, but it's two genuinely different
behaviors (ISO-8601 strings for runtimes and gateways, epoch seconds for workload
identities and memories) wearing the same method name, not one shared behavior. Merging
it would risk conflating the two.

While here, also finished what #3556 started delegating: BedrockAgentCoreMemoryController
had its own separate awsError(AwsException) doing the exact same thing as error(), added
for the new event endpoints. Routed those four call sites through the existing error()
method instead and removed the duplicate. Also fixed BedrockAgentCoreMemoryController's
import block, which had non-java/java.util imports interleaved into the jakarta.ws.rs
group.

No behavior change. Removing AwsErrorResponse/AwsException/HashMap imports that became
unused after the extraction where applicable. Full bedrockagentcorecontrol and
bedrockagentcore test suites (95 tests) pass unchanged. Three of the seven controllers
(GatewayRule, ResourcePolicy, Tools) have no existing test coverage at all; manually
verified the delegated error() renders identical ValidationException/ResourceNotFoundException
responses on ResourcePolicyController before removing the verification test, since adding
permanent coverage for previously-untested controllers is a separate concern from this
issue's scope.
2026-09-14 21:53:06 -04:00
Matheus Oliveira 4707d4d3a8 fix(sfn): enforce the alias and published version quotas per state machine (#3580)
CreateStateMachineAlias rejects the 101st alias, and publishing rejects the
1001st version, with ServiceQuotaExceededException.

* Fix #3575
* Fix #3614

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-09-14 20:55:32 -04:00
hisham-coderandHisham Mohammed d45a437122 fix(rds): persist PubliclyAccessible on Create/ModifyDBInstance and echo it on Describe (#2484)
DescribeDBInstances hard-coded <PubliclyAccessible>false</PubliclyAccessible>
regardless of what CreateDBInstance or ModifyDBInstance were sent. Clients
that persist the response saw drift; terraform-provider-aws re-issued
ModifyDBInstance on every apply for an instance with publicly_accessible =
true (same class as the defaults fixed in #2420).

The flag now lives on DbInstance (AWS default false when omitted), is parsed
on both Create and Modify through the existing strict parseOptionalBoolean
(a malformed value is InvalidParameterValue, never silently false), and is
echoed on every describe.

Co-authored-by: Hisham Mohammed <hisham.ma.mohammed@gmail.com>
2026-09-14 18:32:37 -04:00