mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
a9df872956056dfd111609fc796787d9a69a96b4
1463
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
c48b6b0b0a |
fix(lambda): do not publish a version when nothing has changed (#2941)
"AWS Lambda doesn't publish a version if the function's configuration and code haven't changed since the last version." Publishing was unconditional, so repeated publishes accumulated identical versions. Unchanged is decided by $LATEST's revisionId, which is regenerated on every code and configuration update, so a version records the revision it was cut from and a later publish that finds it unmoved returns that version. Keying on the revision rather than comparing the fields a snapshot copies means a field added later is covered without anyone remembering to update a comparison. Versions published before this carry no source revision and never match, so existing state keeps its previous behaviour. Three carve-outs, each with a test: Description is supplied at publish time rather than carried on $LATEST, so a publish naming a new one is a real publish even when nothing else moved. LambdaVersionIntegrationTest already asserted that and decides the case. Only the most recent version counts, because AWS compares against the last version: a description going A then B then A must publish again rather than matching the older A. A hot-reload function's code lives in a bind-mounted directory that changes with no API call, so revisionId cannot witness it and these always publish. Two existing tests change, because the behaviour they assert is the one this fixes. LambdaServicePersistenceTest reached version 3 by publishing three times with nothing changed; its subject is the counter surviving a restart, so it now varies the description. CodeDeployTest published identical bytes twice to get two versions for a blue/green shift; it now deploys a real change between them, which is what a blue/green deployment does anyway. Closes #2822 |
||
|
|
91d7ab8935 |
fix(docdb): accept an existing security group on CreateDBCluster and ModifyDBCluster (#2991)
* fix(docdb): accept an existing security group on CreateDBCluster and ModifyDBCluster The security group lookup passed null for group names, which Ec2Service.describeSecurityGroups does not accept, so any existing group id answered an internal error while a made-up one was refused correctly before that filter ran. Closes #2990 * test(docdb): clean up the EC2 fixtures of the security-group bats case * test(docdb): tear down the security-group case's EC2 fixtures even when it fails * test(docdb): delete the case's VPC even when its security group was never created |
||
|
|
352d89ff2d |
feat(stepfunctions): close ASL gaps in intrinsics, Choice, StartExecution and ResultPath (#3002)
* feat(stepfunctions): add Base64Encode/Base64Decode/StringSplit/ArrayGetItem/Hash intrinsics
Add five JSONPath-mode Amazon States Language intrinsic functions to
AslExecutor.evaluateIntrinsic, following the existing States.JsonMerge pattern.
Previously these aborted execution with States.Runtime "Unsupported intrinsic function".
- Base64Encode/Base64Decode: RFC 4648 Basic (unwrapped) codec, UTF-8, 10,000 code-point
input cap; invalid base64 -> States.IntrinsicFailure.
- StringSplit: delimiter is a set of code points; empty segments omitted.
- ArrayGetItem: zero-based; rejects non-integer, negative, and out-of-range indexes.
- Hash: lowercase hex digest via an explicit MD5/SHA-1/SHA-256/SHA-384/SHA-512 allow-list
checked before MessageDigest, 10,000 code-point cap.
All argument and data validation failures raise the catchable States.IntrinsicFailure;
States.Runtime remains reserved for malformed/unrecognized calls. Adds
AslExecutorIntrinsicFunctionsTest covering AWS doc examples, edge cases, execution-level
Catch behavior, Parameters-path wiring, and a nine-existing-intrinsic regression.
* fix(stepfunctions): implement all 39 Choice comparators type-strictly and reject invalid rules
floci's Choice state implemented only 18 of the 39 documented ASL data-test
comparators. Any unrecognised comparator — NumericGreaterThanEqualsPath, the
String*Path ordering variants, the entire Timestamp* family, IsTimestamp — fell
off the end of the comparison chain and evaluated silently false, so the Choice
took its Default branch. A workflow routing on >= (or any missing comparator)
silently took the wrong path with no error, log line, or execution-history
annotation.
Changes:
- Add ChoiceOperators: the single source of truth for the 39 data-test operators,
their type-strict evaluation, and Choice-rule validation, shared by the runtime
evaluator (AslExecutor.evaluateCondition) and the Create/Update/Validate path
(StepFunctionsService.validateState) so the two can no longer disagree.
- Implement the 21 missing comparators (String ordering, Numeric *Path
LessThanEquals/GreaterThanEquals, the full Timestamp* family, IsTimestamp).
- Make comparisons type-strict: a mismatched JSON type compares false rather than
coercing (previously a missing path compared equal to numeric 0 / boolean false,
and numeric 5 matched string "5"). Numeric compares via BigDecimal; timestamps
via an RFC3339 lexical gate then instant comparison; StringMatches honours the
\* and \\ escapes and rejects a dangling/illegal escape.
- Reject invalid Choice rules at CreateStateMachine / UpdateStateMachine /
ValidateStateMachineDefinition (unknown field, not exactly one operator, wrong
operand type, invalid reference path, malformed And/Or/Not, misplaced Next), and
raise States.Runtime at evaluation time for a malformed rule or a missing
reference path instead of silently returning false.
AWS Compatibility: verified against the ASL Choice-state specification — all *Path
and Timestamp* comparators, RFC3339 timestamps (uppercase T/Z, instant
comparison), and rejection of unknown comparators at create time (AWS returns
InvalidDefinition / SCHEMA_VALIDATION_FAILED) with a runtime States.Runtime
backstop for already-persisted definitions. Behaviour change: definitions that
previously relied on loose coercion or a silent-false unknown comparator now fail
loudly, matching AWS. Known limitations: leap-second and >9-fractional-digit
timestamps are treated as invalid.
* fix(stepfunctions): make StartExecution idempotent and race-free for STANDARD workflows
floci's StartExecution rejected any name collision with ExecutionAlreadyExists and
performed its check-and-create without synchronization. AWS instead treats a
STANDARD StartExecution with the same name AND the same input, while the original
is still RUNNING, as an idempotent success that returns the original execution;
only a different input (or a closed execution with that name) is a conflict. The
unsynchronized check also let two concurrent same-name starts both create and
launch an execution.
- Serialize the execution check-and-create under a dedicated lock so concurrent
same-name StartExecution calls cannot both create and launch; executeAsync runs
outside the lock, only on the create path.
- Return the existing execution for a STANDARD workflow when the prior execution is
RUNNING and the input is identical (exact wire-string match); otherwise throw
ExecutionAlreadyExists. EXPRESS workflows keep the conflict behaviour (AWS gives
EXPRESS no idempotency guarantee).
AWS Compatibility: verified against the StartExecution API idempotency contract
(STANDARD-only; same name + same input while RUNNING returns the original
execution; a different input or a closed execution with that name conflicts).
Known limitations: closed execution names are not made reusable after AWS's 90-day
uniqueness window (floci conflicts for the process lifetime, which matches AWS
within any realistic emulator session); the StartExecution lock is a single global
monitor rather than per-execution-name.
* fix(stepfunctions): honor Name and JsonToString Input in nested startExecution
The optimized states:startExecution integration ignored the Task's Name (always
generating a random execution name) and re-serialized the resolved Input
unconditionally, so an Input built with States.JsonToString(<object>) was
double-encoded: the child execution received a JSON string literal instead of the
intended object.
- Add NestedExecutionInput: the child-input encoding + a States.JsonToString
provenance check, plus the intrinsic function-name parse SHARED with
AslExecutor.evaluateIntrinsic so provenance and evaluation cannot drift.
- Encode the child input by provenance: a value produced by States.JsonToString is
JSON text used verbatim as the wire input (the child parses it back to an object);
any other value is serialized as a JSON value (an object stays an object; a plain
or JSON-looking string stays a JSON string literal). A missing Input yields {}.
- Honor Name / Name.$ instead of passing null. A supplied Name that does not resolve
to a non-empty string fails with States.Runtime rather than silently generating a
name; a truly omitted Name still generates one.
AWS Compatibility: matches the ASL payload-template and StartExecution semantics for a
nested execution's input and name (verified against the ASL spec's type-preserving
payload templates and the documented States.JsonToString "string containing JSON
text"). Behaviour change: a States.JsonToString(<object>) Input now reaches the child
as an object (previously a string); object / .$ / plain-string Inputs are unchanged.
Scope: JSONata Arguments and colliding Input/Input.$ templates are out of scope (the
latter's runtime behaviour is made safe).
* fix(stepfunctions): raise States.ResultPathMatchFailure instead of discarding state input
When a state's ResultPath addresses an object member ($.field) but the state input is
not a JSON object, floci silently discarded the input and returned the bare result.
AWS instead fails the execution with States.ResultPathMatchFailure.
- Extract the ResultPath merge (and its setPath helper) into ResultPathMerge so the
merge rules are unit-testable without the full executor.
- Raise States.ResultPathMatchFailure for a non-object input combined with a
$.-member ResultPath (previously a silent input discard). null / "null" / "$"
ResultPaths and object-input merges are unchanged.
- Propagate a failure raised while applying a matched Catcher's own ResultPath with
its real error name rather than relabeling it States.Runtime.
AWS Compatibility: matches the ASL ResultPath spec (a non-applicable ResultPath is
States.ResultPathMatchFailure, not a silent discard). Behaviour change: a state (or
Catcher) with a $.field ResultPath over a scalar/array input now fails instead of
silently dropping the input. Known residuals: $[...]-style ResultPaths are not applied,
and a $.a.b path whose $.a is a scalar is overwritten rather than failing.
* style(stepfunctions): remove em dashes from lines this branch adds
AGENTS.md, Documentation Style: "No em-dashes anywhere, in any content. Use
colons, commas, or periods." Seventeen lines added by this branch used one. All
of them sit in files the branch creates, so they also trip the doc-style
workflow, which scans newly added files.
Scoped strictly to lines this branch adds. The em dashes main already carries on
untouched lines in AslExecutor and StepFunctionsService are left alone. Several
clauses are reworded rather than resegmented where a bare colon or comma read
badly, for instance the appositive in the AslExecutorChoiceRuntimeTest header.
Three commit message lines on this branch still contain an em dash. Rewriting
those would require a force-push, so they are left as they are.
|
||
|
|
73deb13c01 |
fix(kinesis): stop dropping shard records under concurrent producers and resharding (#3000)
* fix(kinesis): serialize shard record appends under concurrent producers
Concurrent PutItem->Kinesis CDC forwarding raced on a plain ArrayList in
KinesisShard, silently dropping ~1-3% of change records under load (rows
persisted in DynamoDB, no stream event emitted, no error).
- KinesisShard: encapsulate records behind a monitor; getRecords() returns a
snapshot; add addRecord()/recordCount(); null-safe setRecords().
- KinesisService: per-stream lock across sequence allocation + shard select +
append + store.put (fixes lost updates, sequence-vs-append ordering, and
stale-snapshot WAL replay); split/merge and deleteStream run under the same
lock with an in-lock re-resolve, closing the delete-vs-append resurrection
race; iteratorStartIndex uses recordCount().
- fix(dynamodb): KinesisStreamingForwarder no longer swallows forwarding
failures as a WARN-and-drop; logs ERROR with stack trace and increments a
forwardFailures counter (no rethrow: forwarding runs post-commit, and the
TTL sweep forwards mid-loop before persisting).
- Tests: concurrent CDC end-to-end, service-layer stress with sequence-order
and AFTER_SEQUENCE_NUMBER continuation, deterministic mutual-exclusion, WAL
persistence/reload, TTL happy + failure-isolation, delete-vs-append.
* fix(kinesis): make shard-list reads safe under concurrent resharding
Follow-up to the CDC record-loss fix, closing the reader-vs-reshard race and a
related shard-id defect.
- KinesisStream.shards -> volatile CopyOnWriteArrayList (+ null-safe setter):
lock-free shard readers (getRecords/peekRecords/getRecordsForAccount/
iterators/inspection) get CME-free snapshots while split/merge (under the
per-stream lock) append. The list is only ever add()-ed, so COWAL is a
drop-in; shard counts are tiny so copy-on-write cost is negligible.
- KinesisJsonHandler.paginateShards: snapshot (List.copyOf) before subList --
a COWAL subList is not snapshot-safe and could still throw CME on ListShards
during a concurrent reshard.
- splitShard: publish both children with a single atomic addAll, and derive
distinct child ids from the base size (previously both children got the same
id on a single-shard split, and a reader could observe a half-built
{parent, child1} topology with a hash-range gap).
Known residual (documented): parent-shard close is not fully atomic w.r.t. the
children add for lock-free readers; producers are unaffected.
Tests: reader-mid-iteration survives split; ListShards page survives concurrent
split; no half-published topology observable (RepeatedTest); child-id
uniqueness + hash-range tiling.
* fix(kinesis): serialize stream metadata writes with deleteStream
Every metadata action did a read-modify-write on the stored stream without the
per-stream monitor: resolve, mutate, store.put. The store hands back the live
instance, so a write that overlapped deleteStream could persist the stale
pre-delete instance after the locked delete had already removed it, resurrecting
the stream, or clobber a stream since recreated under the same name. On the WAL
backend that trailing put also appends a PUT entry after the DELETE, so the
resurrection survives replay.
Ten paths were exposed: updateStreamMode, addTagsToStream, removeTagsFromStream,
startStreamEncryption, stopStreamEncryption, increaseStreamRetentionPeriod,
decreaseStreamRetentionPeriod, enableEnhancedMonitoring,
disableEnhancedMonitoring and updateMaxRecordSize. Each now takes the same
monitor the append and split/merge paths take, and resolves the stream inside it,
so a stream deleted in the meantime surfaces ResourceNotFoundException instead of
being re-persisted. Validation order and the same-value no-op short-circuits are
unchanged, so no client-visible behaviour moves.
The monitor lookup moves behind lockFor, which carries the two-part contract
(hold the monitor, and resolve inside it) and the reason monitors are never
removed from the map. createStream is deliberately left alone: it builds a fresh
instance rather than retaining a resolved one, so it has no stale state to
re-persist and cannot resurrect a deleted stream.
Tests: all ten actions driven through the same interleaving, each wedged inside
its in-lock resolve while a concurrent deleteStream must block on the shared
monitor. That proves the delete lands after the persist and the stream stays
gone. Reverting either half of the fix on a single action fails only that case.
* style: remove em dashes from lines this branch adds
AGENTS.md, Documentation Style: "No em-dashes anywhere, in any content. Use
colons, commas, or periods." Twelve lines added by this branch used one, three
of them in files the branch creates, which also trips the doc-style workflow
since that job scans newly added files.
Scoped strictly to lines this branch adds. Pre-existing em dashes on untouched
lines are left alone, including three in KinesisService and KinesisJsonHandler
that main already carries. A few clauses are reworded rather than resegmented
where a bare colon or comma read badly.
|
||
|
|
1f87f7c482 |
feat(ec2): implement instant CreateFleet (#2956)
* feat(ec2): implement instant CreateFleet * fix(ec2): address CreateFleet review feedback * fix(ec2): harden CreateFleet placement rollback * test(ec2): isolate CreateFleet dry-run fixture * fix(ec2): group CreateFleet response instances * fix(ec2): report incomplete fleet rollback * fix(ec2): resolve fleet placement from subnet overrides |
||
|
|
a7be2dd299 |
feat(neptune): support the Terraform aws_neptune_cluster read-back contract (#3017)
* feat(neptune): support the Terraform aws_neptune_cluster read-back contract The Terraform AWS provider's aws_neptune_cluster resource reads back every DBCluster field after create and update, and treats a mismatch on a ForceNew attribute as a replacement. Against Floci the resource could not converge: StorageEncrypted was hardcoded to true against the provider's default of false, AvailabilityZones was emitted as a singular element that SDK parsers drop, BackupRetentionPeriod and the other settings were never stored, and tag calls on a Neptune ARN never reached the Neptune store. CreateDBCluster and ModifyDBCluster now store the settings a request carries (NeptuneClusterSettings, modelled on DocDbClusterSettings) and DescribeDBClusters reads them back with the AWS defaults otherwise: AvailabilityZones, BackupRetentionPeriod, PreferredBackupWindow, PreferredMaintenanceWindow, DBSubnetGroup, DBClusterParameterGroup, VpcSecurityGroups, StorageEncrypted, KmsKeyId, StorageType, DeletionProtection, CopyTagsToSnapshot, EnabledCloudwatchLogsExports, ReplicationSourceIdentifier, ServerlessV2ScalingConfiguration, AssociatedRoles and ClusterCreateTime. StorageEncrypted defaults to false as on AWS. Also: - A requested Port is honoured when it is free inside the proxy range, so Terraform's default port of 8182 matches the first cluster. - DeleteDBCluster refuses a cluster with DeletionProtection enabled with InvalidParameterCombination, as on AWS. - DBClusterMembers uses the DBClusterMember element the Neptune API model declares; the previous member element was dropped by SDK parsers. - New actions: AddRoleToDBCluster, RemoveRoleFromDBCluster, DescribeGlobalClusters (empty list), ListTagsForResource, AddTagsToResource and RemoveTagsFromResource. Tags are accepted on CreateDBCluster and CreateDBInstance, and the rds credential scope routes a Neptune ARN ResourceName to the Neptune handler. Verified against hashicorp/aws 6.62.0 with terraform apply, a clean re-plan, an update covering retention, protection, log exports, security groups, iam_roles and tags, a destroy blocked by deletion protection, and a destroy after disabling it. * test(compat): cover aws_neptune_cluster in the Terraform and Java SDK suites Adds a dedicated Terraform fixture and bats test that applies an aws_neptune_cluster, checks the read-back through terraform output and the AWS CLI, checks tags through ListTagsForResource, and asserts a clean re-plan. Extends the Java SDK NeptuneTest with tags, IAM roles, modify settings, deletion protection and cluster members, so a real SDK parser covers the new DBCluster fields. * fix(neptune): infer the rds service for the DBCluster role actions Unsigned Query requests resolve their service from the action name, and AddRoleToDBCluster and RemoveRoleFromDBCluster were missing from the RDS action set, so they fell through to the SQS default instead of reaching the Neptune handler. * feat(neptune): read back the settings Terraform's aws_neptune_cluster_instance manages DescribeDBInstances omitted AutoMinorVersionUpgrade, PromotionTier, PubliclyAccessible, the parameter and subnet groups and the windows, ModifyDBInstance ignored them, StorageEncrypted was hardcoded to true, and every cluster member was reported as the writer, so the provider issued a ModifyDBInstance on every apply. NeptuneInstanceSettings, modelled on NeptuneClusterSettings, stores what a request carries and DescribeDBInstances reads it back with the AWS defaults otherwise; StorageEncrypted, KmsKeyId and StorageType are the cluster's. The first member of a cluster is its writer and deleting it promotes the next. Covered by unit, integration and Java SDK tests and a Terraform compat fixture with a writer and a reader instance. --------- Co-authored-by: kurtmc <2661907+kurtmc@users.noreply.github.com> |
||
|
|
0c33ef234b |
feat(ec2): Capacity Reservation CRUD (#2974)
* feat(ec2): Capacity Reservation CRUD CreateCapacityReservation, DescribeCapacityReservations, ModifyCapacityReservation and CancelCapacityReservation were unimplemented, so any aws_ec2_capacity_reservation resource failed with UnsupportedOperation. Wire shapes follow botocore's ec2/2016-11-15 service model: synchronous creation (active on the create response), TagSpecification support on create, the documented Describe filters, and cancel marks the record cancelled with zero available capacity rather than deleting it, matching AWS's retain-but-cancel behaviour. * fix(ec2): match the AWS required fields and filters for Capacity Reservations InstancePlatform and InstanceCount are required and AvailabilityZone is optional, with AvailabilityZoneId accepted. A non-positive InstanceCount is rejected on create and modify. The describe filters drop capacity-reservation-id and add instance-match-criteria and end-date-type. |
||
|
|
09801146b1 |
feat(autoscaling): warm pools, scheduled actions, traffic sources, and process suspension (#2973)
* feat(autoscaling): warm pools, scheduled actions, traffic sources, and process suspension PutWarmPool/DescribeWarmPool/DeleteWarmPool, PutScheduledUpdateGroupAction/ DescribeScheduledActions/DeleteScheduledAction, AttachTrafficSources/ DetachTrafficSources/DescribeTrafficSources, and SuspendProcesses/ ResumeProcesses, parsed against botocore's autoscaling/2011-01-01 wire model. Deleting a group also removes its scheduled actions and warm pool. * fix(autoscaling): scope scheduled-action cleanup to the group's region Deleting a group removed scheduled actions with the same group name in every region. PutScheduledUpdateGroupAction now rejects a malformed StartTime or EndTime with ValidationError instead of treating it as absent. |
||
|
|
84ec8ae8e7 |
feat(dynamodb): index-qualified PartiQL SELECT with ConsistentRead validation (#2953)
* feat(dynamodb): index-qualified PartiQL SELECT with ConsistentRead validation ExecuteStatement parsed FROM "Table" only — a dot aborted the lexer with 'Unexpected character', so PartiQL could not read through a secondary index at all. Lex the qualifier, resolve it to an access path, and route the read the way AWS does (characterised on real AWS, eu-west-1, 2026-09-02): - equality on the selected source's partition key queries it; any other WHERE shape becomes a full scan of the table or index with the remaining conditions as a filter - ConsistentRead on a GSI-qualified statement is rejected with 'Strongly consistent read is not supported on Global Secondary Indexes' — PartiQL's own wording, distinct from Query/Scan - an unknown index omits the index name from the message, again unlike Query/Scan; index resolution also precedes the consistent- read check - SELECT over an index surfaces only projected attributes, and an explicitly selected non-projected column is rejected - BatchExecuteStatement SELECT statements must resolve through the table's primary key; index-qualified or partial-key statements get a per-statement ValidationError slot Consistent reads on base tables and LSIs stay legal, NextToken/Limit now paginate both read branches, and GetItem stays a base-table-only shortcut. Reproduced with paritysuite/dynamodb-conformance (new tests/tier2/partiql/executeStatementIndex.test.ts plus ExecuteStatement cases in tier3/error-messages/indexReads.test.ts): the qualified-read and message cases fail against main and pass with this change. Signed-off-by: Kévin Dehoux <dehoux.kevin@gmail.com> * fix(dynamodb): bind the PartiQL NextToken to its issuing statement A PartiQL NextToken carried only the last evaluated key, so replaying a token against another table or access path with identical key names and scalar types was accepted: Scan continued from the foreign key and skipped items, Query restarted and duplicated them. Real AWS binds the opaque token to the request: replaying it against any other statement, table or access path is rejected with 'NextToken does not match request', while a changed Limit or a dropped ConsistentRead is accepted and an older token replays idempotently (characterised on real AWS, eu-west-1, 2026-09-03). The token now embeds a SHA-256 digest of the statement text and parameter values alongside the key, and decoding verifies it against the current request. Wire integration tests cover statement, parameter, index-qualified and cross-table replay plus the accepted Limit change; the SDK twin asserts the exact message; the conformance suite gains the base-table-to-index replay case. Signed-off-by: Kévin Dehoux <dehoux.kevin@gmail.com> --------- Signed-off-by: Kévin Dehoux <dehoux.kevin@gmail.com> |
||
|
|
7fdd145c0c |
fix(lambda): honor configured function architecture (#2994)
* fix(lambda): honor configured function architecture * fix(lambda): isolate Docker images by platform * fix(lambda): reject unsupported architectures early * fix(lambda): require one function architecture Note: pre-existing full-suite flakes in EC2, Kinesis Analytics, and RDS Data passed in isolated reruns. * fix(lambda): preserve legacy architecture fallback * fix(lambda): reject malformed architecture fields * fix(lambda): reject invalid persisted architectures |
||
|
|
ee24c77d02 |
feat(lakeformation): add UpdateResource action (#2944)
* feat(lakeformation): add UpdateResource action * fix(lakeformation): validate resource updates safely * fix(lakeformation): synchronize registerResource and pin the register/update race * fix(lakeformation): publish UpdateResource atomically to concurrent readers UpdateResource mutated the stored ResourceInfo field by field while DescribeResource and ListResources read the same object reference without synchronization, so a concurrent reader could observe a mixed state (e.g. new role ARN with old federation value). Apply copy-on-write: build a defensive copy, mutate the copy, then atomically put it back. Readers now see either the old complete state or the new complete state, never a partial one. Add a regression test that races DescribeResource against UpdateResource and asserts every observed snapshot is internally consistent. * fix(lakeformation): remove em-dash |
||
|
|
9162b990ec |
fix(cloudformation): keep generated names across updates for Scheduler, SQS and MicrovmImage (#2985)
provision runs again on every UpdateStack. #2788 gave seven provisioners ProvisionContext.stablePhysicalName so an unnamed resource keeps the name it already had instead of creating a second one and orphaning the first, and left AWS::SQS::Queue and AWS::Lambda::MicrovmImage for a follow-up. The Scheduler ScheduleGroup provisioner solved the same problem by reading the id off the resource, the pattern AGENTS.md step 4 now documents as an anti-pattern because provision assigns the new id as it works. All three names are createOnly in their registry schemas. Scheduler: stablePhysicalName plus reusesPriorEntity in place of the ConflictException catch; the tag diff goes through ProvisionContext.staleTagKeys. One behaviour change: the old path called createScheduleGroup and adopted only on ConflictException, so a group deleted outside the stack was silently recreated; the new path reads the group first and surfaces ResourceNotFoundException, which is what CloudFormation does. SQS: the physical id is the queue URL, so the prior name is read from the QueueName attribute the way SnsCfnProvisioner reads the topic name beside its ARN, and only when its .fifo suffix still matches FifoQueue, which is createOnly too. On reuse the update goes through SetQueueAttributes, the schema's update handler, because createQueue on an existing name answers QueueAlreadyExists the moment an attribute differs; that also fixes an explicitly named queue whose VisibilityTimeout changed. An explicitly named queue whose FifoQueue changes fails with ValidationError instead of reconciling around it: the schema's own QueueName text says a named queue cannot take an update that requires replacement, and that is the refusal the other provisioners use for a createOnly change under a kept name. AWS::SQS::QueuePolicy keeps its id across updates, the same two-line fix S3::BucketPolicy got. MicrovmImage: stablePhysicalName, and on reuse updateImage (the schema's UpdateMicrovmImage handler) rather than createImage, which would mint a new version on every update. CfnStableNameUpdatePathTest gains one case per type pinning exactly one create across create plus update; the SQS integration test drives an unnamed queue through UpdateStack with a changed VisibilityTimeout against the real service. Left for follow-ups: SQS Tags, the NetworkConnector name, resetting an attribute the template dropped, and recreating a resource deleted out of band the way EcsCapacityCfnProvisioner does, if that leniency is wanted. |
||
|
|
96d16de998 |
feat(s3): add Intelligent-Tiering configuration CRUD (#2997)
* feat(s3): add Intelligent-Tiering configuration CRUD Add AWS S3 Intelligent-Tiering configuration management through the real REST XML subresource (?intelligent-tiering), mirroring the existing metrics configuration pattern. Operations: - PutBucketIntelligentTieringConfiguration (PUT, 204) - GetBucketIntelligentTieringConfiguration (GET by id) - ListBucketIntelligentTieringConfigurations (GET without id) - DeleteBucketIntelligentTieringConfiguration (DELETE, 204) The parser validates Id, Status (Enabled/Disabled), optional Filter (Prefix/Tag/And), and one or more Tiering entries (AccessTier + positive Days), re-serializing through XmlBuilder/XmlParser/AwsNamespaces.S3 so responses are built by floci rather than echoing the request body. Malformed bodies return MalformedXML; missing configurations return NoSuchConfiguration. Configurations are stored on the Bucket model keyed by id (nullable map for backward-compatible deserialization of older snapshots), persisted through StorageFactory, and synchronized on the bucket monitor with the same requireSameRecord guard as metrics to survive concurrent puts and bucket delete/recreate races. Tests: - S3IntelligentTieringConfigurationTest: parser unit tests - S3ServiceTest: service lifecycle, isolation, persistence, concurrency - S3IntelligentTieringConfigurationIntegrationTest: REST integration - compatibility-tests/sdk-test-awscli: AWS CLI bats coverage * refactor(s3): rename METRICS_XML_DECLARATION to S3_XML_DECLARATION The XML declaration constant is shared by both metrics and intelligent-tiering configuration responses, so the name should reflect its S3-wide scope rather than implying it is metrics-specific. * fix(s3): enforce auth and validate Days overflow on intelligent-tiering Address review feedback on PR #2997: - PUT and DELETE ?intelligent-tiering now enforce S3 authorization via a new authorizeBucketWrite method, closing the bypass where mutations skipped the auth applied to reads. - Days values above Integer.MAX_VALUE no longer throw NumberFormatException and return 500 InternalError; they are rejected as 400 MalformedXML. - A PUT without a request body returns 400 MalformedXML instead of NPE/500. Tests: unit coverage for Days overflow, integration coverage for empty body. * fix(s3): enforce tier-specific Days range on intelligent-tiering AWS enforces a tier-specific Days range for S3 Intelligent-Tiering: - ARCHIVE_ACCESS: 90 to 730 days - DEEP_ARCHIVE_ACCESS: 180 to 730 days Out-of-range values now return InvalidArgument with ArgumentName and ArgumentValue in the XML error body, matching the real S3 error shape. Add unit and integration tests covering below-minimum, above-maximum, boundary acceptance, and the full XML error response. * refactor(s3): extract Days range constants in intelligent-tiering Replace repeated magic numbers (90, 180, 730) with named constants ARCHIVE_ACCESS_MIN_DAYS, DEEP_ARCHIVE_ACCESS_MIN_DAYS, and MAX_DAYS. Pass min into daysOutOfRange instead of recomputing it, and use an import for LinkedHashMap. |
||
|
|
3600038a3f |
fix(ssm): set the Arn attribute on AWS::SSM::Parameter (#3019)
The registry schema lists Arn as the type's only read-only property, but the provisioner never set it, so Fn::GetAtt [Param, Arn] resolved to the literal "Param.Arn" and CfnSchemaCoverageTest fails on main once the schema corpus is present. The ARN uses AWS's parameter/<name> form: a name without a leading slash gets one inserted, a name with one is not doubled. |
||
|
|
9220c057b7 |
feat(iot): domain configurations (#3008)
* feat(iot): add the domain configuration model and service Stores AWS IoT Core domain configurations the way the API reports them: a new configuration is ENABLED and CUSTOMER_MANAGED (ENDPOINT without a domain name), carries one VALID server certificate, the default TLS policy and an ARN with the short id AWS appends. Update changes the status, authorizer, TLS, certificate and protocol settings; delete refuses an ENABLED configuration, as AWS does; list filters by service type and pages with marker and pageSize. Tags work on the ARN. * feat(iot): serve the domain configuration API Adds the REST-JSON routes CreateDomainConfiguration, DescribeDomainConfiguration, UpdateDomainConfiguration, DeleteDomainConfiguration and ListDomainConfigurations under /domainConfigurations, registered with the IoT service so the X-Amzn-Errortype header is set for unsigned callers too. Tags on a configuration ARN go through IotTagHandler; the IoT /untag route now uses the same handler as /tags instead of calling IotService directly. DescribeEndpoint accepts iot:CredentialProvider, the endpoint type that pairs with the CREDENTIAL_PROVIDER service type. * feat(iot): provision AWS::IoT::DomainConfiguration Adds IotDomainConfigurationCfnProvisioner over the domain configuration service. Ref is the configuration name; Fn::GetAtt Arn, DomainType and ServerCertificates resolve to what DescribeDomainConfiguration reports (ServerCertificates as a JSON string, since attributes are strings). Like the CloudFormation handler, a configuration is created ENABLED and a DomainConfigurationStatus of DISABLED is applied with a follow-up update; tags go through TagResource and are reconciled on update; a delete disables the configuration first because the API refuses to delete an ENABLED one. UpdateStack keeps the configuration when the createOnly properties (DomainName, ServiceType, ValidationCertificateArn, ServerCertificateArns) are unchanged and replaces it otherwise, with a fresh generated name when the template names none. Inventory TSV, fixture wiring and the generated resource-type table updated. * docs(iot): describe domain configurations and add the stack integration test IotDomainConfigurationCfnIntegrationTest provisions the type through a stack and asserts Ref and every Fn::GetAtt attribute against DescribeDomainConfiguration, the in-place status update, and that DeleteStack removes the configuration. * test(iot): cover domain configurations in the Java and Go SDK suites Both cases create, describe, list, update and delete a configuration through the real SDK clients and check the AWS error types on the duplicate create, the refused delete of an ENABLED configuration and the describe after deletion. * fix(iot): remove a renamed domain configuration and keep the status when the template omits it A template that changes DomainConfigurationName creates the new configuration and now removes the previous one, as the generated-name replacement already did; before, the old configuration outlived the stack. An update without DomainConfigurationStatus no longer forces ENABLED: the field is omitted and the current status stays, as the AWS handler does. The service rejects a structured JSON value where a string, boolean, list or object is expected instead of turning it into an empty string or silently clearing the authorizer, and validates the whole update before touching the stored record. * fix(iot): let stack rollback remove a domain configuration and make same-name creates atomic A configuration created by a stack is recorded, with the owned marker, before the follow-up status update, so a failure there still lets the create rollback delete it. A replacement that fails after the new configuration exists removes it again, re-enables the previous one if it had been disabled on the way out, and marks the resource restored, as the other provisioners do. CreateDomainConfiguration checks and stores the name in one step, so two overlapping creates of the same name cannot both succeed. A tags value that is not a list is rejected. The Java SDK compatibility case looks for a leftover configuration instead of swallowing every cleanup exception. * fix(iot): point the resource back at the prior domain configuration after a failed replacement After the unwind removes the replacement and re-enables the previous configuration, the resource now carries the previous name and attributes again, without the owned marker, so it describes the configuration that is still there rather than the one just removed. * feat(iot): serve the AWS-managed domain configurations Every AWS account has iot:Data-ATS, iot:Data, iot:CredentialProvider and iot:Jobs without creating them. They now exist in every region on first use: AWS_MANAGED, ENABLED, no server certificate, and the address DescribeEndpoint returns as their domain name. They can be updated and tagged like any other configuration, but not deleted, as on AWS. A client that starts by describing iot:Data-ATS gets an answer instead of a 404. * fix(iot): report a failed replacement cleanup as a rollback failure When the unwind of a failed replacement cannot remove the new domain configuration, the resource now carries the rollback-failure marker with the reason, so the stack ends in UPDATE_ROLLBACK_FAILED instead of reporting a clean rollback while the configuration is still there. The marker moves next to the restored one in CfnRollback so extracted provisioners can set it; the legacy provisioner keeps its alias. * fix(iot): serialise every read-modify-write on a domain configuration Update, delete, tag and untag read a record, change it and write it back. Two overlapping writers lost each other's changes: sixteen tag writers on one configuration left seven keys. All of them now run under the lock the create already used, and a test pins the invariant. A JSON round trip with the mapper setup persistent storage uses pins that the model reloads intact. * fix(iot): keep the prior status the unwind compares against and never delete a same-name replacement The store hands out its live record, so disabling the prior on the way to deleting it changed the very object the unwind later compared against, and a prior whose delete failed half way was left DISABLED while the stack reported a clean rollback. The status seen at the start is now kept and used. The test reproduces the aliasing instead of handing the provisioner a fresh copy per call. A replacement under the same explicit name normally fails on the create; if it goes through because the prior vanished in between, the prior is no longer deleted, which would have removed the configuration just created. * fix(iot): tolerate a domain configuration that vanishes while a stack delete disables it The disable that precedes the delete now treats ResourceNotFoundException as already deleted, the way the delete itself does. The SDK cases also enable an already ENABLED configuration, the call a client makes when it only wants to be sure the configuration is on. |
||
|
|
f3c251ef20 |
feat(cognito): provision AWS::Cognito::UserPoolDomain (#3005)
* feat(cognito): provision AWS::Cognito::UserPoolDomain The type was a stub: the stack turned green, but Fn::GetAtt CloudFrontDistribution resolved to the literal LogicalId.CloudFrontDistribution, so a Route 53 alias record for a custom domain pointed at that text. CognitoCfnProvisioner creates the domain through the existing CreateUserPoolDomain. Ref is the domain name and CloudFrontDistribution is the CloudFront name DescribeUserPoolDomain reports. A changed Domain or UserPoolId replaces the domain; any other change is applied in place through the new UpdateUserPoolDomain operation, so the distribution a DNS alias points at survives a certificate change, as on AWS. Delete uses the pool id recorded at create time and tolerates an already deleted domain. UpdateUserPoolDomain is also exposed on the Cognito API, with the same response shape as CreateUserPoolDomain. * feat(cognito): treat null domain settings as absent and pin the same-name replacement failure Review follow-ups for AWS::Cognito::UserPoolDomain: - A JSON null inside CustomDomainConfig was copied as the text "null", which would have passed for a certificate ARN. Null values are now skipped, so the service rejects the missing ARN as it should. - ManagedLoginVersion on CreateUserPoolDomain and UpdateUserPoolDomain treated an explicit null as 0, overwriting the stored version. Null now counts as omitted, and a value of another JSON type is a SerializationException, as on AWS. - Moving an unchanged domain to another pool fails on the create, because domain names are unique across pools and the replacement is created before the original is deleted, exactly as on AWS. The unit test that mocked this path as a success is replaced by one that pins the failure and checks the original domain is left in place. * test(cognito): cover domain replacement, prefix domains and SecurityPolicy updates The stack test now also renames the domain through UpdateStack, asserting the old domain is gone and the new one has its own distribution, and a second stack proves a prefix domain resolves Fn::GetAtt CloudFrontDistribution to an empty string rather than the literal attribute name. The service test covers a SecurityPolicy change and that an omitted policy is kept. The in-place check reads ctx.reusesPriorEntity(domain), as the sibling provisioners do. * test(cognito): provision the stack test's certificate through AWS::CertificateManager::Certificate With the ACM provisioner merged, the stack test now declares the certificate as a resource and references it with Fn::GetAtt, the way CDK does. Rotating to a new certificate resource updates the domain in place and removes the old certificate once nothing references it. A wildcard name keeps a domain rename from replacing the certificate. |
||
|
|
71c7836da1 |
fix(cloudformation): skip re-invoking custom resource handlers when properties are unchanged (#2785)
Per AWS docs (UserGuide/template-custom-resources-sns.md): "During a stack update, if no changes are made to a custom resource, CloudFormation will not send any requests to it." floci's provisionCustomResource() already stashed each custom resource's prior resolved properties (CR_PROPERTIES_ATTR) and read them back on Update, but never actually compared old vs new before invoking the handler, so every stack update replayed every custom resource regardless of whether its own properties changed — repeating non-idempotent side effects on an unrelated update. |
||
|
|
38176b9e05 |
feat(acm): provision AWS::CertificateManager::Certificate (#3003)
* feat(acm): provision AWS::CertificateManager::Certificate Adds AcmCfnProvisioner over the existing AcmService. Ref and Fn::GetAtt CertificateArn both resolve to the certificate ARN instead of the stub's literal "LogicalId.CertificateArn". Maps DomainName, SubjectAlternativeNames, ValidationMethod (default DNS), KeyAlgorithm and Tags; DomainValidationOptions is accepted and ignored because the certificate is ISSUED at once, there is nothing to validate locally. UpdateStack: a change to a createOnly property (DomainName, SubjectAlternativeNames, KeyAlgorithm) requests a new certificate and deletes the previous one; otherwise tags are reconciled in place. Delete tolerates an already removed certificate and lets ResourceInUseException propagate. Tests: AcmCfnProvisionerTest (attribute keys, update paths, delete), AcmCfnIntegrationTest (stack output is an ARN DescribeCertificate finds, gone after DeleteStack). Inventory TSV, fixture wiring and the generated resource-type table updated. * fix(acm): remove the replacement certificate when the prior one cannot be deleted On a replacing update, a failure deleting the previous certificate (ResourceInUseException, for one) made the update fail after the new certificate existed. CloudFormationService restores the previous StackResource on a failed update and never learns the new ARN, which orphaned that certificate. Delete it and mark the resource restored for the rollback walker, as Route53CfnProvisioner does for zones. Also pins that a ValidationMethod-only update keeps the certificate: the property is writeOnly in the registry schema and "No interruption" in the AWS docs, and ACM has no call to change it on an issued certificate. |
||
|
|
de92212b1b | fix(codebuild): resolve project ARNs in batch lookup (#2999) | ||
|
|
06349c8d88 |
fix(apigateway): enforce AWS_IAM authorization on the execute-api data plane (#2895)
A method (REST) or route (HTTP API) with authorizationType AWS_IAM was recorded but never enforced, so an unsigned request reached the integration as if it were NONE. ExecuteApiSigV4Authorizer now verifies the caller's signature over the request as it arrived, for both the Authorization header and the presigned query string, and surfaces the verified caller on the proxy event: requestContext.identity on REST, requestContext.authorizer.iam on HTTP API. The signature must cover host, and expired or inactive credentials are rejected. Temporary credentials must also present the session token STS issued with them, compared against the value the session store records since #2912. Authentication only: execute-api:Invoke is not evaluated against IAM policies. Closes #2810 Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> |
||
|
|
69e8bf1ac3 |
fix(kms): validate KeyUsage against KeySpec on CreateKey (#2787) (#3004)
* fix(kms): validate KeyUsage against KeySpec on CreateKey (#2787) * test(kms): boto3 coverage for CreateKey KeyUsage rejection (#2787) |
||
|
|
e26e9a68fd |
fix(rds): use MySQL 8.4 auth options (#3001)
* fix(rds): use MySQL 8.4 auth options * fix(rds): reject unsupported MySQL images * fix(rds): validate caching SHA-2 auth |
||
|
|
ffe8a92635 |
perf(build): replace BouncyCastle with JDK crypto API as much as possible (#2988)
* perf(security): stop registering the BouncyCastle JCE provider ACM signs through the JDK and builds PBES2 there, and KMS PSS uses RSASSA-PSS with the parameters AWS specifies. Downsize Docker image from 88.7 to 83.9 MB gzipped. * test(compat): verify the native image's KMS and ACM crypto from outside Floci Floci verifying its own signature proves nothing. Signatures now check against GetPublicKey with an outside library, exported keys are decrypted, and issued certificates verify their own signature. * fix(kms): apply real PSS padding when signing a digest with RSASSA_PSS * fix(acm): set the PBES2 salt and iteration count explicitly * perf(kms): reuse the shared SecureRandom when signing a PSS digest * fix(kms): let AwsException pass through the sign and verify catch blocks * perf(native): drop the native-image config the BouncyCastle provider needed Five --initialize-at-run-time entries and 21 reflect-config entries existed for the BouncyCastle JCE provider. Nothing registers that provider any more, so they only kept dead initialization code in the image. The run-time initialization entries are what cost size. Removing them takes the binary from 204.6 to 203.1 MB and gzip -9 from 79.5 to 78.9 MB. The reflect-config entries measured as noise, because those classes stay registered through another path, but they still describe a provider Floci no longer installs. Verified on a native build. The Python suite passes 354 tests, the Java SDK suite passes 61 including CloudHSM v2 and ACM, and a TLS run generates its self-signed certificate and signs with secp256k1 over HTTPS. |
||
|
|
17e02edad9 |
feat(dynamodb): resource policies and GSI-level OnDemandThroughput (#2976)
PutResourcePolicy/GetResourcePolicy/DeleteResourcePolicy previously fell through to the default 400 UnknownOperationException branch, and a GSI created with an explicit OnDemandThroughput never stored the value, so DescribeTable could not report it back. Both block the Terraform provider: aws_dynamodb_resource_policy fails at apply, and an on-demand GSI shows phantom drift on every plan. Policies live on TableDefinition with an opaque RevisionId honoring ExpectedRevisionId on Put/Delete (PolicyNotFoundException on mismatch or absence); the GSI parse/emit mirrors the existing table-level OnDemandThroughput handling. |
||
|
|
6c9cc95d54 |
feat(elasticache): add validation for cache parameter group existence in replication group operations (#2957)
Signed-off-by: Matheus André <matheusandr2@gmail.com> |
||
|
|
17ea9a9aac |
feat(redshift): rewrite Redshift table DDL keywords for a PostgreSQL backend (#2947)
* feat(redshift): rewrite Redshift table DDL keywords for a PostgreSQL backend * fix(redshift): isolate DDL rewrites per statement in multi-query batches * fix(redshift): mask dollar-quoted literals to prevent unintended rewrite of DDL fragments * fix(redshift): support arbitrary dollar quote tags in literal masking * fix(redshift): support column constraints following distkey and sortkey |
||
|
|
8440e201e1 |
refactor(ses): extract the identity domain into SesIdentityService (#2984)
* refactor(ses): extract the identity domain into SesIdentityService * fix(ses): persist identity mutations under the request-derived key |
||
|
|
ad0f4a1613 |
fix(sqs): honour ReceiveMessageWaitTimeSeconds when ReceiveMessage omits WaitTimeSeconds (#2989)
* fix(sqs): honour ReceiveMessageWaitTimeSeconds when ReceiveMessage omits WaitTimeSeconds ReceiveMessage treated a missing WaitTimeSeconds as 0 and returned immediately, ignoring the queue's ReceiveMessageWaitTimeSeconds attribute. AWS applies that attribute as the default wait, and only an explicit WaitTimeSeconds in the request overrides it, so consumers that enable long polling on the queue were short polling against Floci. Both protocol handlers now pass -1 when the parameter is absent, and the service resolves the wait from the queue attribute, mirroring the existing VisibilityTimeout fallback. CreateQueue stores the AWS default of 0 so GetQueueAttributes reports the attribute like AWS does. * fix(sqs): reject ReceiveMessage WaitTimeSeconds outside 0 to 20 An explicit negative or non-integer WaitTimeSeconds was parsed to the "omitted" sentinel and inherited the queue's long poll instead of failing. Carry the parameter as a nullable Integer, reject malformed values at the protocol boundary and out-of-range values in the service with InvalidParameterValue, and cap the queue attribute fallback at the AWS maximum of 20 seconds. * fix(sqs): reject fractional WaitTimeSeconds on the SQS JSON protocol canConvertToInt() accepts fractional JSON numbers such as 1.5, which asInt() then truncated before the range check, so a malformed request ran as a one second poll instead of failing with InvalidParameterValue. Signed-off-by: Kurt McAlpine <kurt.mcalpine@halter.co.nz> --------- Signed-off-by: Kurt McAlpine <kurt.mcalpine@halter.co.nz> |
||
|
|
4bf17a1fe2 |
fix(cognito): fail listUsers/listUserPoolClients on an absent user pool (#2962)
listUsers scanned its store by a "{poolId}::" prefix and
listUserPoolClients by a userPoolId field, neither of which touched
poolStore, so a pool id that does not exist was indistinguishable from
an empty pool: both returned 200 with an empty list instead of
ResourceNotFoundException. list-groups and list-resource-servers
already resolved the pool via describeUserPool and were correct;
this brings the other two list actions in line with them and with
real Cognito, where all four behave identically.
Fixes #2952
|
||
|
|
262495df67 |
fix(dynamodb): reject unused ExpressionAttributeNames/Values on PutItem, DeleteItem, Scan, Query (#2923)
* fix(dynamodb): reject unused ExpressionAttributeNames/Values on PutItem, DeleteItem, Scan, Query The checkUnusedEan / checkUnusedEav helpers were only wired into handleUpdateItem and (names only) handleQuery, so PutItem, DeleteItem and Scan accepted expression attribute entries not referenced by any expression and performed the operation, where AWS returns ValidationException. Query accepted unused values for the same reason. Wire both helpers into handlePutItem, handleDeleteItem and handleScan, and add the missing checkUnusedEav call to handleQuery, each checking against the tokens actually referenced by that operation's expressions. Closes #2893 * fix(dynamodb): also reject unused EAV on legacy KeyConditions + FilterExpression Query Addresses PR review: the unused ExpressionAttributeNames/Values check in handleQuery was gated on KeyConditionExpression != null, so a Query combining legacy KeyConditions with FilterExpression skipped it. Widen the guard to fire whenever any expression parameter (KCE, FilterExpression, ProjectionExpression) is present, and add an integration case for the mixed path. Also replace an em dash in the new test comment per repo style. * test(dynamodb): reference the aliased name in the reserved-word conformance case The sdk-test-node "reserved word aliased via ExpressionAttributeNames passes" case supplied ExpressionAttributeNames {#st: status} on a PutItem whose ConditionExpression (attribute_not_exists(pk)) never referenced #st. Real AWS — and now Floci, per #2893 — rejects unused ExpressionAttributeNames entries with ValidationException. Point the ConditionExpression at #st so the alias is actually used; the reserved-word aliasing behaviour under test is unchanged. * fix(dynamodb): run Query unused EAN/EAV check unconditionally Addresses PR review: the previous guard (keyConditionExpr || filterExpr || projectionExpression) still let a legacy KeyConditions Query carrying a stray ExpressionAttributeNames/Values map through without validation. Drop the guard so the checks always run; the token sets are still derived only from the expressions that can legitimately reference those maps, so a correct request is unaffected. Add an integration case for legacy KeyConditions with no expression parameter. * test(dynamodb): reference the aliased name in the sdk-test-java reserved-word case Mirror of the sdk-test-node fix: reservedWordWithAliasPasses supplied an unused ExpressionAttributeNames {#st: status} on a PutItem whose ConditionExpression referenced pk, which #2893 now correctly rejects. Point the condition at #st. * fix(dynamodb): AWS "can only be specified when using expressions" wording for PutItem/DeleteItem Addresses PR review: when ExpressionAttributeNames/Values is supplied with no expression parameter at all, this PR's new checkUnusedEan/checkUnusedEav calls reported "Value provided in ExpressionAttributeNames unused in expressions: keys: {...}". Real AWS answers that sub-case with "<param> can only be specified when using expressions: ConditionExpression is null" instead. Add rejectExprAttrsWithoutExpression, parameterised on the null-expression message, and wire it into handlePutItem and handleDeleteItem ahead of the unused-alias checks. Both operations only accept ConditionExpression, so the named param is unambiguous; the wording matches the pre-existing PutItem+EAV guard from #826. EAV is checked before EAN to preserve that guard's order. Scan and Query still return the "unused in expressions" 400 for this sub-case: those ops accept multiple expression parameters and AWS's exact wording there is unverified. The helper is parameterised so it is a one-line change per op once the strings are measured. |
||
|
|
732e009207 |
fix(ecr): clean up registry storage (#2982)
Remove every manifest for a forced repository deletion and reclaim the shared registry volume only when storage pruning is configured. |
||
|
|
906717a510 |
feat(cognito): implement SetUserPoolMfaConfig (#2831)
* feat(cognito): implement SetUserPoolMfaConfig
The action was unrouted, so the dispatcher answered UnsupportedOperation
and any caller configuring pool MFA failed. GetUserPoolMfaConfig already
existed but reported only MfaConfiguration, so a software-token setting
could not round-trip even once it could be set.
SetUserPoolMfaConfig now stores the MFA mode and the software-token
setting, and both actions answer with the shape measured on the live
service: only configured factors appear, so SoftwareTokenMfaConfiguration
is omitted until it is set.
SMS, email and WebAuthn MFA are accepted and deliberately not stored —
Floci has no path to deliver those factors, and retaining the config
would claim a capability that does not exist.
* test(cognito): cover MFA configuration through the AWS SDK
The integration test drives the endpoint over raw HTTP, so nothing
exercised the new action through a real SDK client. Adds coverage for
the three cases that matter to a caller: an unconfigured pool reports
OFF with no software-token member, a set round-trips through Get, and an
invalid MfaConfiguration is rejected.
* fix(cognito): follow the measured SetUserPoolMfaConfig semantics
Three behaviours were taken from the API reference and turned out wrong
when measured against the live service:
- an absent MfaConfiguration means OFF, not "leave the current mode
alone", so a pool set to OPTIONAL is reset by a request that omits it
- turning MFA off drops the factor configuration with it; the service
answers OFF alone afterwards
- sending a factor while the effective mode is OFF is rejected with
"can't turn off MFA and configure an MFA together"
The enum in the validation message is also ordered [OPTIONAL, OFF, ON],
as the service emits it. Two tests asserted the previous guesses and
passed, which is how a guess becomes apparent evidence; both now pin the
measured behaviour.
* fix(cognito): apply the MFA factor rules to email and SMS, not just the software token
Review flagged that a request combining an effective OFF mode with
EmailMfaConfiguration or SmsMfaConfiguration was accepted, since only
SoftwareTokenMfaConfiguration was read. Measured against the live
service, and the finding holds for email and SMS but not for WebAuthn:
- OFF + EmailMfaConfiguration is rejected with the same message as
OFF + SoftwareTokenMfaConfiguration
- OFF + WebAuthnConfiguration returns 200 and echoes the block back
- the rule fires on the member being present, not on Enabled: OFF
alongside SoftwareTokenMfaConfiguration{Enabled:false} is rejected
The same pass turned up the mirror rule, which was also missing: ON or
OPTIONAL with none of the three factors present is rejected with
"SMS MFA, Email MFA, or Software Token MFA must be enabled". Despite
that wording it is again presence, not value - ON alongside
SoftwareTokenMfaConfiguration{Enabled:false} is accepted - and WebAuthn
does not satisfy it, so it sits outside both rules in both directions.
One existing test set ON with no factor at all, which the live service
refuses; it now sends a factor.
* test(cognito): read the MFA config tests in their execution order
The methods were laid out 1, 2, 3, 4, 5, 8, 6, 10, 7, 9, 11, 12, 13, an
artifact of adding cases across three review rounds. The chain is stateful,
so a reader following the pool through it had to jump around the file.
Pure move: the methods are reordered to match their @Order values, no
annotation value and no test body is changed, so the execution order is
exactly what it was.
* chore(cognito): drop the em-dashes this branch introduced
AGENTS.md asks for none in any content. Seven had leaked into the MFA
prose: the docs table row, two service comments, the handler javadoc and
two in the test class. Replaced with colons and commas, no wording change
beyond the punctuation.
Pre-existing em-dashes elsewhere in these files are left alone.
* revert: "chore(cognito): drop the em-dashes this branch introduced"
This reverts commit
|
||
|
|
c30ca8fb5f |
fix(cognito): name missing user pools in errors (#2936)
* fix(cognito): name missing user pools in errors * test(cognito): address missing pool review |
||
|
|
14ca62d9f7 |
feat(ecs): honor UpdateService forceNewDeployment and emit EventBridge lifecycle events (#2938)
* feat(ecs): honor UpdateService forceNewDeployment (#2557) * feat(ecs): add EcsEventPublisher for aws.ecs lifecycle events (#2557) * feat(ecs): emit ECS Task State Change events on task start/stop (#2557) * feat(ecs): emit ECS Deployment State Change events (#2557) * test(ecs): end-to-end ECS EventBridge lifecycle events + docs (#2557) * fix(ecs): log diagnostic when task ARN region parse fails (#2557) * fix(ecs): synthesize lifecycle events from a task snapshot, not the shared instance emitTaskLadder toggled the live task's lastStatus in place to synthesize each phase, so a concurrent DescribeTasks/ListTasks could observe a status the task never actually occupied while the four-phase ladder was in flight. Build the ladder from a shallow copy instead. Also bump the ARN region-parse fallback log from debug to warn, since debug is off by default and made the fallback effectively invisible. |
||
|
|
58b2e5ff96 |
fix(dynamodb): name the table in the ResourceNotFoundException message (#2929)
Every table lookup returned a bare "Requested resource not found", omitting the
table name that real AWS includes. DynamoDB is the service most people exercise
first and error-text assertions are common in its test suites, so the mismatch
tends to surface in the first hour rather than late.
The expected text is not settled by the botocore model, which declares only a
message member with no template. It comes from AWS's own SDK tests: the
aws-sdk-js-v3 DynamoDB e2e spec asserts "Requested resource not found: Table:
DynamoDB not found", and aws-sdk-ruby's client.feature asserts the same shape
against a real endpoint. moto composes the identical string.
resourceNotFoundException already accepted the table name and discarded it. All
fifteen call sites are table lookups, so interpolating in the helper is correct
for every caller and matches findTableByArn, which already names the resource it
failed to find. That method keeps its ARN-shaped message because it resolves by
ARN rather than by name.
Verified on the wire: DescribeTable on a missing table now returns
{"__type":"ResourceNotFoundException","message":"Requested resource not found:
Table: nope not found"}. No test asserted the old text, and the DynamoDB suites
stay green at 1362 tests.
|
||
|
|
812911fd03 |
feat(ses): support tag operations on tenant ARNs (#2832)
* feat(ses): support tag operations on tenant ARNs * fix(ses): shield the stored tenant record from tag-callback mutation * test(ses): cover the cross-region guard for tenant TagResource/UntagResource * docs(ses): drop em dashes from the tenant tag additions |
||
|
|
5dc0808bda |
feat(cloudformation): report a stubbed unsupported resource type instead of hiding it (#2971)
An unsupported resource type was stubbed at debug, so the stack reached CREATE_COMPLETE and a green stack did not prove its resources existed. The stub is now reported at warn, naming the type, and the resource carries a status reason saying nothing was created, which DescribeStackEvents returns. A new floci.services.cloudformation.allow-stub-unsupported-resource-types setting (default true) turns the stub into a stack failure for suites that need a green stack to mean every resource exists. An unexpanded SAM resource type warns on its own, and the delete path names the physical id it does not remove. Closes #2967 |
||
|
|
9e2c03158d |
fix(cloudformation): persist FunctionResponseTypes on Lambda::EventSourceMapping (#2964)
provisionLambdaEventSourceMapping never read the FunctionResponseTypes property, so a CFN-provisioned mapping always came back with an empty list even when the template declared it, unlike the direct CreateEventSourceMapping path. Partial batch responses were therefore ignored for CFN-deployed SQS to Lambda mappings. The property is resolved the way the arm's other array properties are, through resolveStringList, and the integration test pins the persisted value. Fixes #2848 |
||
|
|
8c2619f965 |
fix(cloudtrail): serialize trail mutations to prevent lost updates (#2911)
AddTags, RemoveTags, UpdateTrail, PutEventSelectors, StartLogging and StopLogging all did an unlocked get-then-put of the whole CloudTrailEntry, so two overlapping mutations of the same trail could silently drop one another's change. Every trail mutation's read-modify-write now goes through withTrailLock, a per-trail-key mutex built on ConcurrentHashMap#compute's per-key atomicity; the remapping function runs the mutation and returns null, so no bookkeeping entry accumulates per trail. UpdateTrail reads its merge basis inside the lock and raises TrailNotFoundException if the entry is gone by the time it acquires it. CreateTrail stays unlocked, matching AwsConfigService. Closes #2904 |
||
|
|
44655751c6 |
feat(bedrock-runtime): implement ConverseStream for stub and proxy backends (#2889)
Both backends now emit the real application/vnd.amazon.eventstream framing Bedrock SDK clients expect: a messageStart/contentBlockDelta/contentBlockStop/ messageStop/metadata event sequence, framed with the same AwsEventStreamEncoder helper already used by S3 Select and Kinesis SubscribeToShard. The proxy backend posts to /chat/completions with stream:true (matching Converse) and translates the OpenAI SSE response into Bedrock stream events, including basic tool-call accumulation. A response - streaming or not - that never produces real completion content surfaces as a ModelErrorException instead of a fabricated empty success: - ConverseStream: no usable SSE chunks, chunks that only carry role/usage/ finish_reason with no text or tool_calls, a stream that ends without a finish_reason or "[DONE]" (truncated mid-generation), or a tool_calls fragment missing its id/name or with arguments that never form valid JSON. - Converse: a 2xx response with no choices at all. |
||
|
|
342f58b2b7 |
fix(glue): populate CatalogId on GetDatabase and GetDatabases (#2814)
* fix(glue): populate CatalogId on GetDatabase and GetDatabases The Glue database responses never set CatalogId, so terraform-provider-aws built the aws_glue_catalog_database resource id as ":name" and failed with "unexpected format for ID, expected catalog-id:database-name". Resolve it per request from the caller's account, matching the convention LakeFormationService already uses, rather than persisting it with the database, so existing stores need no migration. Refs #2793 * fix(glue): set CatalogId at write time, backfill legacy rows on read Addresses review feedback: populating CatalogId on the read path mutated the Database instance owned by the store, so a GetDatabase call could persist a request-derived value. Set it when the database is created or updated instead. Reads only fill it in for rows persisted before the field existed, which is stable because the store is namespaced by account -- the same migrate-on-read AccountAwareStorageBackend already does for un-prefixed keys. |
||
|
|
1528c65df3 |
fix(cloudformation): keep a generated physical name across stack updates (#2788)
provision runs again on every UpdateStack. Seven provisioners generated a fresh random name unconditionally, so an update created a second resource and left the first behind with its data while the stack's physical id moved to the new, empty one. For these types the name is a createOnlyProperty, so an unchanged template must keep its physical id. ProvisionContext.stablePhysicalName encapsulates the rule: the template's name, else the name the resource already had, else a generated one. S3::Bucket, SSM::Parameter, ECR::Repository, Pipes::Pipe, KinesisFirehose::DeliveryStream and CloudWatch::Alarm use it. SNS cannot: a topic's physical id is its ARN, so the prior name is read back from the TopicName attribute instead. A stable name means the second UpdateStack reaches the create API with a name that already exists, so the provisioners whose service rejects a duplicate now reconcile instead of creating. ProvisionContext.reusesPriorEntity answers whether the derived name is the entity the resource already had; it is deliberately not isUpdate, because a replacing update also carries a prior id but under a new name and must still create. Firehose goes to UpdateDestination, Pipes to UpdatePipe, S3 skips CreateBucket (idempotent only in us-east-1, BucketAlreadyOwnedByYou elsewhere), and ECR reconciles the repository it owns. The reconcile paths drive tags to the template's desired state: neither UpdateDestination nor UpdatePipe carries tags and a tag call alone never removes one, so dropped keys are untagged before the desired set is applied, as the registry schemas' update handlers declare. ECR no longer adopts a repository whose name is already taken: a create on a colliding name fails with RepositoryAlreadyExistsException as on CloudFormation (a CDK bootstrap re-run is an update of the existing CDKToolkit stack and stays on the reuse path), a template that drops its lifecycle or repository policy deletes the stored one, and a dropped ImageTagMutability resets to the MUTABLE default the API applies when the parameter is omitted. A Pipes update that changes the createOnly Source while reusing the name is refused with ValidationError. CfnStableNameUpdatePathTest provisions each type twice and pins exactly one create, the tag diff, the source rejection and the collision failure. AWS::SQS::Queue and AWS::Lambda::MicrovmImage share the original defect and are left for a follow-up. |
||
|
|
309043baf6 |
fix(eks): validate IAM authentication tokens (#2912)
Reject forged, expired, and cross-cluster EKS authentication tokens before granting cluster-admin access. |
||
|
|
3d2b8828ad |
fix(lambda): honour the CodeSha256 precondition on PublishVersion (#2939)
* fix(lambda): honour the CodeSha256 precondition on PublishVersion CodeSha256 is documented as a precondition: "only publish a version if the hash value matches the value that's specified". The controller parsed only Description out of the request body, so the field never reached the service and a publish that should have been rejected succeeded and produced a version. A caller that raced someone else's deploy published code it had never authorised, with nothing to say so. A mismatch is now InvalidParameterValueException carrying the message shape AWS uses, and no version is created. The check sits inside the lock UpdateFunctionCode takes, so the hash cannot be validated against one state of $LATEST and the snapshot then taken from another. Opt in: a request without the field behaves exactly as before, which omittingCodeSha256StillPublishes pins. Part of #2822; the unchanged-publish half follows separately because it changes behaviour for existing callers. * fix(lambda): close the CodeSha256 race and reject malformed preconditions Two gaps found in review of the precondition itself. The check was not atomic with UpdateFunctionCode. The earlier claim that it sat inside that lock was wrong: extractZipCodeBytes sets codeLocalPath, codeSizeBytes and codeSha256 with no lock held, and the only synchronized block in there wraps an unrelated legacy-directory cleanup further down. So PublishVersion holding its own lock serialised nothing, and a deploy landing between the hash matching and the snapshot being taken still published code the caller had not authorised. Make the writer take the lock. Hashing stays outside it, being pure computation on bytes already in hand, as does extraction to disk so a large package does not serialise unrelated work; only the fields that decide what a snapshot copies are published inside it. A malformed precondition also bypassed the check. {"CodeSha256": 12345} throws a ClassCastException into the body-parse catch, leaving the field null and indistinguishable from omitted, so the publish succeeded with 201. An unparseable body behaved the same way. Both are now 400: field extraction rejects a wrong JSON type rather than letting the cast fail silently, and a body that cannot be parsed is an error rather than an empty request. * fix(lambda): reject a null JSON body on PublishVersion A body of literal "null" is valid JSON that parses cleanly to a null map, so it never reaches the parse-failure path and then threw a NullPointerException on the field reads, surfacing as a 500 rather than a 400. Guarded outside the try rather than inside it. Inside, the exception would be caught by that method's own catch and rewrapped as a parse failure, which it is not, giving "Could not parse request body: Request body must be a JSON object". * fix(lambda): compare a blank CodeSha256 rather than treating it as absent An isBlank() check short-circuited the whole condition, so an explicit empty or whitespace-only CodeSha256 skipped the comparison and published without checking anything: the same present-but-malformed value behaving like an absent one that the rest of this branch addresses. The exclusion is simply removed, so an empty string is compared like any other value and fails as a mismatch. Rejecting it with a dedicated error would mean inventing an error shape for the empty case that has not been measured against the live service; a mismatch is one AWS demonstrably produces for a hash that does not match. |
||
|
|
97ce09f22a |
fix(lambda): replace the fabric8 kubernetes client with a plain REST client (#2919)
* fix(lambda): replace the fabric8 kubernetes client with a plain REST client quarkus-kubernetes-client was an always-on dependency, so the fabric8 client and its generated Kubernetes model classes were reachable in every native image regardless of whether floci.services.lambda.executor was ever set to kubernetes. That was the single largest contributor to a ~20% native image size increase last month (issue #2914). The kubernetes executor only ever needs a handful of plain REST calls (create/get/list/delete pods, create-or-update a ConfigMap, stream logs) against a plain JSON HTTPS API, the same shape Floci already talks to AWS in without an SDK. KubernetesApiClient replaces the fabric8 client with the JDK HttpClient (as FlinkRestClient already does for another container orchestrator's REST API), so the dependency is gone entirely rather than merely unused: it no longer appears anywhere in the packaged application, native or JVM. Connection resolution mirrors kubectl's for the common cases: in-cluster service account (token re-read per call since projected tokens rotate, CA loaded once), or a kubeconfig's current-context with a static bearer token or client-certificate/client-key (PKCS#8) credential. exec/auth-provider credential plugins (e.g. aws eks get-token) are not supported and fail with a clear error naming the limitation. LambdaPodSpecFactory now builds the pod manifest as a plain JSON tree instead of fabric8 builders. Tests keep using fabric8's kubernetes-server-mock as a fake API server (test-scope only, so it never reaches the shipped artifact) and point KubernetesApiClient at it over HTTP(S) instead of constructing a fabric8 client directly. * fix(lambda): support insecure-skip-tls-verify and drop stale test devservices config kubeconfig's insecure-skip-tls-verify (the common kind/minikube dev-cluster case) fell through to the default trust store and failed with a generic PKIX error instead of a named limitation like every other unsupported kubeconfig case. Honor it: skip both chain and hostname validation, matching kubectl. Verified against a real self-signed HTTPS server, both with and without the flag, so a regression here fails loudly. Also drops src/test/resources/application.yml's leftover quarkus.kubernetes-client.devservices block: with the extension gone from pom.xml that key is unrecognized config pointing at a dependency that no longer exists. |
||
|
|
671628b525 |
feat(cloudtrail): implement AddTags, RemoveTags and ListTags (#2934)
* feat(cloudtrail): implement AddTags, RemoveTags and ListTags CloudTrailJsonHandler dispatched none of the three tag actions, so any trail lookup went through the unsupported-action path — including the Terraform AWS provider's transparent-tagging ListTags call on every read of aws_cloudtrail, which broke refresh/plan/destroy for any state containing a trail regardless of whether it was tagged. Tags are tracked per-trail in CloudTrailEntry (not the wire-serialized Trail record, which AWS never includes tags on) and are resolved by ARN only, matching AWS's actual request shape for these three actions. An ARN that isn't a well-formed CloudTrail trail ARN raises CloudTrailARNInvalidException; a well-formed ARN with no matching trail raises ResourceNotFoundException, so a stale Terraform state entry surfaces as a real error instead of an empty tag list. Fixes floci-io/floci#2297 * fix(cloudtrail): omit Value from ListTags response for valueless tags AddTags only requires Key, so a tag can legitimately have no Value. listTags() was serializing that as an explicit "Value":null, but AWS omits absent optionals from the response entirely. |
||
|
|
39b19d1c92 |
refactor(config): move max-request-size and ecr-base-uri into sub-mappings (#2902)
floci.max-request-size and floci.ecr-base-uri sat at the config root but belong with related settings. Relocate them: - max-request-size -> floci.protocols.max-request-size (ProtocolsConfig) - ecr-base-uri -> floci.services.lambda.ecr-base-uri (LambdaServiceConfig) A new FlociConfigRelocationsInterceptor (SmallRye ConfigSourceInterceptor, registered via META-INF/services) keeps the old flat keys and their FLOCI_MAX_REQUEST_SIZE / FLOCI_ECR_BASE_URI env vars working: the legacy key is consulted when the new key is requested, and iterateNames() rewrites it so config-mapping validation does not flag it as unknown. Future relocations are one entry in its RELOCATIONS list. ImageResolver, both application.yml files, the affected tests and the configuration docs are updated to the new keys. |
||
|
|
3db883d003 |
fix(iam): resolve DynamoDB table ARN from request body for IAM enforcement (#2928)
* fix(iam): resolve DynamoDB table ARN from request body for IAM enforcement (#2925) * fix(iam): evaluate multi-table DynamoDB batch and transact requests per table * fix(iam): support table ARN resolution for DynamoDB PartiQL statements * fix(iam): handle quoted PartiQL table names with special characters * fix(iam): use DynamoDbPartiQLParser to extract table from PartiQL statements |
||
|
|
cf628ba2b9 |
fix(lambda): honour Qualifier on GetFunction and GetFunctionConfiguration (#2932)
* fix(lambda): honour Qualifier on GetFunction and GetFunctionConfiguration Both read paths ignored Qualifier and answered with $LATEST for everything, including versions that were never published. A caller pinning version 1 silently got whatever $LATEST held at the time, which defeats the immutability guarantee that is the point of publishing, and a read against a version that does not exist returned 200 instead of 404, so a typo or a stale alias looked live. Resolve the qualifier through the same target resolver the invoke path uses, so a qualifier means the same thing whether a caller reads it or runs it. That covers published versions, aliases, and an explicit $LATEST, and turns an unresolvable qualifier into the ResourceNotFoundException AWS returns. A qualifier may also ride on the name, as fn:1 or a qualified ARN. An explicit Qualifier and one carried on the name must agree; disagreeing is InvalidParameterValueException rather than a silent pick of one. Scoped to the read paths. The invoke path already resolves qualifiers, and the remaining invoke-side gap is the warm pool keying in #1988, which has an approved fix awaiting a rebase in PR #2028. Closes #2821 * fix(lambda): resolve aliases deterministically when reading, not by weight Routing a qualified read through the invoke resolver also inherited its alias behaviour. An alias carrying AdditionalVersionWeights shifts traffic, so pickAliasVersion chooses at random among the weighted versions, which is right for running a function and wrong for describing one: two reads of the same alias could report different versions. Split the resolver on how aliases resolve rather than copying it, so the two cannot drift. Invoke keeps the weighted pick; a read follows the alias's primary FunctionVersion, which is what AWS reports. |
||
|
|
c54b237cd8 | fix(ec2): include network metadata in instance type responses (#2943) |