Skip to content

feat: support Data API for provisioned Redshift clusters#75

Open
alexjurkiewicz wants to merge 2 commits intodbsystel:masterfrom
alexjurkiewicz:feat/data-api-provisioned-clusters
Open

feat: support Data API for provisioned Redshift clusters#75
alexjurkiewicz wants to merge 2 commits intodbsystel:masterfrom
alexjurkiewicz:feat/data-api-provisioned-clusters

Conversation

@alexjurkiewicz
Copy link
Copy Markdown

Summary

The data_api provider block previously only supported Redshift Serverless workgroups. This PR extends it to also support provisioned clusters via a cluster_identifier + username pair.

The underlying redshift-data-sql-driver already supports both DSN formats — this change wires up the provider schema and config-building logic to expose that capability.

Changes

  • New cluster_identifier field in data_api block (mutually exclusive with workgroup_name via ExactlyOneOf)
  • New username field in data_api block (the DB user passed as DbUser in ExecuteStatementInput; required at apply time when cluster_identifier is set)
  • workgroup_name changed from Required to Optional (schema enforces exactly one of workgroup_name/cluster_identifier must be set)
  • temporary_credentials added to data_api's ConflictsWith to make the conflict symmetric
  • New example: examples/provider/provider_using_redshift_data_api_provisioned.tf

Example usage

provider "redshift" {
  database = "mydb"
  data_api {
    cluster_identifier = "my-cluster"
    username           = "myuser"
    region             = "us-east-1"
  }
}

Testing

  • Unit tests added for DSN building, happy path, missing-username error, and ResourceData-level schema→config wiring
  • Manually tested end-to-end against a live provisioned cluster via the Data API (create and destroy of a redshift_user)
  • Existing workgroup path unchanged (regression test included)

🤖 Generated with Claude Code

@alexjurkiewicz
Copy link
Copy Markdown
Author

On a personal note -- thank you for keeping the "Redshift user management with Terraform" dream alive 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant