mirror of
https://github.com/floci-io/floci.git
synced 2026-11-25 23:00:59 -05:00
14f99a512304160849e2c1922791bb36850f8708
11
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
97ff0bc3e9 |
feat(elasticache): support cluster-mode replication groups (#2633)
* feat(elasticache): support cluster-mode replication groups CreateReplicationGroup now provisions a real sharded Valkey cluster when the request asks for one (NumNodeGroups > 1, a cluster.on parameter group, or ClusterMode=enabled): one cluster-enabled container per node, formed via config epochs, MEET, slot assignment and replica attachment, each fronted by its own auth-proxy port announced to clients via cluster-announce-client-ipv4/cluster-announce-port so CLUSTER SLOTS and MOVED redirects point at reachable addresses. DescribeReplicationGroups reports the topology honestly (ClusterEnabled, NodeGroups with Slots, MemberClusters, Engine, ARN, AutomaticFailover), and replication-group members answer DescribeCacheClusters, which is where terraform-provider-aws reads node type, engine version and port from. Adds a terraform compatibility test that applies an aws_elasticache_replication_group with num_node_groups and replicas_per_node_group, asserts the data plane is a formed cluster running in cluster mode (INFO cluster / CLUSTER INFO over RESP through the proxy), and that a re-plan straight after apply is clean. * fix(elasticache): address cluster-mode review feedback and compat CI failure - bump compat-terraform aws-cli image to 2.34.32 so botocore models include ReplicationGroup.Engine (old pin silently dropped the field) - restore cluster-mode runtime state (ports, containers, proxies, cluster formation) after restart; mark groups create-failed on error - announce configured hostname to Valkey nodes so MOVED redirects and CLUSTER SLOTS return client-reachable endpoints - log swallowed socket-close failures in cluster formation * fix(elasticache): report restore-failed members and modeled node-group quota fault Review follow-up for cluster-mode support: - Member cache clusters mirror their group's status instead of a hardcoded "available", so a group marked create-failed by a failed restore no longer contradicts its own members in DescribeCacheClusters. CacheClusterStatus has no create-failed value, so failed members report the documented restore-failed. - NumNodeGroups above the 500 ceiling surfaces the modeled NodeGroupsPerReplicationGroupQuotaExceeded fault instead of a generic InvalidParameterValue. - Javadoc names ClusterMode=compatible handling and the cluster-mode-only restore scope as deliberate. * fix(elasticache): announce a client-resolvable hostname for cluster mode Cluster-mode nodes announced FLOCI_HOSTNAME verbatim, so the shipped Docker Compose deployment baked the Compose-only name 'floci' into MOVED/ASK redirects and topology responses, breaking cluster-aware clients connecting from outside the Compose network. Add FLOCI_SERVICES_ELASTICACHE_CLUSTER_ANNOUNCE_HOSTNAME (default: FLOCI_HOSTNAME) used for the announced name and the reported ConfigurationEndpoint, and set it to localhost.floci.io in docker-compose.yml — public DNS resolves it to 127.0.0.1 on the host while the network alias and Floci's embedded DNS resolve it to the Floci container from inside Docker. * fix(elasticache): restore cluster-mode groups without blocking startup Restoring persisted cluster-mode groups ran serially in the synchronous startup path, so a slow or unavailable Docker daemon could hold up emulator readiness by a container-readiness plus cluster-formation timeout per group, timing out readiness-dependent clients such as Testcontainers. restorePersistedRuntime now reserves each node's proxy port and marks groups creating synchronously - so no request can claim a persisted port or see a stale available status - then brings containers, cluster formation and proxies back in the background, flipping each group to available or create-failed as its restore finishes. --------- Co-authored-by: kurtmc <2661907+kurtmc@users.noreply.github.com> |
||
|
|
75f8f42d5f |
fix(elasticache): keep a replication group's encryption, snapshot settings, tags and ARN (#2632)
* fix(elasticache): keep a replication group's encryption, snapshot settings, tags and ARN DescribeReplicationGroups wrote AtRestEncryptionEnabled and SnapshotRetentionLimit as constants and never emitted KmsKeyId, SnapshotWindow or ARN, so a group created with them drifted on the next Terraform plan (kms_key_id forces replacement) and its tags, given at create, could not even be asked for without an ARN. Store the four settings and the tags on the group, resolve KmsKeyId through the KMS store in the request's region to the key ARN a live account reports, apply the snapshot settings from ModifyReplicationGroup, emit them with the ARN, and answer ListTagsForResource for replicationgroup ARNs — for the record the ARN names, since the store keys groups by id alone. Delete and modify of a group now share one monitor, so a modify cannot write the group back after a delete removed it. Validation and wording follow a live account. Closes #2615 * fix(elasticache): refuse a KMS key with encryption at rest omitted, and change nothing on a refused modify An omitted AtRestEncryptionEnabled is false on a live account and a KmsKeyId is refused with it the same way as with an explicit false. ModifyReplicationGroup applied the snapshot settings to the store's own object before validating the user ids, so a request refused for an unknown user had already changed the group; every check now runs before any change. * fix(elasticache): read AtRestEncryptionEnabled as a live account does, and refuse an empty snapshot window A live account reads any AtRestEncryptionEnabled value that is not "false" as true — banana, yes and "TRUE " all created an encrypted group — so the flag is read the same way rather than parsed strictly. A snapshot window whose end equals its start was measured as a full day; a live account refuses it as shorter than an hour. |
||
|
|
06d58aad36 |
feat(elasticache): support cache subnet groups (#2401)
* feat(elasticache): support cache subnet groups CreateCacheSubnetGroup was unsupported, so aws_elasticache_subnet_group could not be created and no Redis or Valkey module placing a cluster in a VPC could apply. DescribeCacheSubnetGroups already answered with an empty list, so the read half existed with nothing behind it. Adds Create, Modify and Delete, and makes the describe return what was created. A group's VpcId and each subnet's availability zone come from the subnets rather than the request, because that is where AWS reads them: resolving the subnets against EC2 is part of answering, not an optional check. The service follows the RDS DB subnet group, which faces the same problem. Taken from a live account: the create response and its ARN, SupportedNetworkTypes on both the group and each subnet, and the error for each rejection — subnets that do not exist, subnets spanning two VPCs, a duplicate group, and a name that breaks the identifier rule. Describe and delete word their not-found differently from one another, and both are reproduced as AWS words them. Tags given at create are stored and readable through ListTagsForResource, rather than accepted and dropped. A modify naming no subnets keeps the stored ones as they are instead of resolving them again, which would fail a description-only change if a subnet had since been deleted. * fix(elasticache): resolve subnet group subnets in the caller's region CreateCacheSubnetGroup and a subnet-changing ModifyCacheSubnetGroup looked the subnet ids up in the configured default region. A caller in any other region had its own subnets rejected as invalid, and the group was reported under an ARN built from the caller's region while its VPC and availability zones came from somewhere else. Resolve against the request's region, which is the region the ARN already uses. * fix(elasticache): report a subnet group's subnets in the order they were given describeSubnets answers in the subnet store's own scan order, and the group was built by iterating that answer, so the order a group reported its subnets in was arbitrary between calls — the model documents the order the caller gave. Build the zone map from the requested ids. Adds a CLI case covering the region the subnets are resolved in, which is what caught this: it read Subnets[0] and disagreed with itself between runs. * fix(elasticache): answer a missing cache subnet group with 400, not 404 The service model declares CacheSubnetGroupNotFoundFault a 400, where the parameter-group fault a few hundred lines up is a 404 — the two really differ, in the wire code as well as the status, and the status was carried across from the parameter-group code. All three sites answered 404, and the integration test pinned it there, so a client reading the status saw the wrong one. The difference is now stated where the copy would be made, since either fault looks like a mistake beside the other. |
||
|
|
6b628179f3 |
feat(elasticache): support cache parameter groups (#2392)
* feat(elasticache): support cache parameter groups CreateCacheParameterGroup was unsupported, so a Redis module that sets any parameter could not apply at all — most set at least maxmemory-policy. The describe was a stub that answered with an empty list whatever was asked of it. Adds the group surface over the Query protocol: - CreateCacheParameterGroup, DescribeCacheParameterGroups, ModifyCacheParameterGroup, DescribeCacheParameters, DeleteCacheParameterGroup - ListTagsForResource for a parameter group ARN, without which the tags a create carries would be stored and never readable - the default.* groups AWS publishes for all 13 families, derived rather than stored: nothing can modify or delete them, so persisting them would only add records to migrate and a writer to race Taken from a live account: the create response and its ARN, IsGlobal, and the error each rejection carries — CacheParameterGroupAlreadyExists for a duplicate, CacheParameterGroupNotFound for an unknown group, and the identifier rule that rejects a name containing a dot, which is also how AWS refuses to delete a default group. Each writer takes one monitor keyed by the group name before it reads. Guarding the record cannot serve a create, which has no record yet, so two of them would both pass the existence check; and a modify that resolved its record before locking would write back a group a concurrent delete had removed. floci does not carry AWS's per-family catalogue of parameter names, so it stores what a caller sets and reports it with source "user". Rejecting names missing from a partial catalogue would refuse configurations AWS accepts, so nothing is rejected on that basis, and a request for system parameters returns none rather than reporting user parameters under another source. * fix(elasticache): answer tags for the ARN that was asked about ListTagsForResource read the trailing name out of the ARN and ignored the rest, so an ARN naming another account or region was answered with this caller's group of the same name — a response describing a different resource than the request identified. The ARN is now checked before it is used, with the errors AWS gives for each: InvalidARN for a string that is not seven components, "Unauthorized call. Please check the region or customer id" for another region, "The resource ARN does not belong to the caller's account." for another account, and "<name> is not present" for a group that does not exist, which is worded differently from the describe's not-found. Tightening the tolerated exception in the race test, as review asked, turned up a second problem: a modify whose group had been deleted reported "is a default group and cannot be modified", because absence from the store was read as proof of a published default. The two are now told apart, and both errors are asserted directly rather than only when the race happens to expose them. * fix(elasticache): check every component of a tag ARN, not only region and account An ARN in another service's namespace was accepted as long as its region and account matched, so arn:aws:rds:<region>:<account>:parametergroup:<name> was answered with the ElastiCache group of that name — tags for a resource the caller did not ask about. The partition and service are checked too, with the errors AWS gives: "partition field is wrong. Expected value is aws" and "service field is wrong. Expected value is elasticache". * fix(elasticache): word each parameter group not-found the way AWS words it Three actions, three sentences on a live account. Delete omits the space after the type name — that is verbatim, and the line now says so, because it reads like a typo and the next person to tidy it would silently stop matching AWS. Modify was the one that was actually wrong: it answered with describe's sentence. A live account words it "CacheParameterGroup not found: <name>", which is neither describe's nor delete's. Pinned by a test that asserts all three, so the odd one cannot be quietly aligned with the others. |
||
|
|
de9a930e85 | docs: sync service action tables (#1769) | ||
|
|
7d70f64162 |
feat(docs): generate Supported Actions tables from handler source (#1641)
* feat(docs): generate Supported Actions tables from handler source The "Supported Actions" tables in docs/services/*.md were hand-maintained and drifted from the handlers. For example secrets-manager.md omitted RestoreSecret, which SecretsManagerJsonHandler dispatches, and acm.md listed RenewCertificate, which is not implemented anywhere in src/. Derive the action list from handler source so it cannot drift, while keeping the hand-written Description column: - tools/docs/regen_action_docs.py extracts actions from `case "X" ->` switch arms (including multi-label arms) and JAX-RS REST controllers, and rewrites only the rows between the <!-- floci:actions --> markers. Descriptions are preserved by action name; new actions get a "-" placeholder. PascalCase-only matching avoids picking up SCREAMING_CASE labels from non-action switches. - tools/docs/services.yaml registers 18 single-table switch services and lists the remaining switch handlers under deferred_handlers, so the new-service sentinel fires only on a genuinely unregistered handler. - make docs-sync / docs-check / docs-test, plus a Python-only CI workflow that gates on handler, doc, and tooling changes. - Migrate 18 service docs into marker blocks, reconciling real drift (adds RestoreSecret, ImportCertificate, and others; drops the unimplemented RenewCertificate). Revives the parser and CI gate from #738 by @ericbsantana and completes the description-preservation its spec described. REST-mode, mixed-mode, multi-table, non-tabular, S3, and ecr docs are deferred and tracked in deferred_handlers. * docs: drop standalone design spec from action-docs tooling Remove ideas/auto-generated-action-tables.spec.md and the four references to it (CONTRIBUTING.md, Makefile, regen_action_docs.py docstring, services.yaml). It was a planning artifact; the operational docs live in CONTRIBUTING.md and the tooling is self-documenting. The #738 / @ericbsantana credit is preserved in the PR description. * chore: address review on action-docs tooling - pin actions/checkout to v7.0.0 in docs-actions workflow to match the repo-wide bump (#1690), so dependabot does not immediately flag the new file - document in the generator docstring that a switch case label counts as supported purely by existing, so a per-action UnsupportedOperation stub would be a false positive (handlers here reject from the default arm) * docs: regenerate action tables against current handler source Resync the generated Supported Actions tables to handler source after rebasing onto the latest main: - cloudformation: add DescribeStackInstance and DescribeStackSetOperation now emitted by the handler, and keep the implemented StackSet descriptions - cloudtrail: add LookupEvents - firehose: add UpdateDestination - step-functions: add PublishStateMachineVersion, ListStateMachineVersions, DeleteStateMachineVersion - register the cloudcontrol handler in deferred_handlers so the strict unregistered-handler gate passes (no standalone action table yet) * fix(docs): prevent action-table generator from silently dropping actions Address the latest review pass on the action-docs tooling: - switch extraction now captures case arms whose labels wrap across lines (valid Java 14+ syntax). The capture group excludes only `{ } ;` boundaries, so it spans newlines between labels but stops at the arm's `->`. A wrapped arm was previously missed, and docs-check would stay green because the doc and the generated output agreed on the omission, defeating the whole drift-prevention guarantee. - REST extraction skips Javadoc / inline comments between a verb annotation and the method signature; such a line otherwise reset the lookahead and dropped the action. - parse_marker_block raises a descriptive error when a marker is not on its own line, instead of a bare "substring not found". - doc, source, and registry reads/writes are pinned to UTF-8 so generation is locale-independent (the docs contain non-ASCII text). - the docs-actions push trigger watches Makefile and the workflow file, matching its pull_request trigger. Adds regression tests for the multi-line arm and comment-skip paths (20 total). |
||
|
|
9e35046647 |
Docs/enviroment instead yml (#764)
* docs: moving all config to env instead of yml * docs: sync with main and new features * docs: reverting docker-compose.yml |
||
|
|
88f40a839b |
docs: update Docker image references to floci/floci (#595)
* docs: update Docker image references to floci/floci * docs: keep README Docker Hub badges pointing to hectorvent/floci The hectorvent/floci image has accumulated pull and size metrics; switch the badges to floci/floci once the new image has comparable numbers. |
||
|
|
4f0150870a | feat(docker): centralize Docker config and add private registry authentication (#549) | ||
|
|
a32b7f1f3b |
docs: comprehensive audit sweep + CHANGELOG backfill (1.1.0-1.5.2) (#326)
CHANGELOG.md was empty for the 1.1.0-1.5.2 release cycle and service docs had drifted from code behaviour. This sweep reconciles docs against the current codebase on upstream/main. - Backfill CHANGELOG.md for 1.1.0 through 1.5.2 from git history - Correct exact operation counts in docs/services/index.md: S3 (~30 -> 58), Lambda (~25 -> 30), API Gateway v1 (~24 -> 62). Counts now come from the actual dispatch handlers rather than @Path annotation counts. - Rewrite README "Supported Services" table to drop per-service op counts (they drift too fast); point readers at docs/services/index.md - Update 24 service docs for accuracy, add "Not Implemented" sections where relevant (s3.md, lambda.md, api-gateway.md) - Refresh configuration and getting-started docs - Add EventBridge Scheduler and AppConfig to mkdocs nav - Add AppConfig / AppConfigData rows to README and services index following the 1.5.2 upstream release |
||
|
|
61433f59ab | firt commit |