mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 14:10:49 -05:00
225233c19256b4e62f7c43e0131d3cf5d2d263dd
1645
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
225233c192 |
chore(release): 2.0.1
## [2.0.1](https://github.com/floci-io/floci/compare/2.0.0...2.0.1) (2026-09-01)
### Bug Fixes
* **rds-data:** fixing empty array response from statement ([#2880](https://github.com/floci-io/floci/issues/2880)) ([
2.0.1
|
||
|
|
46283f3209 | fix(rds-data): fixing empty array response from statement (#2880) | ||
|
|
113c62b949 |
chore(release): 2.0.0
# [2.0.0](https://github.com/floci-io/floci/compare/1.7.0...2.0.0) (2026-09-01) * fix(stepfunctions)!: reject JSONata top-level references at definition time ([#2699](https://github.com/floci-io/floci/issues/2699)) ([2.0.0 |
||
|
|
ec97063362 |
docs: use x.y.z in the pinned image example (#2863)
Every emulator README pinned a concrete version in its compose example and every one had gone stale: 1.5.11 against 1.7.0, 0.5.0 against 0.7.0, 0.9.0 against 0.11.0, 0.1.0 against 0.3.0. The channel table directly above each example already writes the pinned channel as x.y.z, so the example now agrees with its own table and cannot drift again. The line above it, image: floci/floci:latest, stays copy-pasteable and is the recommended one; the pinned line reads as the pattern. |
||
|
|
2b4f39e4e6 |
ci: align the nightly schedule on 23:00 America/Chicago (#2862)
The four emulators targeted the same instant by two different routes, and three of the four header comments were wrong about it. All four now carry the same schedule block: cron '0 23 * * *' with timezone America/Chicago. For floci-gcp and floci-az this is a behavior change: they used a fixed '0 4 * * *' UTC, which holds 23:00 CT only in summer and slips to 22:00 CT once CST starts. The inline comment claiming it "shifts to 23:00 CST in winter" had the direction backwards. The header comment now also records that GitHub delays scheduled runs on low-activity repositories. Observed start times on this org range from 04:03Z to 15:55Z for the same nominal schedule, so the cron is a target rather than a guarantee, and aligning it does not make the four build simultaneously. |
||
|
|
19013b8b63 |
fix(ecs): apply cluster settings given on CreateCluster (#2845)
handleCreateCluster read clusterName and tags and nothing else, and EcsService.createCluster had no settings parameter, so settings sent at creation were dropped. Real AWS accepts them on CreateCluster itself, not only through UpdateClusterSettings, and handleUpdateClusterSettings two methods away already parses them the right way. The effect was permanent drift for any client that configures a cluster at creation. terraform-provider-aws sends its setting block on create, then reads DescribeClusters back without it and proposes the same change on every plan after apply, forever. Parse settings in the handler the way the update handlers do, and pass them through a new createCluster overload. The existing overloads delegate, so the CloudFormation caller is untouched. Closes #2806 |
||
|
|
90d1a19310 |
fix(elasticache): report transit encryption, not the auth-token flag (#2844)
TransitEncryptionEnabled was serialized as `authMode == PASSWORD` in both the replication-group and the member-cache-cluster views. An auth token does force encryption in transit, but the reverse does not hold: CreateReplicationGroup already accepts TransitEncryptionEnabled=true with no token and records it as AuthMode.IAM, and every read then reported that group as unencrypted in transit. Terraform's aws_elasticache_replication_group reads transit_encryption_enabled back on every plan, so such a group showed permanent drift. DescribeCacheClusters had a second, narrower version of the same problem: AtRestEncryptionEnabled was a hardcoded false on the member view, so it contradicted DescribeReplicationGroups about one group's own storage encryption. It now reports what the group stores, which is the value CreateReplicationGroup already parsed and kept. |
||
|
|
ca4c84c9e0 |
fix(lambda): delete only the named version when DeleteFunction has a Qualifier (#2824)
* fix(lambda): delete only the named version when DeleteFunction has a Qualifier DeleteFunction accepted a Qualifier and dropped it: the controller never bound the query parameter, so every call took the unqualified path and removed the function, $LATEST and every other version. A caller pruning one old version silently lost the whole function, with a success response and no warning. The qualified path now removes that version alone. Error behaviour follows the live service rather than the reference, which documents none of it: deleting $LATEST by qualifier and naming an alias are both InvalidParameterValueException, a version an alias references is a ResourceConflictException, and a version that does not exist is a silent success rather than a 404. Closes #2819 * test(lambda): cover qualified DeleteFunction through the AWS SDK The integration test drives the endpoint over raw HTTP, so nothing exercised the qualified delete through a real SDK client. Adds SDK coverage for the four cases: deleting one version leaves the function and its other versions, $LATEST cannot be deleted by qualifier, a version an alias references is refused, and an absent version is a no-op. * fix(lambda): pattern-validate the DeleteFunction qualifier Character.isDigit accepts non-ASCII decimal digits, so a full-width or Arabic-Indic digit was read as a version number and answered with a silent 204 instead of being rejected. The live service pattern-validates the qualifier before anything else and its constraint is ASCII-only; that check now runs first, and the digit test no longer relies on Character.isDigit. |
||
|
|
7473c57720 |
fix(ses): return DeliveryOptions from v1 DescribeConfigurationSet (#2841)
PutConfigurationSetDeliveryOptions already persisted the TLS policy — v2 GetConfigurationSet returned it correctly — but the v1 projection never read it back, omitting the DeliveryOptions member even when deliveryOptions was named in ConfigurationSetAttributeNames. The Terraform provider reads aws_ses_configuration_set through the v1 DescribeConfigurationSet, so the missing member made every plan re-add a delivery_options block that apply never converged. The two APIs spell the enum differently and the write path already normalises v1 Require/Optional to the stored REQUIRE/OPTIONAL; the read path converts back, so each API answers in its own casing. |
||
|
|
10ce6be8cd |
docs: state the release cadence in CONTRIBUTING and the docs site (#2850)
* docs: state the release cadence in CONTRIBUTING and the docs site Follow-up to the release-train documentation. CONTRIBUTING described how a release is cut but never when, and the published contributing page said nothing about releases at all, so the cadence was only discoverable from the README. - CONTRIBUTING: the 1st and 3rd Tuesday train leads the release section, and merging to main is stated not to cut a release. - docs/contributing.md: a Releases section, including why the commit type matters, since semantic-release derives the version from it. - docs/configuration/docker-images.md: the Channel table said release images publish "on every release", which explained nothing; it now names the train. Three corrections in the same table, all pre-existing: - The nightly row said 22:00 CT. nightly.yml is cron '0 23 * * *' pinned to America/Chicago, and observed runs land at 04:0x UTC, so it is 23:00 CT. - Dated nightly tags were described as fixed and never moving. The workflow accepts workflow_dispatch and pushes unconditionally, so a same-day rerun republishes that day's tag. Reproducibility is a release-tag property. - The pinned example was 1.5.11, six minor versions behind. Em-dashes in the touched files replaced with ordinary punctuation, per the documentation style rule in AGENTS.md. * docs: correct three points raised in review - Nightly availability was overstated. A merge after the nightly workflow starts misses that run, so the text no longer promises "that night's" image; it says the change reaches nightly on the next nightly build. - The published contributing page called CHANGELOG.md never hand-edited, omitting the changelog-edit label that the root CONTRIBUTING documents as the route for a genuine correction. - docker-images.md recommended 1.7.0 in the channel table while its Quick Reference still pinned 1.5.11. Each was fixed in all four emulators, not only where it was flagged. |
||
|
|
10a70ba16e |
docs: document the release train and lead with the four-cloud family (#2849)
* docs: document the release train and lead with the four-cloud family State the stable cadence, the 1st and 3rd Tuesday of each month, beside the existing tag matrix, with the nightly channel as the between-trains answer. The cadence appeared in no README, docs page, CONTRIBUTING or workflow, so an evaluator reading the releases page saw a release count with no schedule behind it. Promote "Any Cloud. Locally." to the header and add the four-cloud family table to the opening section, reusing the pattern floci-oci already carries: this README linked to none of the other three emulators. Point at the LocalStack migration section from the opening paragraph. It was written and accurate but sat below Testcontainers, where the reader it is aimed at never reached it. Replace every em-dash with ordinary punctuation, and record that rule in AGENTS.md so it holds for later edits. * docs: remove the em-dashes from AGENTS.md itself The Documentation Style section states an absolute ban while the rest of the file still used em-dashes, so the guide contradicted its own rule. Definition bullets and headings take colons, two-clause sentences become two sentences, and parenthetical pairs become commas. Inside fenced blocks the dash is a column separator, so it becomes a colon: one character for one character, leaving the hand-aligned annotation blocks untouched in width. * docs: do not call the dated nightly tags immutable nightly.yml derives the tag from the Chicago date and also accepts workflow_dispatch, and the push step is unconditional, so a same-day manual run or rerun rebuilds from the then-current tip of main and overwrites the same nightly-mmddyyyy tag. The tag names a night's build; it does not guarantee the bytes behind it. Reproducibility belongs to the pinned version tags, which the surrounding tag guidance already points at. |
||
|
|
44629631ca |
fix(lambda): honour ListLayers and ListLayerVersions query parameters (#2817)
* fix(lambda): honour ListLayers and ListLayerVersions query parameters CompatibleRuntime, CompatibleArchitecture, MaxItems and Marker were accepted and ignored, and NextMarker was never emitted, so a client paginating with MaxItems saw a single page and silently got the whole list, while a runtime or architecture filter returned layers that do not match it. Both actions now filter, paginate and emit NextMarker. Validation follows the live service rather than the API reference: range and enum failures accumulate into one ValidationException in a fixed member order, a non-integer MaxItems is a SerializationException that short-circuits validation, and a Marker the service did not issue is InvalidParameterValueException "Invalid pagination key.". Under a filter, LatestMatchingVersion is the newest version that matches rather than the newest overall, so ListLayers needs every version of each layer rather than the latest of each. Closes #2808 * fix(lambda): sign layer pagination markers The tag identifying a Marker as Floci's was a fixed string, so a caller could base64 a cursor of their own with the same prefix and have it accepted. That cursor was then applied to the page, silently skipping results or emptying the list where AWS rejects an unissued token. Markers now carry an HMAC over the cursor, keyed per process, so a fabricated or edited token fails the check. A marker from an earlier run is stale for the same reason, which is what AWS does with an expired one. * test(lambda): cover layer listing parameters through the AWS SDK AGENTS.md prefers SDK clients over raw HTTP for management-plane validation. The integration test covers the parameters through the wire protocol; this adds the same filtering, pagination and enum rejection through @aws-sdk/client-lambda, so a marshalling regression that only the SDK would notice does not pass unseen. |
||
|
|
afe26c6ad1 |
fix(elb): route Classic (v1) requests to a dedicated handler instead of ELBv2 (#2619)
* feat(elb): implement Classic (v1) Elastic Load Balancing Classic ELB (2012-06-01) and ELBv2 (2015-12-01) share an endpoint host and an `elasticloadbalancing` credential scope, but they are different APIs. Every Classic request was reaching the ELBv2 handler, which rejected a well-formed one with `ValidationError: Name is required for load balancer.` — because the name arrived as `LoadBalancerName`, the Classic parameter — and answered a request that guessed `Name` with an ALB object in the 2015-12-01 namespace, a shape Classic has no concept of. Route on the API version. Every Query-protocol request carries the version it speaks as the `Version` form parameter, and both service models declare it, so that is the discriminator: 2012-06-01 to the new Classic handler, 2015-12-01 to ELBv2. This is the same in-case split the `rds` scope already uses to separate RDS, Neptune and DocumentDB. Requests that omit `Version` fall back to their parameter shape — an action unique to one API, else `LoadBalancerName` / `LoadBalancerNames` selecting Classic, else ELBv2 as before. Classic state is its own model, not the v2 one: keyed by name, no ARN, listeners inline, and one structured attribute record. Responses follow the 2012-06-01 model's wrapper and element names — `CreateLoadBalancerResult` carries `DNSName` and nothing else. Scope is what the AWS provider drives for `aws_elb` and for an Auto Scaling group attached to one: Create/Delete/DescribeLoadBalancers, the listener operations, ConfigureHealthCheck, Register/DeregisterInstances, DescribeInstanceHealth, Modify/DescribeLoadBalancerAttributes, the subnet, availability-zone and security-group operations, and tagging. The stickiness and backend-server policy operations, and SetLoadBalancerListenerSSLCertificate, answer `UnsupportedOperation` in the 2012-06-01 namespace rather than a fabricated result. There is no Classic data plane: listener ports are recorded but no socket is opened. Health is checked per instance from the single `HealthCheck.Target` string — `HTTP:`/`HTTPS:` probed with a request, `TCP:`/`SSL:` by connecting — with the same counters and thresholds ElbV2HealthChecker uses. An ASG naming Classic load balancers in `LoadBalancerNames` now registers and deregisters its instances with them, so a `min_elb_capacity` wait can be satisfied. * docs(elb): register ElbClassicQueryHandler in services.yaml Unblocks 'make docs-check', which fails on rebase without this — the handler was never registered when the Classic ELB feature landed. * fix(elb): register ElbClassicService for native init, deregister stale ASG instances from Classic ELBs ElbClassicService's SecureRandom field wasn't declared under --initialize-at-run-time, which fails GraalVM native image builds (image-heap Random instances have cached seeds). Registers it alongside the other services/*.Service entries in application.yml. Also closes a gap Greptile flagged: removeStaleInstances() pruned an ASG's dead instance references without deregistering them from target groups or named Classic load balancers first, unlike the terminating- and scale-in paths, leaving orphaned registrations visible through DescribeLoadBalancers/DescribeInstanceHealth. * fix(elb): return the documented 409 for a Classic multi-VPC subnet set CreateLoadBalancer's own Errors table puts InvalidConfigurationRequest at HTTP 409; the Classic path raised it at 400. The error code was already right, so a client that retries on 409 but fails hard on 400 got the wrong signal from the one place the two can be told apart. Covered by a unit test that asserts the status, not just the code. Also from review: the empty-Listeners ValidationError carried a message copied from an unrelated subnet/AZ check, and the new cross-reference to the Classic docs page split elb.md's opening sentence mid-paragraph instead of following it. |
||
|
|
a7b2b79492 |
fix(lambda): honour Publish on CreateFunction and UpdateFunctionCode (#2825)
The Publish flag was never read on either path, so no version was ever created unless the caller made a separate PublishVersion call, and both actions reported Version as $LATEST. Terraform reads Version and qualified_arn straight from that response, so every aws_lambda_function with publish = true recorded $LATEST — which Lambda@Edge cannot use. Both actions now publish and report the new version. The ARN they return differs, following the live service rather than the reference, which does not distinguish them: CreateFunction keeps the unqualified FunctionArn while UpdateFunctionCode returns the qualified one, as PublishVersion does. Closes #2820 |
||
|
|
3aaf74520e |
fix(cognito): enforce user pool password policies (#2070)
* fix(cognito): enforce user pool password policies Closes #2066 * fix(cognito): close remaining password-policy review gaps on #2066 Addresses the three items left open on this PR's review: - Password reuse now raises PasswordHistoryPolicyViolationException instead of InvalidPasswordException, matching the shape AWS declares for it on AdminSetUserPassword, ChangePassword, ConfirmForgotPassword, RespondToAuthChallenge and AdminRespondToAuthChallenge (all funnel through updateUserPassword here). - Fixed the off-by-one in PasswordHistorySize: AWS counts the current password as one of the n, so only n-1 prior passwords are blocked alongside it, not n. Both the check and what gets retained in history are corrected together. - adminResetUserPassword no longer bypasses PasswordHistorySize: it now archives the outgoing password hash before clearing it, the same way an ordinary password update does. - CreateUserPool now fills in AWS's per-field password policy defaults (MinimumLength 8, all four character-class requirements, Temporary- PasswordValidityDays 7) for any field left unset in a supplied PasswordPolicy. Deliberately scoped to a policy that is present but partial, not to a pool with no PasswordPolicy at all -- every other pool-creating test in this codebase relies on that meaning no validation, and defaulting one into existence would enforce it on all of them retroactively. The broader "no Policies at all" case stays a separate follow-up. New tests: passwordHistoryCountsTheCurrentPasswordAsOneOfN, adminResetUserPasswordDoesNotBypassPasswordHistory, createUserPoolDefaultsAnUnsetMinimumLengthToEight. Updated passwordHistoryRejectsARecentlyUsedPassword's assertion for the new exception code, and createUserPoolWithFullConfig's expectation for the normalized policy shape. * fix(cognito): stop admin reset from shrinking the password-history window greptile caught a real bug in the previous commit: updatePasswordHistory always capped retained history at PasswordHistorySize - 1, on the assumption that a current password always occupies one of the n slots. That's true for an ordinary password change, but not for adminResetUserPassword, which clears the current password without replacing it -- so capping at n-1 there dropped the oldest still- protected entry a reset alone should not age out. Both updatePasswordHistory and validatePasswordAgainstPolicy now check whether a current password hash exists at the moment they run (the mutation callers apply before archiving/checking) to decide whether n or n-1 entries are live. adminResetUserPassword is reordered so the hash is actually cleared before archival runs, matching what the check now expects. New test: adminResetUserPasswordDoesNotShortenTheHistoryWindow, which pins the exact PasswordHistorySize: 2 / three-password / reset scenario greptile's finding described, including that the window correctly shrinks back to n-1 once a new password re-occupies the current slot. --------- Co-authored-by: Priamo Germosen <6233424+pgermosen@users.noreply.github.com> |
||
|
|
62dbd9ddf9 | fix(apigateway): report RestApi as available (#2816) | ||
|
|
968ff78e25 |
fix(lambda): make the code-volume populate concurrency configurable (#2830)
Concurrent first-time code-volume populates are capped by a semaphore sized Math.max(2, availableProcessors() / 2). The JVM honours the container's cgroup CPU quota, so a CPU-constrained Floci container derives 2 permits and concurrent cold starts of *distinct* large functions complete in waves of two instead of in parallel. Measured on main, six distinct functions with 41MB packages, all cold, fired concurrently, varying only the quota on Floci's own container: unlimited (16 cpu) -> 8 permits -> one wave of 6 -> 8.3s --cpus=8 -> 4 permits -> waves of 4, 2 -> 13.2s --cpus=4 -> 2 permits -> waves of 2,2,2 -> 19.2s The wave sizes track the formula exactly, which rules out generic CPU starvation - that would slow all six uniformly rather than produce discrete equal-size waves. The populate is IO-bound (creating a helper container and streaming a tar into it), so CPU count is a weak proxy for how many the Docker daemon can absorb. The cap itself is still worth having: the daemon overload it was added to prevent is real. What was missing is a way to decouple it from the CPU allocation, so this adds floci.services.lambda.code-volume-populate-concurrency (FLOCI_SERVICES_LAMBDA_CODE_VOLUME_POPULATE_CONCURRENCY) and leaves the derived default untouched. Values below 1 fall back to the derived default with a warning: zero permits would deadlock every populate, and a negative Semaphore count would make acquire() block until that many releases arrived. The semaphore becomes an instance field so the permit count can come from config. Floci runs a single @ApplicationScoped launcher, so it is still one gate for the whole emulator. Refs #2050 |
||
|
|
63a2a60a30 |
fix(stepfunctions): let a mocked response with no attempts start the execution (#2823)
A MockedResponses entry with no attempt keys was rejected at StartExecution, so a generated mock file failed the whole execution when the collection it was built from was empty. Step Functions Local starts the execution and fails it with States.Runtime only when the state that names the entry is entered. An empty entry is a lookup that finds nothing, not a malformed entry. Floci already accepts a mock that defines attempt 1 but not attempt 0 and fails the same way at run time. Every other malformed entry keeps its 400 at StartExecution, which stays stricter than Step Functions Local. Verified against amazon/aws-stepfunctions-local:2.0.0. Refs #2523 |
||
|
|
b0fe8311a0 |
feat(ses): support v2 tenant-scoped sending with association gate (#2815)
* feat(ses): support v2 tenant-scoped sending with association gate * fix(ses): guard tenantForSending against a null TenantName and pin the raw-test charset * fix(ses): validate an inline bulk template before the tenant gate |
||
|
|
5b363ffa2d |
fix(lambda): implement GetLayerVersionByArn (#2812)
* fix(lambda): implement GetLayerVersionByArn
GET /2018-10-31/layers?find=LayerVersion&Arn={arn} is GetLayerVersionByArn,
but only ListLayers was bound to that path and it ignored both query
parameters. A GetLayerVersionByArn call was therefore answered with a
ListLayers body and HTTP 200: an SDK deserialises that against the
GetLayerVersionByArn output shape, finds none of its members, and hands the
caller an empty result instead of the layer version or a
ResourceNotFoundException.
AWS gives the two actions the same method and path, discriminated only by
`find`, and JAX-RS cannot route on a query parameter, so the branch lives in
the handler.
The semantics below were measured against the live service rather than
inferred from the reference:
find=LayerVersion&Arn=<present> 200 + LayerVersion object
find=LayerVersion&Arn=<absent> 404 ResourceNotFoundException
find=LayerVersion, no Arn 400 ValidationException, must not be null
find=LayerVersion&Arn=junk 400 ValidationException, pattern in message
find=Nonsense 200 + ListLayers body
find=layerversion 200 + ListLayers body (match is case-sensitive)
The Arn pattern enforced here is the one the live service reports in its own
ValidationException, not the one the API reference publishes: it constrains
the region segment more tightly and additionally accepts the AWS-managed
arn:<partition>:lambda:::awslayer:<name> form, which the reference omits.
The response reuses the builder GetLayerVersion already returns, and resolves
Content.Location against the layer's own region rather than the caller's,
matching the lookup resolveLayerByArn already keys on.
* fix(lambda): scope GetLayerVersionByArn to the caller's account
resolveLayerByArn keys on region, layer name and version. Storage is already
partitioned per account, so that lookup runs inside the caller's own partition
— an ARN naming a different account did not reach that account's layers, but it
did resolve to the caller's own same-named layer and return it.
Measured on main, without this action: account B publishes
arn:...:111111111111:layer:acct-probe:1, then calls CreateFunction with
Layers=[arn:...:000000000000:layer:acct-probe:1]. The call succeeds and the
function records account A's ARN while B's own layer is what resolves. Account
B never sees account A's layer — GetLayerVersion by name and ListLayers both
return nothing for it — so this is a wrong-resource answer, not a cross-account
read.
GetLayerVersionByArn is the one layer action that takes an account explicitly,
so it honours it: an ARN outside the caller's account is a 404, which is what
the caller already gets from GetLayerVersion for a layer it cannot see. No
layer can be shared cross-account here — layer permissions are unimplemented —
so a foreign account is always a miss, and the check is the place sharing would
hook in if that changes.
The same account-blindness reaches CreateFunction and UpdateFunctionConfiguration
through validateLayersResolvable, and the container launcher through the same
resolver. Those are pre-existing on main and change behaviour for existing
actions, so they are left for a separate change rather than folded in here.
* fix(lambda): reject a layer ARN naming another partition
The account guard compared only the account, and resolveLayerByArn drops
the partition as well as the account, so an ARN in another accepted
partition with the same account, region, name and version resolved to
the caller's local layer and was returned under the foreign-partition
ARN. The live service rejects those outright with
InvalidParameterValueException.
|
||
|
|
426fbcb284 |
feat/redshift auth proxy (#2751)
* feat(redshift): add auth proxy port range and endpoint-host config * feat(redshift): add containerHost/containerPort/proxyPort to Cluster model * feat(redshift): add RedshiftAuthProxy reusing the RDS PostgreSQL protocol handler * feat(redshift): add RedshiftProxyManager registry with shutdown hook * feat(redshift): front new clusters with an auth proxy and advertise it * feat(redshift): stop/update proxy on delete/modify, start it on snapshot restore * feat(redshift): keep proxy port stable across reboot and adopt-on-startup * test(redshift): integration coverage for JDBC through the auth proxy * test(redshift): reinstate JDBC connectivity check now that the proxy exists * docs(redshift): document the cluster auth proxy and its config * fix(redshift): prevent minor port leak when proxy fails to start * fix(redshift): rollback container on proxy failure and surface teardown errors * fix(redshift): stop auth proxy on rollback to prevent listener collisions * fix(redshift): ensure proxy shutdown failure does not abort container and port cleanup * fix(redshift): add proper logging for intentionally ignored cleanup exceptions * fix: Wait for Redshift database readiness before proxying Previously, RedshiftContainerManager just slept for 3 seconds before marking the container as started. On slower CI environments, the PostgreSQL database might take longer to initialize, resulting in Connection Refused when the RedshiftAuthProxy forwards connections. Now, RedshiftContainerManager polls the database using psql until it's ready, up to 60 seconds. * fix(redshift): prevent proxy port reallocation on shutdown failure Addresses a review comment indicating that if a Redshift auth proxy fails to shut down during rollback or deletion, its port must not be released into the available pool. Reassigning a still-bound port would cause subsequent cluster creations to fail with a BindException. Instead, we now tolerate proxy shutdown errors but intentionally leak the port allocation to prevent collisions. * fix(redshift): fix failing tests due to proxy changes 1. RedshiftOperationsTest checked for a hardcoded port 5440, but the RedshiftService now allocates dynamic proxy ports. Removed the exact port assertion. 2. RedshiftContainerManager's psql readiness check was connecting via local Unix socket, which succeeded before PostgreSQL was actually ready to accept remote TCP connections from the proxy. Added '-h 127.0.0.1' to enforce TCP readiness. * test(redshift): use Awaitility to connect to proxy Use Awaitility to retry the initial connection in RedshiftProxyIntegrationTest to prevent transient 'Connection attempt failed' errors on slower CI environments. * chore(redshift): use proper imports instead of fully-qualified class names in tests * fix(redshift): fix compiler errors introduced during import cleanup * fix(redshift): resolve proxy lifecycle bugs and CI network issues - Throw RuntimeException from RedshiftProxyManager.stopProxy if proxy is not found. This allows RedshiftService to catch it and intentionally leak the port, preventing port collisions if a proxy fails before registration. - Force RedshiftProxyIntegrationTest to connect via 127.0.0.1 instead of the endpoint address, which resolves to host.docker.internal in CI environments and causes UnknownHostException. * fix(redshift): prevent proxy port exhaustion on startup failures Instead of blindly assuming missing proxies denote a leaked port, RedshiftProxyManager now tracks proxies that failed their socket cleanup during startup. stopProxy throws an exception only if the socket is known to be leaked. This allows RedshiftService to safely release ports after clean proxy startup failures, addressing Greptile's feedback about port exhaustion. * fix(redshift): retain proxy reference to allow retry on close failure As identified by Greptile, stopProxy previously removed the proxy from the registry before calling proxy.stop(). If stop() threw an exception, the proxy reference was lost, preventing any subsequent retry from ever finding it and attempting to close it again. stopProxy now only removes the proxy from the registry after stop() returns successfully. Additionally, failedCleanups is now retained instead of cleared, ensuring retries continue to safely leak the port if cleanup remains impossible. * fix(redshift): abort cluster deletion if proxy fails to stop As highlighted by Greptile, previously deleteCluster would swallow proxy shutdown failures and delete the cluster metadata anyway. This eliminated the retry path, stranding the unclosed proxy and its port reservation until the process exited. Now, if stopProxyAndReleasePortSafely fails, deleteCluster throws an exception to preserve the cluster metadata so the deletion can be retried. * test(redshift): lock in proxy lifecycle failure-recovery behaviors Bổ sung test cho ba hành vi hardening chưa được cover, để refactor sau không âm thầm phá vỡ: - stopProxy giữ lại proxy trong registry khi close() ném, cho phép retry gọi lại đúng instance và chỉ deregister sau khi stop sạch - marker leak khi startup cleanup thất bại được retain qua mọi retry và chỉ bị xoá bởi một lần start mới thành công - deleteCluster abort với InternalFailure, giữ nguyên container + metadata khi proxy không stop được; retry sau đó hoàn tất khi proxy stop OK Đồng thời bỏ "-p 7100-7199:7100-7199" trong compatibility.yml: proxy bind 0.0.0.0 trong container floci và sdk-test-java chạy trên compat-net nên JDBC đi container-to-container qua alias "floci", không cần publish port ra host. Giữ lại FLOCI_SERVICES_REDSHIFT_ENDPOINT_HOST=floci. * fix(redshift): keep an unclosable proxy reachable for later retry Theo phản hồi mới của Greptile: khi start/replace proxy thất bại và cleanupFailedStart cũng không đóng được listener, code cũ chỉ lưu relayKey vào một Set rồi vứt object RedshiftAuthProxy. stopProxy sau đó ném vĩnh viễn mà không còn cách nào chạm tới listener để thử đóng lại, khiến cluster không xoá được và port bị giữ mãi trong dải hữu hạn. Thay Set<String> failedCleanups bằng Map<String, RedshiftAuthProxy> unclosableProxies. cleanupFailedStart giữ lại chính proxy đó; stopProxy và stopAll thử đóng lại, chỉ gỡ entry khi stop thành công. startProxy không còn xoá marker khi start mới — chỉ một lần stop thành công mới gỡ, vì listener cũ có thể vẫn đang bound. * fix(redshift): retry proxy port bind to absorb reboot rebind race rebootCluster giữ nguyên proxy port của cluster để endpoint ổn định, nên listener cũ bị đóng rồi bind lại đúng port đó chỉ vài ms sau. Dưới tải (CI runner ARM) kernel có thể chưa nhả port và SO_REUSEADDR không giúp được khi accept loop cũ đang teardown -> BindException -> RebootCluster trả 500. Đây là nguyên nhân test RedshiftOperationsTest. testClusterAndSnapshotLifecycle fail chập chờn. start() giờ retry bind tối đa ~1s, chỉ nuốt BindException; IOException khác vẫn propagate ngay. Thêm test dựng cảnh port bị chiếm tạm thời rồi nhả, xác nhận proxy vẫn bind được. * fix(redshift): tear down proxy and release port when rebootCluster fails Nếu startProxy/restoreSnapshot ném sau khi proxy đã (re)start trong rebootCluster, hai nhánh catch chỉ set status "failed" rồi rethrow — proxy mới vẫn chạy và port vẫn nằm trong usedPorts, không nhánh nào dọn. Giờ cả hai catch gọi stopProxyAndReleasePortSafely như createCluster và restoreFromClusterSnapshot đã làm; proxyPort được hoist ra ngoài try với sentinel -1 để rollback an toàn kể cả khi chưa cấp port. Thêm test: restoreSnapshot ném -> proxy được stop lại, AwsException nổi lên. * fix(redshift): serialize createCluster/deleteCluster/restoreFromClusterSnapshot modifyCluster và rebootCluster đã synchronized nhưng create/delete/restore thì không, dù cả năm method đều chạy chuỗi container + proxy + port nhiều bước trên cùng một cluster. deleteCluster(x) chạy song song rebootCluster(x) có thể để lại metadata mồ côi trỏ tới container/proxy đã dừng. Thêm synchronized cho ba method còn lại để nhất quán. * fix(rds,redshift): close backend socket when the auth handshake fails handleConnection mở kết nối TCP tới container Postgres trước khi gọi handleAuth. Chỉ nhánh thành công (bridge) và vài nhánh lỗi có kiểm soát mới đóng backend; nếu handleAuth trả về sớm ở một probe trần (SSLRequest không kèm startup) hoặc ném IOException (client ngắt giữa handshake), catch cũ chỉ đóng client -> mỗi health-check TCP làm rò một connection tới Postgres, ăn dần max_connections. Chuyển việc đóng socket sang finally, đóng cả client lẫn backend (idempotent, nhánh thành công đã đóng sẵn). Áp cho cả RdsAuthProxy vì RedshiftAuthProxy được copy từ đó. Thêm test: client drop giữa handshake -> backend nhận EOF. * fix(redshift): stop replacement container and keep dump on failed reboot Rollback của rebootCluster (b44fd1e3) mới chỉ stop proxy + release port, để container thay thế chạy tiếp sau một cluster "failed", và finally vẫn xoá tempDump. Vì container gốc đã stop và không có volume, tempDump là bản sao duy nhất của data -> mất data không khôi phục được (bug có sẵn, giờ mới lộ). rollbackReboot() giờ stop luôn container thay thế (như createCluster/ restoreFromClusterSnapshot). tempDump chỉ bị xoá khi reboot thành công; khi fail thì giữ lại và log đường dẫn để khôi phục thủ công. * fix(redshift): make reboot rollback phase-aware to protect the original Commit trước cho rollbackReboot stop container vô điều kiện. Nếu reboot fail ngay ở takeSnapshot hoặc stopProxy — lúc container gốc (chứa data, không volume) VẪN đang chạy — thì rollback lại force-remove chính nó, huỷ bản sao data hoàn chỉnh duy nhất và chỉ còn dump rỗng/dở. Thêm hai cờ: - originalTornDown: đã stop proxy + container gốc -> rollback mới được đụng vào proxy/port - replacementStarted: đã start container thay thế -> rollback mới được stop container Fail trước hai mốc đó: không đụng gì, trạng thái gốc còn nguyên. Thêm test: takeSnapshot ném -> cm.stop và stopProxy không được gọi. * fix(redshift): clean an orphan replacement container on failed reboot containerManager.start có thể tạo container Docker rồi mới ném ở waitForReady, nên cờ replacementStarted (set sau khi start return) bỏ sót trường hợp này -> orphan chạy dưới tên cluster. Bỏ replacementStarted, gate rollback theo mỗi originalTornDown: một khi proxy + container gốc đã stop thì container gốc chắc chắn biến mất, nên containerManager.stop (xoá theo tên) chỉ có thể chạm replacement — kể cả replacement do start() tạo dở rồi ném. Thêm test: start() ném -> rollback vẫn gọi cm.stop để dọn orphan. * fix(redshift): remove orphan cluster metadata on failed create/restore * fix(redshift): keep failed cluster metadata if proxy stop fails * fix(redshift): fix TooManyActualInvocations in proxy tests * fix(redshift): clear proxyPort on reboot rollback if port is released * fix(redshift): retain reserved port on reboot startup failure * fix(redshift): retain proxy port in reboot rollback and teardown failed startup recovery * fix(redshift): skip failing cluster and retaining dump if reboot fails before teardown |
||
|
|
f7f16cd2a3 |
fix(stepfunctions): bound $range allocation at the AWS memory limit (#2790)
* fix(stepfunctions): open a JSONata query evaluation cause with the AWS sentence evaluateField now wraps a thrown JSONata failure with "The JSONata expression '<expr>' specified for the field '<field>' threw an error during evaluation" before the existing tail, matching real AWS. The separator is ". " when the tail carries a JSONata error code and ": " when it is a bound message with none. evaluate() keeps producing the bare tail unchanged for its direct callers. evaluate() stays the only place the JSONata engine is called and the only catch around it: evaluateField calls it and enriches the failure it throws, rather than reaching the engine itself. QueryEvaluationFailure carries the separator across that throw, so a catch added to evaluate() later covers both entry points. All 11 AslExecutor call sites reach the evaluator through evaluateField or resolveTemplate, so a catch installed anywhere else would be dead on every real execution path. * fix(stepfunctions): catch Error from JSONata evaluation as States.QueryEvaluationError An OutOfMemoryError or StackOverflowError raised while parsing or evaluating a JSONata expression escaped JsonataEvaluator's catch (Exception) and reached AslExecutor's own last-resort catch (Error), failing the whole execution as States.Runtime before the state's own Retry and Catch ever ran. JsonataEvaluator.evaluate now also catches Error at the same seam and translates it into a FailStateException with States.QueryEvaluationError, so a Catch on the state (or on States.ALL) can recover, matching real AWS. Closes #2738 * fix(stepfunctions): match AWS on the JSONata expressions it refuses Four expression classes where Floci and AWS disagreed on whether the state fails at all, all measured against us-east-1 with test-state. The evaluation-depth ceiling drops from 500 to 100, which is AWS's own: five nesting shapes bisected one n at a time all put its last accepted evaluation at depth 100 and its first refusal at 101. An addition chain nests one level per term and AWS accepts 100 terms; parentheses, brackets and the chain operator nest one level more than their count and AWS accepts 99 of each; a non-tail-recursive $f(n) nests 3n+5 and AWS accepts n=31, depth 98, refusing n=32, depth 101. The memory an expression may hold is now bounded, which it was not: one value an evaluation step produces may hold 6,990,256 bytes, counting a number as eight and a character as one. The two shapes AWS was bisected on, [1..873782] and a string doubled 22 times, bracket a number at between five and nine bytes a character: with the bound at 873,782 numbers, anything in that range leaves 4,194,304 characters inside it and 8,388,608 outside, and four or ten does not. Eight is what a double costs, and it is inside the bracket. The check walks the value and stops at the bound, and a lazy range is counted from its length rather than materialised. $eval is unbound, as AWS disables it, so a call to it answers T1006 the way AWS does and $parse stays the replacement. A non-finite number the expression itself evaluates to comes back as the string AWS writes for it, since JSON has no literal for one: 1/0 and 1e308*10 are "Infinity" and $parseInteger("abc","0") is "NaN", where the first two raised D1001 and the third returned nothing and failed the field. One the library's arithmetic buries inside a value, as in [1/0], still fails the state, because the refusal is the only place the library leaves the value and it has already unwound what was being built; one a function answers nests like any other value. $formatNumber checks its picture string against the fourteen rules of XPath F&O 4.7.3 first, so $formatNumber(1, "x") fails with D3086 instead of answering "x1". Which of the fourteen codes AWS reports is what fixes the order the rules are read in: a picture with no digit breaks D3085 and D3086 at once and AWS reports the second, so the last rule broken names the failure rather than the first. Closes #2737 * fix(stepfunctions): bound $range allocation at the AWS memory limit AWS accepts $range(1, 360145, 1), all 360,145 elements, and refuses one element more on its own memory limit. Floci's $range had no such bound: it built the array in full before the memory check on the value ever ran, so a call far past AWS's limit spent gigabytes and either exhausted the heap or hung instead of failing the state cleanly. range() now refuses a call whose produced element count exceeds the measured bound before allocating, throwing the same States.QueryEvaluationError JException the held-memory check raises, whose message is now a single shared constant. Other built arrays keep the looser, byte-based bound. * test(stepfunctions): pin the number model of the execution input Measured against real AWS (test-state, 2026-08-30): a Pass state with Output {"v": "{% $states.input.amount %}"} answers {"v": 1} for input {"amount": 1.0} and {"v": 9.223372036854776E18} for input {"amount": 9223372036854775808}. That is exactly what routing the execution input through toJsonataValue/toJsonataNumber already produces, so these two tests pin it against silent regression. --------- Co-authored-by: Facundo Paredes <25681464+facuparedes@users.noreply.github.com> |
||
|
|
ead70eae4d |
fix(stepfunctions): refuse the definitions AWS refuses, at both validation entry points (#2786)
* fix(stepfunctions): reject definitions with no terminal state, dangling targets or unsupported fields Enforce the ASL rules AWS applies at both ValidateStateMachineDefinition and CreateStateMachine: a workflow needs a terminal state (MISSING_END_STATE, top-level only, suppressing the unreachable-state reachability check but not a dangling-target check), every reachable state and every Next/Choices[].Next/Default/Catch[].Next target must exist (MISSING_TRANSITION_TARGET), recursing into ItemProcessor and Branches with structured paths, and TimeoutSeconds/Catch/Retry are refused outside the state types that support them (SCHEMA_VALIDATION_FAILED, "Field '<name>' is not supported"). CreateStateMachine's wire message always renders " at <location>", printing the literal "null" when there is none, matching AWS exactly; ValidateStateMachineDefinition keeps omitting the location field entirely when null, which is the correct, unchanged behavior for that API. Remove the now-dead Parallel TimeoutSeconds handling in AslExecutor: no definition carrying that field can reach execution anymore. * fix(stepfunctions): reject JSONata expressions that do not parse at definition time Report INVALID_JSONATA_EXPRESSION when a JSONata expression fails to parse, using the parser's own message with its S0xxx code prefix stripped, at the field's location. Also report UNSUPPORTED_JSONATA_EXPRESSION for '$$' and for '$states.errorOutput' outside a Catch entry's own Output or Assign. Previously these were accepted at ValidateStateMachineDefinition and CreateStateMachine time and only failed later, at execution, with States.QueryEvaluationError. Every message asserted was measured against real AWS us-east-1 with `aws stepfunctions validate-state-machine-definition`, including `phone %.other` and the empty expression, which AWS also refuses. The three booleans the definition walk threaded through every recursive call (insidePayload, isCatchEntry, insideCatchOutputOrAssign) travel as a single JsonataScope value, which drops collectTopLevelReferences back under the Sonar S3776 limit. --------- Co-authored-by: Facundo Paredes <25681464+facuparedes@users.noreply.github.com> |
||
|
|
9f7b7117f1 |
refactor(cloudformation): move AWS::SNS::* into its own provisioner (#2759)
Migrates AWS::SNS::Topic and AWS::SNS::Subscription out of the switch, completing the Wave 1 leaf slices. Behaviour-preserving. The care here is the subscription's attribute encoding. FilterPolicy and RedrivePolicy are JSON documents that SNS expects as JSON strings, so they go through resolveJsonAttribute, while FilterPolicyScope and RawMessageDelivery are scalars that go through resolve. Using the scalar resolver on a document flattens it to an empty string and silently breaks message filtering, which is the failure this type has had before, so the test stubs the two resolvers with distinct semantics and asserts the serialized form rather than only that an attribute was set. The topic's physical id is the ARN rather than the name, because Ref on an SNS topic returns the ARN. |
||
|
|
6f123e83b8 | feat(batch): add update and delete job queue endpoints with corresponding service logic (#2807) | ||
|
|
66d910c613 |
fix(build): resolve the JSON schema library from Maven Central (#2811)
A clone with a cold ~/.m2 cannot build. Apicurio's schema-util-json asks for the JSON schema library under its JitPack coordinate, com.github.everit-org.json-schema:org.everit.json.schema, which has never been published to Maven Central. The project declares no repositories, so Maven only ever consults Central, where that artifact returns 404. Builds that work are resolving it from a warm local cache, CI included via its restored Maven cache, which is why this stayed hidden. Replaced with com.github.erosb:everit-json-schema, the same project rehomed by its author to a Central-published coordinate. Both jars carry the same 174 classes under org.everit.json.schema, so apicurio's JsonSchemaCompatibilityChecker and JsonSchemaContentValidator load unchanged, and the Central version is newer (1.14.6 against 1.14.4). Adds the JSON cases that prove it. SchemaCompatibilityCheckerTest covered only AVRO and PROTOBUF, neither of which touches the library, so the whole JSON branch of checkerFor/validatorFor was untested and a missing dependency would only have surfaced at runtime. Dropping the replacement now fails those three with NoClassDefFoundError on org.everit.json.schema.loader.SchemaLoader. One expectation is asserted as observed rather than assumed: apicurio treats adding an optional JSON property as narrowing, the opposite of the AVRO case, because data carrying that key with another type validated before. |
||
|
|
2d724d15aa |
refactor(cloudformation): move Kinesis and CloudWatch to their own provisioners (#2758)
Migrates AWS::Kinesis::Stream and AWS::CloudWatch::Alarm out of the switch. Two unrelated services in one slice because each is a single service call with property mapping and no shared state; splitting them would cost two review cycles for one mechanical change. Kinesis carries an update path: an unchanged name reconciles stream mode, retention and tags rather than calling createStream again, which the service rejects with ResourceInUseException. It uses ctx.priorPhysicalId() for the same reason the log group slice does, since the body assigns the new id before it returns. sameNameExistingResource, deleteRenamedResource and parseIntProp are copied rather than shared: each still has callers in the monolith. addAlarmActions moves, since all three of its call sites are inside the alarm body. Both service fields leave the monolith; their constructor parameters stay until the endgame. The existing Kinesis and CloudWatch alarm integration tests are QuarkusTests resolved through CDI, so they exercise the new provisioners with no edit, which is the regression evidence for this slice. |
||
|
|
8765cde6dd |
test(terraform): expand Floci IaC compatibility coverage (#1834)
* test(terraform): expand Floci IaC compatibility coverage * fix(terraform): use current S3 backend path style option * fix(terraform): route ElastiCache provider calls to Floci * fix(compat): resolve Firehose name collision, drop resources with live Floci gaps - aws_kinesis_firehose_delivery_stream.compat collided with main's .events stream (both named floci-compat-firehose); renamed to floci-compat-firehose-basic. - Removed aws_codebuild_project, aws_cloudtrail, and aws_opensearch_domain from both suites: running the suite end-to-end surfaced real Floci gaps behind them (BatchGetProjects ARN lookup, CloudTrail ListTags, OpenSearch CognitoOptions nil deref crashing the provider) that only show once Terraform gets past apply into the post-create refresh. Tracked as #2799, #2800, #2801. - Updated test counts in README to match (70/44/2,582). * fix(compat): force_destroy the compat bucket, drop resources with live teardown gaps - aws_s3_bucket.app now sets force_destroy = true: the CUR report now actually emits into this bucket (format=Parquet finally lets the report definition get created), so terraform destroy needs to be able to clear a non-empty bucket. - Removed aws_transfer_server: Floci's DeleteServer wrongly requires OFFLINE state, which isn't real AWS behavior (confirmed against the API reference and terraform-provider-aws's own delete logic, which never calls StopServer first). Tracked as #2802. - Removed aws_batch_compute_environment: UpdateComputeEnvironment (called by terraform destroy to disable it first) isn't implemented at all, so the request falls through to an HTML error page instead of a modeled error. Tracked as #2803. - Updated test counts in README to match (68/42/2,578). * fix(compat): drop aws_api_gateway_rest_api pending Floci apiStatus fix CI (native / compat-terraform) showed terraform apply deterministically timing out on aws_api_gateway_rest_api: terraform-provider-aws waits for the REST API's apiStatus field to reach AVAILABLE, and Floci never sets it (confirmed apiStatus is a real, current field in the apigateway wire model). Removed from both suites; tracked as #2804. Updated test counts in README to match (67/41/2,576). * fix(compat): drop redundant ECS containerInsights setting causing drift CreateCluster silently drops the settings field on Floci (confirmed: handleCreateCluster never parses req.path("settings"), unlike the update handlers), so a subsequent plan always proposes re-adding it - permanent drift on the suite's "re-planning reports no changes" check. containerInsights=disabled is AWS's actual default, so the block was functionally redundant; dropped it rather than block on a Java fix. Tracked as #2806. --------- Co-authored-by: Priamo <pgermosen@gmail.com> |
||
|
|
1d81cdd0d2 |
refactor(cloudformation): move AWS::Logs::LogGroup into its own provisioner (#2756)
* refactor(cloudformation): move AWS::S3::* into its own provisioner (#2754) Migrates AWS::S3::Bucket and AWS::S3::BucketPolicy out of the switch. Behaviour-preserving: bodies are ported verbatim apart from the mechanical rewrites onto ProvisionContext, so the bucket name, the five Fn::GetAtt attributes and the CORS XML are unchanged. The CORS and versioning helpers move with the slice; all four of appendCorsRuleElements' call sites are inside applyBucketCorsConfiguration, so nothing is left behind. Unlike the leaf slice, s3Service stays on the monolith: Lambda code from an S3 location and the ApiGatewayV2 OpenAPI body both still read through it. Only the two switch arms and the provisioning methods leave. Delete keeps its shape. A bucket policy has nothing to remove, and a non-empty bucket still raises BucketNotEmpty so the stack reports DELETE_FAILED as AWS does, rather than reporting a clean delete. * refactor(cloudformation): move AWS::Logs::LogGroup into its own provisioner Behaviour-preserving move of the log group's provision and delete paths. Unlike the earlier slices this one carries a real update path: the body decides between reconciling in place and replacing, from the prior physical id and the recorded FlociLogGroupNameMode, and it infers that mode from the physical id's shape for stacks persisted before the attribute existed. Uses ctx.priorPhysicalId() rather than reading it back off the StackResource. The two are equal on entry, but the method assigns the new physical id before it finishes, so a context-captured value cannot be invalidated by a later edit to the body. UPDATE_ROLLBACK_RESTORED_ATTR moves to CfnRollback, which exists for exactly this: it was package-private on the monolith and so unreachable from the provisioners package. The monolith's constant now delegates there, leaving CloudFormationService's two references untouched. reconcileLogGroup moves with the slice. isGeneratedName and its prefix helper are copied, because a type that has not migrated yet still calls them, and logsService leaves the monolith entirely. CloudFormationLogGroupProvisionerTest keeps testing through the dispatcher, now with the provisioner registered. That is load-bearing rather than decoration: with an empty registry the type would reach the stub arm and the test would assert against a synthetic id. Going through the dispatcher also covers the plumbing this migration changed, that existingPhysicalId and existingAttributes reach ProvisionContext. |
||
|
|
8034c13106 |
refactor(cloudformation): move AWS::S3::* into its own provisioner (#2754) (#2794)
Migrates AWS::S3::Bucket and AWS::S3::BucketPolicy out of the switch. Behaviour-preserving: bodies are ported verbatim apart from the mechanical rewrites onto ProvisionContext, so the bucket name, the five Fn::GetAtt attributes and the CORS XML are unchanged. The CORS and versioning helpers move with the slice; all four of appendCorsRuleElements' call sites are inside applyBucketCorsConfiguration, so nothing is left behind. Unlike the leaf slice, s3Service stays on the monolith: Lambda code from an S3 location and the ApiGatewayV2 OpenAPI body both still read through it. Only the two switch arms and the provisioning methods leave. Delete keeps its shape. A bucket policy has nothing to remove, and a non-empty bucket still raises BucketNotEmpty so the stack reports DELETE_FAILED as AWS does, rather than reporting a clean delete. |
||
|
|
26ae4ef78a |
fix(ec2): honour documented Describe* filters and stop ENIs inheriting instance tags (#2747)
* fix(ec2): honour documented Describe* filters and stop ENIs inheriting instance tags Six Describe* calls silently ignored documented filter inputs, each an instance of the same bug shape: an unhandled filter name fell through matchesFilter's default -> true arm (or, for DescribeAddresses, the filters parameter was never applied at all), so a filtered call returned the same unfiltered list as no filter - and Volumes[0]/Vpcs[0] reads depended on iteration order instead of the filter. - DescribeSecurityGroups: description - DescribeVpcs: cidr-block alias for cidr (verified against live AWS 2026-08-25: accepted, primary CIDR only) - DescribeVpcEndpoints: vpc-endpoint-state (renamed from the undocumented "state" key; no evidence AWS accepts "state") - DescribeVolumes: attachment.instance-id/device/status/ delete-on-termination - DescribeInstances: image-id - DescribeAddresses: all documented filters this store can back, plus the generic tag: family Also stops DescribeNetworkInterfaces copying the attached instance's tags into an interface's tagSet: an ENI's tags are its own, and AWS tags launch-created interfaces only via a RunInstances TagSpecification with ResourceType=network-interface, which RunInstances now honours. * fix(ec2): filter addresses on refreshed association state and classify eni- ids in DescribeTags DescribeAddresses now re-resolves an associated address before the filter pass, so a public-ip filter is judged against the address the response carries rather than the one persisted before an instance restart. And inferResourceType learns the eni- prefix, so a launch-time network-interface tag shows up under DescribeTags resource-type=network-interface instead of being classified unknown and dropped. * test(ec2): pin refresh-before-filter for DescribeAddresses and the ENI tag path through DescribeTags A public-ip filter now has a regression test across a simulated container restart: the current bridge IP must match and the pre-restart IP must not, which fails if filtering ever runs before the association refresh again. The launch-time ENI TagSpecification test asserts DescribeTags returns the tag under the interface's own resourceId with resource-type network-interface, exercising the full RunInstances path rather than the classification helper alone. |
||
|
|
9288769607 |
fix(stepfunctions): bound a running execution the four ways AWS does (#2782)
* fix(stepfunctions): enforce both TimeoutSeconds clocks The state machine's top-level TimeoutSeconds was read back by DescribeStateMachine and copied into activityScheduledEventDetails but never used as a deadline, so an execution ran to completion however long it took. Compute the budget once in doExecute, check it before every state and inside the Wait sleep, and end the execution TIMED_OUT with stopDate set, no error, no cause, and one ExecutionTimedOut event carrying States.Timeout and previousEventId 0. A Task's two bounds were swapped: HeartbeatSeconds acted as the total wait and TimeoutSeconds was decorative, so "TimeoutSeconds": 5, "HeartbeatSeconds": 60 failed at 60 seconds instead of 5. awaitToken now bounds the whole wait with TimeoutSeconds and the gap between heartbeats with HeartbeatSeconds. SendTaskHeartbeat only logged, so the gap bound needed a per-token timestamp: the service now records one when the token is registered and again on every heartbeat, and forgets it when the waiting task stops listening. Either clock ends the state as a TaskTimedOutException, which is what us-east-1 answers for a heartbeat expiry: an ActivityTimedOut event carrying error States.Timeout and no cause, then an execution reading FAILED with error States.Timeout and no cause key, over the six-event history ExecutionStarted, TaskStateEntered, ActivityScheduled, ActivityStarted, ActivityTimedOut, ExecutionFailed. A Catch still matches a heartbeat expiry under States.HeartbeatTimeout, so ErrorEquals matching now asks the failure which names it answers to rather than comparing one string. The Wait sleep stops at the execution deadline instead of sleeping its full duration first, which would have reported the timeout as many seconds late as the Wait outlasts the budget and left a WaitStateExited behind for a state AWS never finished. awaitToken discards its token on the way out; without that the token would stay pending for the life of the process and a later SendTaskSuccess would be answered as if someone were still waiting. Neither timeout carries a cause, so failExecution now reads a null cause as the failure having none and leaves the key out of both DescribeExecution and the ExecutionFailed event. The two other failures that reach it without a cause -- a Fail state with no Cause, and SendTaskFailure with no cause -- keep reporting an empty one, since AWS's shape for those is unmeasured. Refs #2733 * fix(stepfunctions): bound an execution's history and make StopExecution stop it AWS puts two bounds on a running execution that floci did not: it ends one that reaches 25,000 history events with States.Runtime, event 25,000 being the ExecutionFailed event itself, and StopExecution stops the worker rather than relabelling an execution that goes on to overwrite the status it wrote. Counting an event against that limit and numbering it in the published history are two meanings that one AtomicLong was carrying. They are separated here. producedEventCount counts every event the execution produces, the top-level flow's and those of its Parallel branches and inline Map iterations alike, and is what the limit judges. The published history numbers its own events: an event's id is its position in the list, which makes the list the only authority for the next id, where the counter and the seal in StepFunctionsService used to be a second one that agreed with it only at rest. A branch's events are counted and never built, so executeBranch no longer assembles HistoryEvent objects with full input and output JSON into a list it throws away. A Distributed Map runs each item as a child execution on AWS, and a child execution has a history of its own, so its items are counted against their own limit rather than the parent's: a Distributed Map over 13,000 items no longer fails the parent partway through with States.Runtime. The count is taken before it is judged. Reading it and then taking it let 40 concurrent inline Map iterations through the same check and spent more events than the execution had. StopExecution records its abort against a history that need not be in memory. Executions are stored and histories are not, so a restart in persistent mode brings a RUNNING execution back with nothing behind it, and the same window opens between a reset emptying the cache and emptying the store; the abort was written to the store and then thrown away as a 500. * fix(stepfunctions): end an execution that spends its budget waiting A state machine's TimeoutSeconds budget was read only between states and around the two pauses a definition asks for, a Wait and a Retry backoff. Every other way a state blocks outlasted it: a Task waiting for its token, a states:startExecution.sync or ecs:runTask.sync poll, and a Parallel or Map waiting for its branches. Those executions ended past their budget, and ended FAILED or SUCCEEDED rather than TIMED_OUT. Each of those waits now stops at the budget, and the Task path publishes no failure event for the state it cuts. Measured against us-east-1: a state machine with TimeoutSeconds 5 over an activity Task whose own TimeoutSeconds is 60 stops at exactly 5.000 s with status TIMED_OUT, and its history is ExecutionStarted, TaskStateEntered, ActivityScheduled, ExecutionTimedOut, with no ActivityTimedOut and no ExecutionFailed. --------- Co-authored-by: Facundo Paredes <naranjax@MAC-69786.local> |
||
|
|
2480daaa09 |
fix(athena): route database DDL to Glue (#2757)
* fix(athena): route database DDL to Glue * fix(athena): preserve DDL execution failures |
||
|
|
881695ea3b |
feat(apigatewayv2): OpenAPI import and Terraform-visible API/stage attributes (#2714)
* feat(apigatewayv2): implement ImportApi and ReimportApi
HTTP APIs had no PUT route on /v2/apis or /v2/apis/{apiId}, so ImportApi and
ReimportApi fell through JAX-RS matching to the S3 path-style handler and came
back as NoSuchBucket. Terraform's aws_apigatewayv2_api calls ReimportApi
whenever `body` is set, so any HTTP API defined by an OpenAPI document failed
to apply.
Add an OpenAPI importer for the v2 object model, reusing the swagger-parser
already used by ImportRestApi/PutRestApi on the v1 side. It materialises
routes, integrations and authorizers from x-amazon-apigateway-integration,
x-amazon-apigateway-authorizer, x-amazon-apigateway-any-method and
x-amazon-apigateway-cors, honouring document- and operation-level security.
ReimportApi replaces routes, integrations and authorizers as AWS does, but
leaves API settings an OpenAPI document cannot express (CORS when the spec
carries no x-amazon-apigateway-cors, tags, disableExecuteApiEndpoint) intact,
so a Terraform resource whose cors_configuration lives outside body does not
flap.
Both actions are wired for the restJson1 and JSON 1.1 protocols.
* fix(apigatewayv2): tag stages, not just APIs
TagResource, UntagResource and GetTags read the API id from the last segment of
the resource ARN, so a stage ARN (/apis/{apiId}/stages/{stageName}) yielded the
stage name as the API id and failed with "Invalid API id specified". Parse the
resource path by segment instead, and route the operation to the stage when the
ARN names one.
Stage had no tags field at all, so tags supplied to CreateStage were dropped and
never returned on read. Add it, populate it on create, and serialise it in both
the restJson1 and JSON 1.1 stage representations.
Terraform's aws_apigatewayv2_stage sets tags on create and then reconciles them,
so both halves were needed for a stage with tags to converge.
* feat(apigatewayv2): stage access logging, throttling and API version
Four attributes were accepted on write but dropped on read, so Terraform
re-proposed them on every plan and an aws_apigatewayv2_api/aws_apigatewayv2_stage
pair never converged:
- Api.version, also carried across from an imported document's info.version, as
AWS does
- Stage.accessLogSettings (CloudWatch destination and format)
- Stage.defaultRouteSettings and per-route Stage.routeSettings (throttling,
data trace, detailed metrics, logging level)
Throttling and logging fields are boxed rather than primitive: AWS omits unset
knobs instead of defaulting them, and emitting a zero would leave Terraform
seeing a changed value forever.
Stage also gains description, which CreateStage accepted and discarded.
Serialised for both the restJson1 and JSON 1.1 protocols.
* feat(apigatewayv2): honour basepath and failOnWarnings on OpenAPI import
ImportApi and ReimportApi accepted both documented query parameters and then
discarded them, so basepath=prepend or split produced routes at the wrong paths
with no error, and failOnWarnings never rolled anything back.
- basepath now resolves the base path the OpenAPI 3 way — a "basePath" server
variable first (the first one, if several are declared), otherwise the path
carried by server.url — and applies ignore, prepend or split. An unrecognised
value is a BadRequestException rather than silence.
- failOnWarnings turns swagger-parser messages into a 400. Parsing and
validation now happen before ReimportApi deletes anything, so a rejected
reimport leaves the existing routes, integrations and authorizers untouched
instead of gutting the API it was going to replace.
- The Api resource carries the warnings and importInfo the AWS model defines,
the latter noting definition properties the import ignored.
* fix(apigatewayv2): validate authorizers before reimport mutates, warn on unenforceable security
Two review findings on the OpenAPI importer:
- Authorizer resolution ran while the spec was being applied, so a definition
that parsed cleanly but declared an unsupported authorizer type — or a REQUEST
authorizer with caching and no identitySource — was rejected only after
ReimportApi had already deleted the previous routes, integrations and
authorizers. Resolution now happens in the planning phase, side-effect free, so
the rejection leaves the existing definition untouched. This mirrors
validateImportedAuthorizers on the v1 side.
- A security requirement naming a scheme with no AWS binding — a plain bearer or
apiKey scheme, or a misspelling — silently produced authorizationType NONE, so
a document that declares security could yield a publicly invokable route. That
now raises a warning naming the route and the schemes, which failOnWarnings
escalates to a 400.
Also adds the braces AGENTS.md requires to the conditionals introduced by the
earlier commits in this branch.
* fix(apigatewayv2): examine ANY-method routes and compound security on import
Two more review findings, both in the warning collection added by the previous
commit:
- The diagnostic passes walked PathItem.readOperationsMap(), which does not
include x-amazon-apigateway-any-method. An ANY route whose security named an
unbindable scheme therefore produced no warning, failOnWarnings could not
reject it, and it was still imported as NONE — the same silent-public-route
hole the previous commit closed for ordinary operations, left open for the
route type that matches every method. Route creation and both collectors now
share one forEachImportedOperation enumeration so they cannot diverge again.
- Several schemes inside a single SecurityRequirement is OpenAPI's AND. A route
carries one authorizer, so resolveSecurity enforced the first resolvable
scheme and dropped the rest silently. That now warns, naming the dropped
schemes and the one actually enforced.
* fix(apigatewayv2): report that imported AWS_IAM routes are not enforced
A sigv4 security scheme imports to an AWS_IAM route, which is what AWS records,
but HTTP API dispatch enforces only JWT and CUSTOM. A document declaring SigV4
therefore produced a route that looks authenticated and is not.
The route keeps AWS_IAM — downgrading it to NONE would misreport the definition
to anything reading the control plane — and the import now warns that the
emulator records the type without enforcing it. The dispatch gap itself predates
this change: CreateRoute has always accepted AWS_IAM unvalidated, and
ApiGatewayExecuteController already notes that v1 dispatch does not implement
AWS_IAM either.
* fix(apigatewayv2): validate jwtConfiguration shape before reimport mutates
jwtConfiguration was copied out of the authorizer extension unchecked, but
audience reaches the store as a List<String> and is cast as one. A scalar
audience — the form the extension is commonly written with — therefore threw a
ClassCastException inside createAuthorizer, after ReimportApi had already
deleted the previous routes, integrations and authorizers.
Normalise it during planning instead: a scalar audience becomes a single-element
list, a list is copied element-wise, and any other shape (or a non-string issuer)
is a BadRequestException raised before anything is deleted.
This was the last unvalidated field in authorizerSpecs; type, identitySource,
result-TTL caching and jwtConfiguration are now all resolved in the planning
phase, so no authorizer defect can reach the mutating half.
---------
Co-authored-by: local <local@example.com>
|
||
|
|
908d70db3d |
fix(apigatewayv2): propagate Lambda REQUEST authorizer context to HTTP API backends (#2715)
* fix(apigatewayv2): propagate Lambda REQUEST authorizer context to HTTP API backends A REQUEST authorizer's response context was parsed only to read isAuthorized or the policy Effect, then discarded. enforceRequestAuthorizerV2 returned a bare Response (null meaning "allowed"), so nothing could carry the context to buildV2ProxyEvent and the backend Lambda received no requestContext.authorizer at all. A real HTTP API delivers it under requestContext.authorizer.lambda, which is how an authorizer hands verified identity to the integration, so a backend that reads it sees an empty object and rejects every authorized request. This completes #1011 (issue #812), which added REQUEST authorizer invocation for HTTP APIs but only wired the allow/deny decision, and brings v2 in line with #581, which propagated the authorizer context on the v1/REST path. The WebSocket $connect path already does the same via WebSocketProxyEventBuilder, so HTTP APIs were the last of the three to drop it. Return a RequestAuthorizerResult carrying the context, mirroring the JwtAuthorizerResult the JWT path already threads through, and render it as requestContext.authorizer.lambda. Values are not flattened to strings the way the v1/REST path flattens its authorizer context: an HTTP API hands the context to the integration as JSON. The developer guide's own simple-response example returns a string, a number, a boolean, an array and a map, and all five now survive to the backend. principalId is deliberately left out - where AWS surfaces it in a 2.0 proxy event was not measured - and an authorizer that allows without returning a context leaves the authorizer node absent rather than rendering "lambda": null, for the same reason. Covered end to end in HttpApiRequestAuthorizerTest (IAM-policy and simple responses, nesting and scalar types, contextless allow) and at the builder in BuildV2ProxyEventLambdaAuthorizerTest. * chore(apigatewayv2): trim comments on the authorizer-context change Drops narration and change history, keeping only what is not recoverable from the code: the RequestAuthorizerResult contract, why the context is not flattened the way the v1/REST path flattens it, and the two intentional omissions (principalId, absent node rather than "lambda": null). Per AGENTS.md: prefer self-explanatory code over comments, document intentional deviations clearly. * fix(apigatewayv2): brace the authorizer error branch AGENTS.md requires braces on every conditional. --------- Co-authored-by: local <local@example.com> |
||
|
|
02f9754ac7 |
fix(ui): reconnect the UI sidecar without restarting Floci (#2718)
* fix(ui): reconnect the UI sidecar without restarting Floci The floci-ui sidecar's FLOCI_ENDPOINT is baked in at container-create time, but Floci's container IP changes on every restart. adoptExisting() took over a surviving sidecar verbatim and never compared its endpoint against the current one, so the sidecar kept polling the previous instance's address indefinitely. The dashboard reported "Not connected" with ECONNREFUSED and the only way out was to recreate the sidecar by hand -- in practice, by restarting the emulator alongside it. Detect that drift on adoption and recreate the sidecar instead, so recovery stays entirely within the sidecar's own lifecycle and never requires disturbing Floci. Two supporting changes: - status() re-arms ensureStarted() when the readiness probe fails. started was a one-way latch, so a sidecar that was removed, crashed, or turned out to be stale left Floci with no path back. The UI polls status continuously, which supplies the retry cadence. - UiServiceConfig gains endpoint() and insecureSkipTlsVerify(). With TLS on, the derived endpoint is https://<floci-container-ip>:<port>, which the sidecar's Node/Bun proxy rejects: the self-signed certificate has no IP SAN for Floci's own container address, so verification fails with ERR_TLS_CERT_ALTNAME_INVALID even once the CA is trusted. Trusting the CA alone is therefore not enough. endpoint() lets an operator point the sidecar at http://<ip>:<port> -- the same server, via the port's HTTP/HTTPS protocol detection, with TLS left enabled -- and insecureSkipTlsVerify() covers the case where https must be kept. A blank or malformed override is a hard error, not a silent fall back to the derived endpoint. * fix(ui): derive http for the sidecar when the host is a bare IP With TLS enabled the endpoint handed to the UI sidecar was derived as https://<floci's own container IP>:4566. That address can never appear in the self-signed certificate: it is assigned at container-create time and changes on every recreate, and the certificate is generated by a ConfigSource that runs before CDI, with no Docker client to ask what the address will be. Every connection therefore failed altname verification — not chain trust, so mounting the CA would not have helped either — and the dashboard sat at "Not connected" with no path back. Nothing in the manager notices: the sidecar is running, so the re-arm added in 8f4fd900 correctly declines to replace it, and the readiness probe only checks the sidecar's own port, never the hop that is broken. Floci's listener does HTTP/HTTPS protocol detection on the same port, so http:// reaches it with TLS left enabled. That is one hop on an internal Docker network, not the emulator, and it is the only scheme that works unattended on the default configuration. A named host such as host.docker.internal is a DNS SAN on the certificate and keeps https. So does an IP literal when insecure-skip-tls-verify is set, since the operator has said explicitly that they want TLS on this hop and verification is no longer the obstacle. isIpLiteral mirrors the iPAddress/dNSName distinction CertificateGenerator already draws, kept local so this package does not depend on the ACM service for one predicate. * fix(ui): bracket an IPv6 host so the sidecar endpoint parses The endpoint was built by concatenating host and port, which produces http://fd00::2:4566 when the resolver hands back an IPv6 literal — the port separator is indistinguishable from the address's own colons and no client can parse it. DockerHostResolver reaches that case through InetAddress.getLocalHost().getHostAddress() on an IPv6-only host. Bracket the authority host. Names and IPv4 literals are unchanged. * fix(ui): reset the async re-arm latch and stop swallowing pre-start failures Local code review (review-local.ts) against FlociUiManager.java found two HIGH-severity bugs before this branch reached a PR: - ensureStartedAsync()'s kicked latch was only reset after a FAILED start, never after a successful one. status()'s self-recovery path sets started=false and calls ensureStartedAsync() when the sidecar is gone, but after any prior successful async start that CAS always failed silently -- the documented "recovers without Floci being restarted" behavior could never actually fire. - findByName() and replaceIfEndpointDrifted() ran before ensureStarted()'s try/catch. A container-runtime failure there (e.g. an unreachable Docker socket) escaped uncaught to a synchronous caller, or vanished into a discarded Future on the async path, leaving status() reporting {started:false, ready:false, error:null} with no diagnostic. Reset kicked whenever status() re-arms a lost sidecar, and move the whole body of ensureStarted() into the try/catch so every failure is routed through lastError. A misconfigured endpoint override's own validation message (set by replaceIfEndpointDrifted before it rethrows) is preserved rather than overwritten by the generic describeStartFailure() message. * fix(ui): validate endpoint override authority and capture fresh-start errors - validateEndpointOverride() now rejects http:// URLs with no authority (e.g. "http://", "http:///path"), which previously passed the bare prefix check and were injected as an unreachable FLOCI_ENDPOINT. - ensureStarted()'s IllegalStateException handler now fills lastError when nothing more specific was already recorded, so a fresh start (no existing sidecar to adopt) with a blank/malformed endpoint override surfaces the validation message instead of error=null. - Document the new endpoint and insecure-skip-tls-verify settings in application.yml's floci.services.ui block. |
||
|
|
ff36141c19 |
perf(cloudformation): probe Lambda S3 code with headObject, not getObject (#2728)
Resolving an AWS::Lambda::Function whose Code points at S3 checked the object by calling getObject and discarding the result. S3Object.getData() is a materialised byte array, so that read the whole package into memory purely to answer whether it was readable, and LambdaService then read the same object again for real during CreateFunction. Every stack create or update paid for two full copies of every Lambda package it provisions. headObject answers the same question without the body: getObject is getObjectMetadata plus readFile, headObject is getObjectMetadata alone. Both resolve the object through that same metadata lookup, so a missing key or bucket still fails the resource exactly as before, and the failure behaviour added for #2648 is unchanged. Closes #2675 |
||
|
|
e2e69f65f5 |
feat(core): add configurable mock responses for stub AI services (#2765)
* feat(core): add configurable mock responses for stub AI services Adds AiMockConfigLoader, a shared mock-response config file (path via AI_MOCK_CONFIG env var or floci.ai-mock-config-file) that lets callers override Textract/Comprehend/Rekognition's fixed stub responses on a per-call basis, so application logic that branches on detection results (e.g. "escalate if sentiment is NEGATIVE") can be exercised end-to-end against floci. Mirrors Step Functions' SFN_MOCK_CONFIG mechanism (same mtime-cached reload without restart), but is shared across three services and never throws: a missing file, unset env var, or no matching entry all fall back to the existing default stub, since mocking here is opt-in on top of an always-available default, not the only way to invoke an action. Lookup keys: Comprehend keys on the exact Text value; Textract and Rekognition key on "<Bucket>/<Name>" from S3Object (a Bytes-backed image/document has no such key, so mocking only applies to S3Object-based calls). CompareFaces keys off SourceImage only. The Textract async Start*/Get* job flow does not support mocking. Closes #2764 * fix(core): catch unchecked exceptions when loading AI mock config Path.of(path) throws InvalidPathException (unchecked) for a malformed path string, and filesystem access can raise other unchecked exceptions IOException alone doesn't cover. load() only caught IOException, so a bad AI_MOCK_CONFIG value would propagate past the loader and turn a normal Comprehend/Textract/Rekognition request into a 500 — the exact opposite of this loader's contract (mocking is optional; it must never break the default stub). Wrapped the load logic in an outer catch (RuntimeException) that falls back the same way the existing IOException cases already do. Addresses review feedback on #2765. |
||
|
|
0b46d804c0 |
feat(codegurureviewer): repository association lifecycle with tagging (#2741)
* feat(codegurureviewer): repository association lifecycle with tagging AssociateRepository, DescribeRepositoryAssociation, DisassociateRepository and ListRepositoryAssociations over CodeGuru Reviewer's REST JSON protocol, with TagResource/UntagResource/ListTagsForResource served on the shared /tags path. The Repository union is validated as AWS validates it (exactly one provider, Owner/ConnectionArn for third-party providers, KMSKeyId required for CUSTOMER_MANAGED_CMK), duplicate associations report ConflictException, and an association is Associated from the first read so provider waiters complete immediately. * fix(codegurureviewer): paginate ListRepositoryAssociations, register the model for reflection, generate the action table ListRepositoryAssociations now honours MaxResults and NextToken with real pagination (the filter query keys stay singular - ProviderType, State, Name, Owner - matching the wire mapping the API reference documents for the plural request fields). RepositoryAssociation carries @RegisterForReflection so native-image persistence survives a restart. The docs page now uses the generated action-table markers, has its service-matrix row, and maps the hyphenated codeguru-reviewer signing name to its doc slug. * fix(codegurureviewer): reject a malformed MaxResults with ValidationException, not 404 A JAX-RS Integer binding fails during parameter conversion, so MaxResults=abc surfaced as 404 before the handler ran. The parameter is now bound as a String and parsed in the controller, routing bad values through the modeled 400 ValidationException. |
||
|
|
eaecb36425 |
fix(eks): implement cluster restoration after restart to maintain state (#2780)
Signed-off-by: Matheus André <matheusandr2@gmail.com> |
||
|
|
cfe8566511 |
fix(cloudwatch): evaluate alarms over CloudWatch's wider evaluation range (#2771)
Querying exactly EvaluationPeriods buckets fell back to TreatMissingData as soon as one was empty. Real datapoints reaching further back now decide the state first, and the premature-transition rule is honored. Fixes #2700 Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> |
||
|
|
2a014d2add |
fix(s3): accept the log-delivery-write canned ACL (#2653)
PutBucketAcl/PutObjectAcl rejected x-amz-acl: log-delivery-write with "Unsupported x-amz-acl value", even though it is a standard AWS canned ACL (Terraform's aws_s3_bucket_acl / access-logging modules send it to grant the S3 log-delivery service group permission to write access logs into a bucket). Of the eight AWS canned ACL values, this was the only one missing from cannedObjectAclXml's switch - the rest were already handled. Add the log-delivery-write case, translating it to WRITE and READ_ACP grants for the well-known LogDelivery group URI (http://acs.amazonaws.com/groups/s3/LogDelivery), following the same groupGrant pattern used for public-read/public-read-write. |
||
|
|
6a1d86e43f | fix(cloudformation): resolve IAM assume role policy intrinsics (#2630) | ||
|
|
2e5935d764 |
fix(s3): prevent compliance retention downgrade (#2755)
* fix(s3): prevent compliance retention downgrade * fix(s3): allow updates after compliance expiry |
||
|
|
2bc37365dc | fix: update .gitignore to include .mission/ for shared tooling visibility (#2750) | ||
|
|
51edccacbf |
fix(cloudformation): adopt managed policy on stack update (#2717)
* fix(cloudformation): adopt managed policy on stack update A stack UPDATE whose template kept an AWS::IAM::ManagedPolicy's name unconditionally re-ran CreatePolicy, failed with EntityAlreadyExists, and rolled the whole stack back — LZA's second-pass OperationsStack died on exactly this (AWSAccelerator-SessionManagerLogging). Mirror the role provisioner's adopt path: when the stack already owns the policy ARN and identity matches the stored PolicyId, publish the new document as the default version instead, pruning oldest non-default versions at IAM's 5-version cap so repeated updates never hit LimitExceeded, and detach roles dropped from the template. Rollback cleanup now only deletes the policy when this attempt created it and never detaches attachments that predate the attempt. * fix(cloudformation): close managed-policy adopt gaps in update rollback Require PolicyId to match on adopt: a resource that predates PolicyId tracking would silently adopt any policy sharing its ARN, including one deleted and recreated under the same name by someone else. Also restore the prior default policy version and reattach detached-as-obsolete roles when a role attach fails mid-update, and treat NoSuchEntity on the obsolete-role detach as idempotent like the delete path already does. * fix(cloudformation): restore managed-policy rollback on obsolete-role detach failure A non-NoSuchEntity detachRolePolicy failure while dropping an obsolete role during a managed-policy update escaped before the attach loop's rollback ran, since it lives in an earlier try/catch in the same method. The policy's new default version and any already-detached roles were left unrestored even though the stack reported UPDATE_ROLLBACK_COMPLETE. Extract the attach loop's restore logic into restoreManagedPolicyOnUpdateFailure and call it from the detach loop's catch too, so any failure after the version bump restores the prior default version and reattaches roles detached so far in the same pass. * fix(cloudformation): surface failed managed-policy rollback cleanup as UPDATE_ROLLBACK_FAILED A compensating reattach/version-restore failure during a managed-policy update rollback was tracked in cleanupSucceeded but never written to UPDATE_ROLLBACK_FAILURE_ATTR, so the caller assumed the resource was fully restored and reported UPDATE_ROLLBACK_COMPLETE even when the new policy document or a role attachment was left in a partially-rolled-back state. * fix(cloudformation): recreate pruned policy version content on update rollback Pruning an old policy version to stay under IAM's 5-version cap happened before the fallible role attach/detach operations that can trigger a rollback. A failure there restored only the default version and deleted the stray new version, but never recreated the pruned version's content — the stack reported UPDATE_ROLLBACK_COMPLETE while having permanently destroyed a policy version that existed before the update. Deleting the stray version now runs after restoring the prior default (real AWS forbids deleting the current default version), which frees the slot needed to recreate each pruned version's document as a new non-default version, so a full rollback genuinely restores what existed before the update instead of just claiming to. |
||
|
|
7b6266e902 |
feat(connect): instance management (CreateInstance family, attributes, storage configs, tags) (#2740)
* feat(connect): instance management (CreateInstance family, attributes, storage configs, tags) Amazon Connect control plane: CreateInstance/DescribeInstance/ListInstances/ DeleteInstance, instance attributes, instance storage configs, and resource tagging over REST JSON, registered under the connect signing name. Instances report ACTIVE from the first read so the Terraform provider's status poll completes immediately. 17 integration tests cover the lifecycle, attribute validation against the AWS InstanceAttributeType/DirectoryType/InstanceStorageResourceType enums, storage-config association, and tag round-trips. * docs(connect): register connect in the action-table catalog The Action-tables CI gate requires every service registered in ResolvedServiceCatalog to have an index row and a generated action table; connect's page was hand-written and unregistered. * fix(connect): validate boolean instance attribute values UpdateInstanceAttribute stored any nonblank string while the inbound/outbound flags coerced it to boolean, so an invalid value read back inconsistently across DescribeInstanceAttribute and DescribeInstance. Reject anything but true/false with InvalidParameterException and store the canonical lowercase form. |
||
|
|
91c1042656 |
test(stepfunctions): restore AslExecutorTaskHistoryEventsTest compilation (#2729)
main has not compiled its test sources since |
||
|
|
fc3c28323a |
feat(ses): support v2 tenant suppression attributes and tenant-scoped suppression list (#2743)
* feat(ses): support v2 tenant suppression attributes and tenant-scoped suppression list * fix(ses): guard runWithTenant against a null TenantName * fix(ses): collapse an absent TenantName to the service-level message on tenant suppression ops * fix(ses): collapse an absent TenantName to the service-level message on the remaining tenant ops * fix(ses): collapse an empty TenantName to the service-level message on GetTenant/DeleteTenant |
||
|
|
12a6feb0c9 |
refactor(cloudformation): move the single-service types to provisioners (#2744)
Migrates the seven resource types whose provisioning is one service call: KMS Key and Alias, SSM Parameter, ECR Repository, Pipes Pipe, Kinesis Firehose DeliveryStream, and CDK Metadata. Behaviour-preserving move: the bodies are ported verbatim apart from the mechanical rewrites onto ProvisionContext, so physical ids, Fn::GetAtt keys and delete calls are unchanged. Each provisioner injects only the service it wraps, so five service fields leave the monolith. Their constructor parameters stay, unused, until the final cleanup drops them all at once; shrinking the signature now would churn the fixture for no gain. parseCfnTags, blankToNull and parseIntProp are copied rather than shared, because each still has callers in the monolith. ProvisionContext.resolveTags is deliberately NOT substituted for parseCfnTags: it skips a blank key that parseCfnTags keeps, orders entries by insertion rather than hash, and resolves the whole property so an Fn::If around the list works. Adopting it is a behaviour change and belongs in its own PR. CDK::Metadata gains a real provisioner rather than staying on the stub arm. The stub reports CREATE_COMPLETE with a synthetic id and a fake Arn attribute; the real type has no attributes at all. Tests assert the exact physical id and the exact Fn::GetAtt keys against each type's registry schema, plus delegated arguments and delete calls. Asserting status alone would pass against the stub arm. |