Commit Graph
24 Commits
Author SHA1 Message Date
Vũ Thế Huy 2d85e4ea3b feat(redshift): restore a single table from a snapshot (#8290)
Add RestoreTableFromClusterSnapshot and DescribeTableRestoreStatus for
provisioned clusters, and RestoreTableFromSnapshot, GetTableRestoreStatus
and ListTableRestoreStatus for Redshift Serverless. The table's CREATE TABLE
statement and rows are lifted out of the snapshot dump, renamed, and
replayed in one transaction. The restore runs inside the request, so a
described request is already SUCCEEDED or FAILED.

The name checks, script, pending copy, replay and status of a table restore
live once in RedshiftTableRestorer, and both services keep only their
lookups and storage. ListTableRestoreStatus answers a bad nextToken with
InvalidPaginationException. A Docker backed integration test writes rows,
snapshots, restores under a new name and reads them back, connecting through
RedshiftConnections, and the Redshift compatibility tests share one
TestFixtures.awaitRedshiftConnection.

Closes #7806
2026-11-14 20:43:18 -04:00
Priamo Germosen f09468fb19 feat(redshift): require kms:Decrypt on an encrypted snapshot's key to restore it (#8309)
AWS requires the customer managed key of an encrypted snapshot to be shared
with the account restoring it (Redshift Management Guide, "Sharing a
snapshot"). Neither botocore nor the Service Reference says so, so the
request-resources generator states it in FORWARDED, an evidence entry under
MEASURED's rules: the action and the snapshot type, with the rest read from
the metadata (the key type and format kms:Decrypt acts on, the snapshot
record's KmsKeyId member, the endpoint prefix, kms:ViaService).

Under IAM enforcement a Redshift or Redshift Serverless restore is then also
checked as kms:Decrypt on the key the snapshot records, found in the
snapshot's account, against the key policy and the caller's own policies,
with aws:ViaAWSService and kms:ViaService naming the service's endpoint. KMS
key policies are now evaluated as resource policies.

A key KMS would not use, disabled, pending deletion or not held, refuses the
restore, as KMS refuses the request the service makes with it. A snapshot
under AWS's own key records none, and one under an AWS managed key (a copy
grant made without a key) needs nothing, as AWS writes that key's policy to
let the account use it through the service.
2026-11-14 11:04:31 -04:00
Vũ Thế Huy b658720afe feat: map Redshift IAM credentials to PostgreSQL roles (#8211)
* feat(redshift): map Redshift IAM credentials to PostgreSQL roles
* docs(redshift): document IAM database identity for Redshift services
* fix(redshift): harden Redshift IAM role handover and DbGroups lifecycle
* fix(redshift): grant public schema usage on auto-create and resolve latest credential
* fix(redshift): log in as the IAM-derived role so PostgreSQL blocks the switch back
* fix(redshift): restore the role's own password once the backend login completes
* chore(redshift): write the password tracker lock comment in English
2026-11-14 01:06:59 -04:00
Vũ Thế Huy 8a817ec5e9 feat(redshift-serverless): read and list snapshots another account shares (#7899)
GetSnapshot and ListSnapshots with an ownerAccount other than the caller's now read the
owner's snapshots and return only the ones the snapshot resource policy shares with the
caller. A snapshot is never shared across partitions.
2026-11-12 09:03:53 -04:00
Vũ Thế Huy e37f45f714 feat(redshift-serverless): allow cross-account restore of a snapshot its policy shares (#7801) (#7803)
* feat(redshift-serverless): allow cross-account restore of a snapshot its policy shares (#7801)

RestoreFromSnapshot with an ownerAccount other than the caller's now reads the
snapshot from the owner's account and evaluates its resource policy for
redshift-serverless:RestoreFromSnapshot. A policy that allows the caller or the
caller's account grants the restore, an explicit Deny wins, and a snapshot with
no policy is not shared (AccessDeniedException). The dump is read from the
owner's directory and the restore targets the caller's namespace and workgroup.

* fix(redshift-serverless): restore a shared snapshot by the owner's ARN and check its policy under the service lock

A cross-account RestoreFromSnapshot with the owner's snapshotArn failed validation
because only the caller's account was accepted. The snapshot and its policy were also
checked before the service lock was taken, so a deletion, expiry or policy revocation
could land between the check and the restore. The check now runs under the lock.

* fix(redshift-serverless): evaluate a shared snapshot's policy through a ResourcePolicyProvider (#7801)

Move the snapshot policy check out of the service and into IAM enforcement, as SQS, SNS and S3 do:

- RedshiftServerlessResourcePolicyProvider supplies the snapshot's policy and the account in its ARN.
  A statement with no Resource, as in AWS's own PutResourcePolicy example, applies to the snapshot.
- redshift-serverless leaves NOT_COVERED: namespaces, workgroups and snapshots are found by name through
  StoredResourceArns, and RestoreFromSnapshot and GetSnapshot name the owner's snapshot when ownerAccount is set.
- Drop RedshiftServerlessSharedSnapshots and the snapshot-taking restoreFromSharedSnapshot overload.

* fix(redshift-serverless): derive snapshot account from the generator and find endpoint access ARNs (#7801)

Take ownerAccount as an account member in the request-resources generator and honor
account on found resources, replacing the hand-written CORRECTIONS entries and the
two-name branch in find. Answer endpointAccess in find. Share one call in
handleRestoreFromSnapshot.

* fix: derive account members from service models and reuse endpoint lookup
2026-11-11 11:57:28 -04:00
Vũ Thế Huy 9b69b3dac3 feat(redshift-serverless): copy snapshots into the configured destination region (#7024)
* feat(redshift-serverless): copy snapshots into the configured destination region

A SnapshotCopyConfiguration used to be stored and echoed, with nothing copied.
A background sweep now carries each AVAILABLE snapshot of the namespace, taken
at or after the configuration was created, into the destination Region with its
dump and metadata. The copy is an ordinary snapshot there, so describe, restore,
delete and expiration work on it unchanged.

- The source records the Regions it has been copied to, so a deleted or expired
  copy is not made again and a retry or restart after a crash makes no second
  copy. A copy made for an earlier snapshot of the same name is replaced.
- Retention and KMS key come from the configuration. A name already taken by
  an unrelated snapshot in the destination is kept and logged.
- Rules carry the account and namespace id, so accounts never collide and a
  recreated namespace does not inherit its predecessor's configuration.
- The destination must be a known Region in the namespace's partition.
- ResetAll now removes every snapshot dump, which it used to leak.
- New switches: snapshot-copy-enabled and snapshot-copy-sweep-interval-seconds.

* fix(redshift-serverless): keep the earlier snapshot copy restorable when a replacement fails

Each copy now gets its own dump file and the replaced copy's dump is removed
only after the new record is saved. Drop the slow, partition-bound
compatibility test; the in-repo engine and integration tests cover the copy.

* fix(redshift-serverless): name a snapshot copy's dump by id so long snapshot names still copy
2026-10-30 14:44:26 -04:00
Vũ Thế Huy 80edd853de feat(redshift-serverless): expire snapshots after their retention period (#6966)
* feat(redshift-serverless): expire snapshots after their retention period

* fix(redshift-serverless): stop the snapshot expiration worker before storage closes

* fix(redshift-serverless): mark pending snapshot cleanup DELETED and test the sweep lock without timing

* refactor(redshift-serverless): run snapshot expiration on a shared sweep worker
2026-10-29 23:29:50 -04:00
Vũ Thế Huy e820414f22 feat(redshift-serverless): execute scheduled actions on cron and at schedules (#6851) 2026-10-28 21:05:15 -04:00
Vũ Thế Huy 2a5f734777 feat: support managed credentials in Redshift restore (#6515) 2026-10-25 21:43:14 -04:00
Vũ Thế Huy 0a13e4259e feat(redshift-serverless): manage namespace admin credentials (#6491) 2026-10-25 08:24:23 -04:00
Vũ Thế Huy 1d5940944e docs(redshift-serverless): drop served operations from unknown-operation list (#5862)
Drop snapshot copy configurations, endpoint access, resource policies and custom domain associations from the list of operations that answer UnknownOperationException, as all four are served now. Also drop scheduled actions, tracks, managed workgroups and reservations, which are served in the actions table and do not answer UnknownOperationException.
2026-10-17 08:09:30 -04:00
Vũ Thế Huy fa2a49e771 feat(redshift-serverless): add scheduled action actions (#5852)
Add CreateScheduledAction, GetScheduledAction, ListScheduledActions,
UpdateScheduledAction and DeleteScheduledAction. An action is recorded and
echoed, never run, and a cron schedule reports no upcoming invocations. It is
tied to the namespace by the namespace's generated id, so a namespace recreated
under the same name does not inherit it.

Required members, name patterns, the snapshot name prefix length and the tag
shape come from the AWS model through RedshiftServerlessRequestShapes. Only what
the model cannot express stays in the service: the schedule union, the time
window, the retention range and the namespaces that must exist.
2026-10-17 00:04:32 -04:00
Vũ Thế Huy 1cb8b0f747 feat(redshift-serverless): accept customDomainName in GetCredentials (#5856) 2026-10-16 23:11:42 -04:00
Vũ Thế Huy 2a012cf9a4 feat(redshift-serverless): add snapshot copy configuration actions (#5798)
* feat(redshift-serverless): add snapshot copy configuration actions

Add CreateSnapshotCopyConfiguration, ListSnapshotCopyConfigurations,
UpdateSnapshotCopyConfiguration and DeleteSnapshotCopyConfiguration. A
configuration is recorded and echoed; Floci copies no snapshot. A namespace has
one configuration at a time and the destination Region must differ from its own.
The configuration is tied to the namespace by the namespace's generated id, so a
namespace recreated under the same name does not inherit it.

Required members come from the AWS model through RedshiftServerlessRequestShapes.
The destination Region name and the retention range are checked by hand because
the model leaves them unconstrained.

* fix(redshift-serverless): validate boundary inputs and scope snapshot copy pagination tokens

* refactor(redshift-serverless): share maxResults range check and invalidPagination helper
2026-10-16 22:42:36 -04:00
Vũ Thế Huy 7cab804d22 feat(redshift-serverless): add custom domain association actions (#5766)
* feat(redshift-serverless): add custom domain association actions

Add CreateCustomDomainAssociation, GetCustomDomainAssociation,
ListCustomDomainAssociations, UpdateCustomDomainAssociation and
DeleteCustomDomainAssociation. An association is recorded and echoed; Floci
serves no traffic on the domain and reads no ACM certificate. It is tied to the
workgroup by the workgroup's generated id, so a workgroup recreated under the
same name does not inherit it.

The domain name and certificate ARN patterns, lengths and the required members
come from the AWS model through RedshiftServerlessRequestShapes, so the service
carries no validation of its own.

* fix(redshift-serverless): address review findings for custom domains

- Expose custom domain name and certificate ARN in workgroup responses.
- Ensure custom domain names are unique across workgroups in a region.
- Remove ambiguous Pagination.paginate overload in favor of paginateNamespaced.
- Add domain name and certificate ARN validation patterns and length checks.
- Enforce validation for required parameters in custom domain operations.

* fix(redshift-serverless): enforce single custom domain per workgroup and populate certificate expiry

* fix(redshift-serverless): read certificate expiry dynamically and share custom domain serialization
2026-10-16 21:18:45 -04:00
Vũ Thế Huy c67a5afbc3 feat(redshift-serverless): add endpoint access actions (#5742)
* feat(redshift-serverless): add endpoint access actions

Add CreateEndpointAccess, GetEndpointAccess, ListEndpointAccess,
UpdateEndpointAccess and DeleteEndpointAccess. Floci creates no VPC endpoint, so
an endpoint is recorded and echoed with the workgroup's own address and port.
It is tied to the workgroup by the workgroup's generated id, so a workgroup
recreated under the same name does not inherit its predecessor's endpoints.

Required members and the ownerAccount pattern come from the AWS model through
RedshiftServerlessRequestShapes. The endpoint name rule is checked by hand
because the model documents it but does not encode it.

* fix(redshift-serverless): validate boundary inputs and scope endpoint pagination tokens

Validate policy is not null or blank in requireJsonObject before Jackson parsing to avoid unchecked IllegalArgumentException. Validate required endpointName, workgroupName, and subnetIds at create boundary. Validate non-null vpcSecurityGroupIds on endpoint updates. Add namespaced paginate overload with limit validation, scope ListEndpointAccess tokens to endpoint-access, and report pagination errors as ValidationException.

* fix(redshift-serverless): allow optional vpcSecurityGroupIds on update and reuse existing pagination overload

Allow omitting or passing null vpcSecurityGroupIds in UpdateEndpointAccess to leave existing security groups unchanged. Validate maxResults in the service and call the existing namespaced Pagination.paginate overload instead of adding core overloads. Omit the snapshot policy null check which belongs to #5730.
2026-10-16 13:40:19 -04:00
Vũ Thế Huy a68e6bc768 feat(redshift-serverless): add resource policy actions for snapshots (#5730)
* feat(redshift-serverless): add resource policy actions for snapshots

Add PutResourcePolicy, GetResourcePolicy and DeleteResourcePolicy. A policy is
stored per account and Region and echoed in the shape of the API model, not
evaluated. It is tied to the snapshot it was put on by the snapshot's creation
time, so a snapshot recreated under the same name does not inherit it.

Required members come from the AWS model through RedshiftServerlessRequestShapes.

* fix(redshift-serverless): validate resource ARN before policy lookup and add account isolation tests

Validate resourceArn with snapshotNameFromArn at the start of require() so that foreign-account or non-snapshot ARNs return ValidationException on GetResourcePolicy and DeleteResourcePolicy even when no policy is stored. Parameterize snapshotNameFromArn so error messages reference resourceArn.

Add regression tests covering missing resourceArn on PutResourcePolicy and foreign ARN reads/deletes. Add integration test verifying policy isolation across accounts under real request contexts.
2026-10-15 22:13:02 -04:00
Vũ Thế Huy d3fce14256 feat(redshift-serverless): add release track, managed workgroup and reservation reads (#5691)
* feat(redshift-serverless): add release track, managed workgroup and reservation reads

Add GetTrack, ListTracks, ListManagedWorkgroups, ListReservations,
ListReservationOfferings, GetReservation, GetReservationOffering and
CreateReservation so SDK, CLI and IaC clients no longer get an unknown
operation error. Floci models no zero-ETL managed workgroups and sells no
reservations, so the lists are empty and the reservation lookups answer
ResourceNotFoundException. The two release tracks are current and trailing.

Required members, patterns and lengths come from the AWS model through
RedshiftServerlessRequestShapes; only the track names, which the model leaves
unenumerated, are checked by hand.

* refactor(redshift-serverless): reuse Pagination.paginate and remove unused admin handle method

Rely on Pagination.paginate for maxResults and nextToken validation in listTracks and listWithoutItems, matching the other Redshift Serverless lists. Remove the unused handle method and its duplicate unknown-operation response in RedshiftServerlessAdminJsonHandler.
2026-10-15 13:46:35 -04:00
Vũ Thế Huy 77384dc3de feat(redshift-serverless): validate requests against the AWS model constraints (#5641)
* feat(redshift-serverless): validate requests against the AWS model constraints

Generate the input constraints (required members, length, pattern, enum,
number range, list size) from botocore's Redshift Serverless model with
tools/aws/regen_redshift_serverless_shapes.py and vendor them under
src/main/resources/aws, like the DynamoDB request shapes. A new
RedshiftServerlessRequestShapes check runs before dispatch and answers a
ValidationException. Pagination members are left to the services, which keep
reporting InvalidPaginationException.

Move the request parsing and error helpers that the JSON handler, the usage
limit service and the service each carried a copy of into ServerlessSupport,
so the resource families that follow share one implementation.

* fix(redshift-serverless): address review findings on request validation

- Match a model pattern against the whole value, so an unanchored pattern such
  as the account id no longer accepts a value that merely contains a match.
- Count string lengths in Unicode code points, so a tag of 200 supplementary
  characters is not rejected for exceeding 256 UTF-16 units.
- Validate only the actions the handler implements, so a modeled but
  unsupported action keeps answering UnknownOperationException.
- Read every string member through ServerlessSupport.text and reject a tag key
  or value that is not a string, so a numeric nextToken or tag member is a
  ValidationException instead of being treated as absent or coerced.
- Regenerate the vendored shapes from botocore 1.43.113, the version
  tools/aws/requirements.txt pins.
- Cover the rejected-request case with a state check, and add the pattern, code
  point, page token and tag regressions.

* refactor(redshift-serverless): use VendoredResources, ServerlessSupport.notFound and update docs
2026-10-15 09:06:46 -04:00
Vũ Thế Huy a95b01020b feat(redshift-serverless): add UpdateSnapshot (#5537)
Change a snapshot's retentionPeriod (-1 for indefinite) with the same validation as CreateSnapshot; an omitted period leaves the snapshot unchanged.
2026-10-13 21:51:23 -04:00
Vũ Thế Huy 141fd747ee feat(redshift-serverless): add usage limit actions (#5378)
* feat(redshift-serverless): add usage limit actions

Add CreateUsageLimit, GetUsageLimit, ListUsageLimits, UpdateUsageLimit and
DeleteUsageLimit, following the botocore redshift-serverless model.

Usage limits are stored and echoed, not enforced: Floci does not meter RPU
consumption, so breachAction never fires. A limit belongs to a workgroup,
at most one per usageType, and disappears with it. The service checks the
workgroup on read instead of hooking deleteWorkgroup, so deletes through
CloudFormation are covered too.

* fix(redshift-serverless): reject malformed usage limit members and purge stale limits on read

- Usage limit string members of another JSON type (a numeric period,
  breachAction, resourceArn, usageType, usageLimitId or nextToken) were read
  as absent, so a create took the defaults, an update ignored the action and
  a list dropped its filter. They are now a ValidationException.
- maxResults accepted fractional and out-of-range numbers and truncated them.
  It must be an integer that fits an int.
- GetUsageLimit and the other id lookups answered 404 for a limit whose
  workgroup was gone but left the record in storage; they now delete it.
- Listing checked every limit with a full workgroup scan. It now takes one
  snapshot of the Region's workgroup ARNs per scan.
- Add a paging test that deletes the limit behind the nextToken.

* fix(redshift-serverless): permit multiple usage limits per type and return 400 on missing resources

- Remove the one-limit-per-usageType check on CreateUsageLimit so a workgroup can have multiple limits for the same usage type with different periods (e.g. daily and monthly serverless-compute).
- Align ResourceNotFoundException on usage limit actions with the AWS Redshift Serverless API specification by returning HTTP 400 instead of 404.
- Update documentation and test assertions accordingly.
2026-10-10 11:06:34 -04:00
yarammanasa2001-maxandyarammanasa2001-max 9934b39a42 feat(redshiftserverless): add snapshot and restore operations (#5184)
* feat(redshiftserverless): add snapshot and restore operations

Adds CreateSnapshot, GetSnapshot (by name or ARN), ListSnapshots (filterable
by namespace), DeleteSnapshot and RestoreFromSnapshot on top of the existing
workgroup support. A snapshot is AVAILABLE as soon as it is created, so a
snapshot created in a standby region stands in for a cross-region copy.
RestoreFromSnapshot restores into an existing namespace and workgroup and
never creates either.

* docs(redshiftserverless): document snapshot and restore actions

* docs(redshiftserverless): update service matrix operation count

* fix(redshiftserverless): validate snapshot restore and ARN lookup

Reject a RestoreFromSnapshot workgroup that belongs to another namespace,
resolve snapshotArn only for this account and Region, and register the
snapshot model for reflection so persisted snapshots survive a native restart.

* fix(redshiftserverless): harden snapshot restore and add lifecycle tests

Validate namespaceName and snapshot names, accept snapshotArn on
RestoreFromSnapshot, read the snapshot once during restore, and cover the
handler with an integration lifecycle test and a Java SDK compatibility test.

* feat(redshiftserverless): dump and restore snapshot data and model retention, tags and filters

CreateSnapshot dumps a running workgroup with pg_dump and RestoreFromSnapshot
empties the public schema and replays the dump, reusing the provisioned
Redshift container manager. Snapshots now report adminUsername, kmsKeyId and
retention, accept tags (taggable by ARN), ListSnapshots filters by
namespaceArn, ownerAccount and a time window, and RestoreFromSnapshot rejects
snapshotName and snapshotArn together.

* fix(redshiftserverless): make snapshot restore atomic and strict

Dump the current contents before a restore and put them back when the replay
fails, drop every user schema rather than only public, run psql with
ON_ERROR_STOP so a failing statement fails the restore, and fail a restore
whose recorded dump file is missing.

* fix(redshiftserverless): keep the catalog bootstrap schema out of snapshot restore

The reset dropped floci_internal and with it the pg_catalog svv_external_*
views, so the strict replay failed. Leave that schema out of the reset and
out of the dump.

* fix(redshiftserverless): drop large objects when resetting before a restore

* refactor(redshift): share container lookup and defaults in the container manager

* docs(redshiftserverless): document the bootstrap schema left out of snapshots

* style(redshiftserverless): order imports in the runtime test

---------

Co-authored-by: yarammanasa2001-max <271440416+yarammanasa2001-max@users.noreply.github.com>
2026-10-07 17:08:39 -04:00
Vũ Thế Huy 99a6b4050c feat(redshift-serverless): add running workgroups and Data API WorkgroupName support (#5012)
* 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
2026-10-04 15:34:24 -04:00
Allen Sanborn 4b3923712a feat(redshiftserverless): add namespace lifecycle and tagging (#3631)
* feat(redshiftserverless): add namespace lifecycle

Amazon Redshift Serverless was absent entirely: every call returned
UnknownOperationException, so Terraform's aws_redshiftserverless_namespace
could not be planned or applied against Floci.

Add a JSON 1.1 service under the RedshiftServerless. target prefix with
CreateNamespace, GetNamespace, ListNamespaces, UpdateNamespace, and
DeleteNamespace. Namespaces are account and Region scoped and stored through
StorageFactory. AWS defaults are applied on create (dbName dev, kmsKeyId
AWS_OWNED_KMS_KEY, empty logExports, status AVAILABLE), adminUserPassword is
accepted and never returned, DeleteNamespace returns the removed namespace
with status DELETING, and UpdateNamespace applies only the supplied fields.

Workgroups, snapshots, and the tagging operations remain unemulated.

* feat(redshiftserverless): add namespace tagging operations

Terraform's aws_redshiftserverless_namespace calls ListTagsForResource on
every read once tags are involved, so the namespace lifecycle alone left the
resource broken as soon as a config set tags.

Add ListTagsForResource, TagResource, and UntagResource. Lookup is by
resourceArn rather than namespace name, scoped to the caller's Region, since
that is how AWS keys these operations; the namespace is currently the only
taggable Redshift Serverless resource, so any other ARN is reported absent.
TagResource merges into the existing tags, UntagResource removes by key, and
tags passed to CreateNamespace are readable back and survive UpdateNamespace.

* fix(redshiftserverless): emit creationDate as ISO-8601 per the API model

The awsJson1.1 default is epoch seconds and 133 call sites use it, but this
model overrides it: TimestampFormatTrait ISO_8601 on creationDate (and on all
eleven other timestamp members in the package, audited). Strict clients broke
on the number: Terraform's Go SDK failed to decode and orphaned the created
namespace outside state; the Java SDK failed to unmarshall. Only botocore's
lenient parsing let CLI checks pass. Emitted via the repo's millisecond-ISO
idiom; format pinned by regex in the integration test and by a new
handler-level unit test class covering the wire layer that had none
(timestamp shape, nextToken emission, maxResults type guard). Checklist note
added to AGENTS.md + CONTRIBUTING.md so the next service checks the trait
before reaching for the epoch idiom.

* docs(redshiftserverless): the ISO-8601 rule is per member, not model-wide

Review follow-up: the earlier claim that every timestamp member in this model
carries TimestampFormatTrait(ISO_8601) is wrong — 15 of the model's 30 INSTANT
members carry no trait and fall back to the awsJson1.1 epoch default. The
shipped code is unaffected (creationDate, the only timestamp emitted, is
genuinely ISO_8601), but the claim was load-bearing guidance: whoever adds
snapshots or scheduled actions next would have applied ISO-8601 to trait-free
members and reintroduced the bug in the opposite direction. Narrowed in all
four places it appeared.

* fix(redshiftserverless): validate collection types, copy-on-update; drop em dashes

A present iamRoles, logExports, tags or tagKeys member that was not a JSON
array parsed to null and was then indistinguishable from an omitted member,
so a malformed UpdateNamespace silently kept the stored value and returned
200 instead of reporting the request as invalid. Only a missing or null
member now means "omitted"; a present member of the wrong type, or a
collection holding a non-string element, is a ValidationException naming the
member.

updateNamespace mutated the stored Namespace in place while GetNamespace and
ListNamespaces read without taking the same monitor, so a concurrent reader
could observe a torn object with some fields updated and some not. Build the
new state on a copy and store that instead, which also makes the write-back
explicit. The same in-place mutation was present in tagResource,
untagResource and deleteNamespace, so all four now copy. Merge semantics are
unchanged.

Replace the em dashes in the timestamp guidance with commas and periods, per
the repository ban.

* fix(redshiftserverless): reject Redshift reserved words as namespace names

CreateNamespace rejects a namespace name that is an Amazon Redshift SQL
reserved word, so names like select or user passed the length and
[a-z0-9-] checks here and were persisted. Add the documented reserved
word list to the shared namespace-name validator, which create, get,
update and delete all reach, so the rejection is consistent.
2026-09-23 10:13:24 -04:00