* feat(redshift-serverless): add running workgroups and Data API WorkgroupName support Redshift Serverless workgroups get full CRUD (Create/Get/List/Update/Delete), tagging by ARN, and the AWS::RedshiftServerless::Namespace and ::Workgroup CloudFormation types with dotted Fn::GetAtt keys taken from the registry schema. A namespace has at most one workgroup, and DeleteNamespace is refused while one is attached. Each workgroup runs a PostgreSQL container behind an authenticating proxy, sharing the managers and the proxy port pool with provisioned Redshift. Add GetCredentials, accept WorkgroupName (name or ARN) in the Redshift Data API, and push a changed namespace adminUserPassword down to the running backend. The runtime is re-attached when Floci restarts. Not covered: snapshots, usage limits, endpoint access, and COPY/UNLOAD/Spectrum on workgroups. * fix(redshift-serverless): stop the runtime when workgroup creation fails after it started If persisting the workgroup record failed after the container and proxy were already running, the runtime was left behind with no record. createWorkgroup now stops it (best effort) and releases the endpoint on the failure path. Fix the CloudFormation error for a NamespaceName change: suggesting a new WorkgroupName can never succeed because a namespace holds only one workgroup. * fix(redshift-serverless): reset omitted CloudFormation properties and order startup observers When UpdateStack drops a property from the template, the provisioner now sends its default (BaseCapacity, EnhancedVpcRouting, PubliclyAccessible, Port, TrackName, PricePerformanceTarget) instead of keeping the stored value, which matches CloudFormation semantics. MaxCapacity has no default and keeps its stored value. Give the workgroup StartupEvent observer a @Priority after RedshiftService so every persisted cluster has reserved its proxy port before workgroups restore theirs. Also remove an unused import and move DEFAULT_DATABASE to the top of RedshiftContainerManager. * fix(redshift-serverless): address review findings on password rotation and namespace updates - Roll the backend password back when a rotation cannot be completed or stored, and apply it last so validation failures never leave the backend ahead of the stored namespace. - Keep a workgroup endpoint reserved when its runtime cannot be stopped during clear(). - Reject an in-place DbName change in CloudFormation, since it is fixed at creation. - Reset an omitted KmsKeyId and DefaultIamRoleArn on CloudFormation updates. * fix(redshift-serverless): keep rollback failures from masking errors and drop stale GetAtt role - Do not reset the proxy password when the role restore fails, and attach restore failures to the original exception instead of replacing it. - Remove Namespace.DefaultIamRoleArn from the stack resource when an update no longer declares a default role. * docs: correct the Redshift Serverless operation count in the service matrix * fix(redshift-serverless): expose Workgroup.ConfigParameters through Fn::GetAtt * fix(redshift-serverless): parse ConfigParameters resolved from a GetAtt attribute * docs(redshift-serverless): list every unsupported operation group
11 KiB
Redshift Serverless
Protocol: JSON 1.1
Endpoint: POST http://localhost:4566/ with X-Amz-Target: RedshiftServerless.<Operation> and Content-Type: application/x-amz-json-1.1
Floci emulates the namespace and workgroup lifecycle of Amazon Redshift Serverless: the account and Region scoped namespace that holds a serverless database, its admin credentials, and its IAM roles, and the workgroup that carries its compute settings and endpoint. This is the surface Terraform's aws_redshiftserverless_namespace and aws_redshiftserverless_workgroup drive, and the surface the AWS::RedshiftServerless::Namespace and AWS::RedshiftServerless::Workgroup CloudFormation types provision.
For the upstream API shape, see the Amazon Redshift Serverless API Reference.
Supported Actions
| Action | Description |
|---|---|
CreateNamespace |
Create a namespace, applying AWS defaults for dbName, kmsKeyId, and logExports |
GetNamespace |
Return a namespace by name |
ListNamespaces |
Page through the namespaces in the account and Region |
UpdateNamespace |
Apply the supplied fields to an existing namespace and return it |
DeleteNamespace |
Remove a namespace and return it with status DELETING |
CreateWorkgroup |
Create a workgroup in a namespace that has none, applying AWS defaults, starting its container and proxy, and returning its endpoint |
GetWorkgroup |
Return a workgroup by name |
ListWorkgroups |
Page through the workgroups in the account and Region |
UpdateWorkgroup |
Apply the supplied fields to an existing workgroup and return it |
DeleteWorkgroup |
Stop a workgroup's container and proxy, release its endpoint, and return it with status DELETING |
GetCredentials |
Mint a temporary database user and password for a workgroup, valid on its endpoint until expiration |
ListTagsForResource |
Return the tags on the namespace or workgroup named by resourceArn |
TagResource |
Merge tags into the namespace or workgroup named by resourceArn |
UntagResource |
Remove tags by key from the namespace or workgroup named by resourceArn |
Namespace and workgroup state is account and Region scoped and persisted through StorageFactory.
Compatibility Notes
- A workgroup runs a real PostgreSQL container.
CreateWorkgroupstarts the container (this needs Docker and usesfloci.services.redshift.image-version) and an authenticating proxy on theendpoint, whose port comes from the same pool as provisioned Redshift clusters (floci.services.redshift.proxy-base-porttoproxy-max-port). Connect with any PostgreSQL client or JDBC driver using the namespace admin user and password, to the namespacedbName. The Redshift Data API acceptsWorkgroupName(details). Only the 14 operations in the Supported Actions table are served. The rest of the Redshift Serverless API is not emulated and answersUnknownOperationException: snapshots and snapshot copy configurations, recovery points, table restore and restore status, usage limits, endpoint access, resource policies, custom domain associations, scheduled actions, reservations and reservation offerings, tracks, managed workgroups, the Identity Center token, and lakehouse configuration. - Admin credentials come from the namespace. The backend role is the namespace
adminUsername(defaultadmin) and the password is theadminUserPasswordthe namespace was created with. A namespace created without a password gets a generated one that is kept internally and never returned, so such a workgroup is reachable throughGetCredentialsand the Data API only.manageAdminPasswordstill creates no secret. ChangingadminUserPasswordwithUpdateNamespacetakes effect for new connections and is refused withValidationExceptionif the backend rejects it (AWS password rules: 8 to 64 characters with upper case, lower case and a digit, and none of' " / @). ChangingadminUsernameon a running workgroup does not rename the backend role; the new name is accepted at the proxy, which opens the backend as the original role. GetCredentialsreturns a master-equivalent password.dbUseris derived from the signing identity (IAM:<user>orIAMR:<role>, falling back toIAMR:flociwhen the caller cannot be resolved),dbPasswordis random, andexpirationandnextRefreshTimeare epoch seconds (the same instant).durationSecondsdefaults to 900 and must be 900 to 3600.dbName, when given, must be the namespacedbName.customDomainNameis not supported. A returned credential stays valid until it expires or the workgroup is deleted.- The runtime survives a restart when its container does. On startup Floci re-attaches to the container and restarts the proxy on the same port, so the endpoint is stable. If the container is gone the workgroup comes back with an empty database; if neither can be started, the workgroup stays
AVAILABLE, the Data API reports that its runtime is not available, and the failure is logged. Containers have no Docker volume, as for provisioned clusters. adminUserPasswordis accepted and never returned, matching AWS. No secret is created formanageAdminPassword.- Defaults follow AWS.
dbNamedefaults todev,kmsKeyIdtoAWS_OWNED_KMS_KEY,logExportsto an empty list, andstatustoAVAILABLEimmediately: there is noMODIFYINGorCREATINGphase to poll through. creationDateis an ISO-8601 string, for example2026-09-11T18:12:55.433Z, not the epoch-seconds number that awsJson1.1 uses by default.Namespace.creationDatecarriesTimestampFormatTrait(ISO_8601)in the API model, and strict SDKs reject a number here even though the AWS CLI accepts one. (Not a model-wide rule: roughly half the model's timestamp members carry no format trait and use the epoch default, so check each member when extending this service.)namespaceIdis a generated UUID andnamespaceArnisarn:aws:redshift-serverless:<region>:<account>:namespace/<namespaceId>.DeleteNamespacereturns the deleted namespace withstatusDELETINGand removes it in the same call, so the nextGetNamespacereturnsResourceNotFoundException.UpdateNamespaceapplies only the fields present in the request. An omitted field keeps its stored value; an explicitly emptyiamRolesorlogExportsarray clears it.- A namespace has at most one workgroup, and a workgroup belongs to exactly one namespace. A second
CreateWorkgroupfor a namespace returnsConflictException, and so doesDeleteNamespacewhile the namespace still has a workgroup. AWS documents the one-to-one relationship; theDeleteNamespacerefusal is the one rule here that is inferred rather than documented, because the API reference listsConflictExceptionfor that call without naming its trigger. - Workgroup defaults follow AWS.
baseCapacitydefaults to 128 RPUs,portto 5439,ipAddressTypetoipv4,trackNametocurrent,pricePerformanceTargetto{"status":"DISABLED"}, andenhancedVpcRouting,publiclyAccessibleandextraComputeForAutomaticOptimizationtofalse.statusisAVAILABLEas soon as the call returns;DeleteWorkgroupreturns the workgroup withDELETINGand removes it in the same call. - Capacity, network and security settings are stored and echoed, not enforced.
baseCapacity,maxCapacity,subnetIds,securityGroupIds,enhancedVpcRouting,publiclyAccessibleandconfigParametershave no effect on the emulator.configParametersreturns only what the caller supplied: AWS also adds a set of default parameters that the API reference does not enumerate, and Terraform treats the attribute as computed, so the difference does not produce a plan diff. portis validated and echoed. It must be in 5431-5455 or 8191-8215. Theendpoint.portis the port Floci allocated, which is what a client connects to.UpdateWorkgroupapplies only the fields present. AWS documents that several parameters cannot be changed in one request; Floci accepts any combination. AtrackNamedifferent from the current one is recorded aspendingTrackNameandtrackNameis unchanged, as AWS switches tracks on the next release.workgroupNameandnamespaceNamecannot be changed.workgroupArnisarn:aws:redshift-serverless:<region>:<account>:workgroup/<workgroupId>, andcreationDateis an ISO-8601 string like the namespace one.workgroupVersion,patchVersion,crossAccountVpcs, the custom domain members andendpoint.vpcEndpointsare omitted.- Tagging is keyed by
resourceArn, not by name, and namespaces and workgroups are the taggable Redshift Serverless resources in Floci.TagResourcemerges into the existing tags rather than replacing them,UntagResourceremoves by key, and any ARN that does not name a known namespace or workgroup in the caller's Region returnsResourceNotFoundException. Tags supplied at create are readable throughListTagsForResourceand survive an update.
AWS-compatible failures
Namespace and workgroup names, database names, log export values, ports and workgroup enum members are validated. Floci returns ValidationException for a malformed request, ConflictException when a namespace or workgroup name is already taken, when a namespace already has a workgroup, or when a namespace being deleted still has one, and ResourceNotFoundException for an unknown namespace or workgroup.
AWS also models AccessDeniedException, InternalServerException, and ThrottlingException. Floci does not inject provider-side failures that cannot be derived from the request or emulator state.
Configuration
| Variable | Default | Description |
|---|---|---|
FLOCI_SERVICES_REDSHIFT_SERVERLESS_ENABLED |
true |
Enable or disable Redshift Serverless |
Workgroup containers and proxies use the floci.services.redshift.* settings: image-version, proxy-base-port and proxy-max-port, endpoint-host, docker-network and the proxy connection limits.
Example
export AWS_ENDPOINT_URL=http://localhost:4566
aws redshift-serverless create-namespace \
--namespace-name analytics \
--admin-username admin \
--admin-user-password Secret123! \
--db-name dev
aws redshift-serverless get-namespace --namespace-name analytics
aws redshift-serverless list-namespaces
aws redshift-serverless update-namespace --namespace-name analytics --log-exports userlog
aws redshift-serverless create-workgroup \
--workgroup-name analytics-wg \
--namespace-name analytics \
--base-capacity 32
aws redshift-serverless get-workgroup --workgroup-name analytics-wg
aws redshift-serverless get-credentials --workgroup-name analytics-wg --db-name dev
aws redshift-data execute-statement --workgroup-name analytics-wg --database dev --sql "select 1"
aws redshift-serverless list-workgroups
aws redshift-serverless update-workgroup --workgroup-name analytics-wg --base-capacity 64
aws redshift-serverless delete-workgroup --workgroup-name analytics-wg
aws redshift-serverless delete-namespace --namespace-name analytics