mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 14:10:49 -05:00
* fix(redshift): add SnapshotArn and SnapshotCreateTime to snapshot responses DescribeClusterSnapshots and CreateClusterSnapshot never populated SnapshotArn or SnapshotCreateTime — the Snapshot model didn't carry either field. Real AWS returns both, and callers that filter on recovery-point age or restore by ARN have nothing to key off. SnapshotArn reuses the existing snapshotArn(clusterIdentifier, snapshotIdentifier) helper (already used for tagging, just never attached to the model). SnapshotCreateTime is captured via Instant.now() at snapshot creation and formatted with the same DateTimeFormatter.ISO_INSTANT convention already used elsewhere in this file for Expiration/CreateTime. Both elements are omitted from the XML response when the snapshot predates this field (an on-disk store surviving an upgrade), matching how the other optional elements in buildSnapshotXml already degrade. * feat(redshift): support DescribeLoggingStatus, EnableLogging, DisableLogging The Upbound Terraform provider's redshift Cluster resource calls DescribeLoggingStatus on every observe cycle, unconditionally, as part of its standard drift check across all configurable cluster aspects — not something a caller opts into. Without it, every cluster's observe step failed outright with InvalidAction, and the cluster could never report Synced/Ready even once fully created and available. Adds the three logging actions as a set, matching how EnableLogging/ DisableLogging/DescribeLoggingStatus share one response shape in the real API. No log delivery is emulated — only the configuration a caller set (enabled, bucket, prefix) is tracked and returned, the same graceful-scope choice already made for snapshot dump handling. XML wrapper element names (DescribeLoggingStatusResult, EnableLoggingResult, DisableLoggingResult) were verified against aws-sdk-go-v2's own generated deserializer, not assumed from the docs. * fix(redshift): default parameter group and MultiAZ on cluster responses Terraform provider's resourceClusterRead indexes ClusterParameterGroups[0] and requires MultiAZ to be exactly "enabled" or "disabled" unconditionally. Real AWS always attaches a default parameter group and never returns MultiAZ blank; floci previously omitted both, causing a panic and then a read error in the provider. * fix(redshift): resolve RestoreFromClusterSnapshot by SnapshotArn too Real AWS lets callers restore from either SnapshotIdentifier or SnapshotArn. Terraform's aws_redshift_cluster resource populates only snapshot_arn when that's the field configured, so the request carried no SnapshotIdentifier at all and floci NPE'd looking one up as null. * fix(redshift): use the real AWS error code for missing subnet groups RedshiftService threw "ClusterSubnetGroupNotFound", but AWS's actual code is "ClusterSubnetGroupNotFoundFault" and the Terraform AWS provider's generated deserializer type-matches on that exact string to recognize "doesn't exist yet, create it". A bare code fell through to an unclassified error, so the provider never got past Observe and a cluster subnet group could never be created through Crossplane. * fix(redshift): address PR review feedback Validate SnapshotArn (400 on malformed/missing, account and region check), honor ClusterParameterGroupName and MultiAZ, seed the default parameter group, allow CloudWatch EnableLogging, return 400 for missing subnet groups, sync docs, and add tests. * test(redshift): fix merge of logging tests with main's IAM role tests * refactor(redshift): share logging response helper and trim comments * fix(redshift): restore testDisableLogging's closing brace lost in the main merge Merging main's snapshot-copy-grant tests (#3628) next to the logging tests dropped the closing brace of testDisableLogging and the @Test annotation on describesSnapshotCopyGrants, so the latter body ran inside the former and the file failed to compile. * docs(redshift): resync action table order after the main merge make docs-sync moved ModifyCluster after the snapshot-copy-grant rows main added, matching the generator's canonical action order. --------- Co-authored-by: yarammanasa2001-max <271440416+yarammanasa2001-max@users.noreply.github.com>