{"id":18601933,"url":"https://github.com/better/terraform-provider-redshift","last_synced_at":"2025-05-16T17:34:18.124Z","repository":{"id":56570844,"uuid":"304123539","full_name":"better/terraform-provider-redshift","owner":"better","description":"Terraform Provider for AWS Redshift Schemas, Users, Groups and Permissions","archived":false,"fork":false,"pushed_at":"2020-10-30T21:41:44.000Z","size":37,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":23,"default_branch":"main","last_synced_at":"2025-02-18T01:36:40.607Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/better.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-14T20:06:48.000Z","updated_at":"2020-10-20T12:59:19.000Z","dependencies_parsed_at":"2022-08-15T21:10:28.011Z","dependency_job_id":null,"html_url":"https://github.com/better/terraform-provider-redshift","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/better%2Fterraform-provider-redshift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/better%2Fterraform-provider-redshift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/better%2Fterraform-provider-redshift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/better%2Fterraform-provider-redshift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/better","download_url":"https://codeload.github.com/better/terraform-provider-redshift/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254576753,"owners_count":22094449,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T02:09:46.129Z","updated_at":"2025-05-16T17:34:18.101Z","avatar_url":"https://github.com/better.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redshift Terraform Provider\nFork off:\n* [frankfarrell/terraform-provider-redshift](https://github.com/frankfarrell/terraform-provider-redshift)\n* [terraform-providers/terraform-provider-postgresql](https://github.com/terraform-providers/terraform-provider-postgresql)\n\nUses Terraform to manage AWS Redshift schemas, users, groups and permissions.\n\nDoes not support database and table formation.\n\n## Requirements\n\n* [Terraform](https://www.terraform.io/downloads.html) 0.13.x\n* [Go](https://golang.org/doc/install) 1.15 (to build the provider plugin)\n\n## Local Install\nMake sure you have `go` installed and  `$GOPATH` set.\nClone the repo to: `$GOPATH/src/github.com/terraform-providers/` and `go install` then move the provider to the terraform plugin directory\n\n#### Building the provider:\n```\n$ mkdir -p $GOPATH/src/github.com/terraform-providers; cd $GOPATH/src/github.com/terraform-providers\n$ git clone git@github.com:better/terraform-provider-redshift.git\n$ cd $GOPATH/src/github.com/terraform-providers/terraform-provider-redshift\n$ go install\n```\n\n#### Using the provider\n```\n$ mkdir -p ~/.terraform.d/plugins/{organization}/{team_name}/redshift/1.0.0/darwin_amd64/\n$ cp $GOPATH/bin/terraform-provider-redshift ~/.terraform.d/plugins/{organization}/{team_name}/redshift/1.0.0/darwin_amd64/\n```\n\nmain.tf\n```\nterraform {\n  required_providers {\n    redshift = {\n      version = \"1.0.0\"\n      source = \"{organization}/{team_name}/redshift\"\n    }\n  }\n}\n\n\nprovider redshift {\n  host = \"localhost\"\n  user = \"root\"\n  password = \"password\"\n  database = \"database\"\n  port = 5439\n}\n\n\n# create users\n\nresource redshift_user \"tf_test__user\" {\n  name = \"tf_test__user\"\n  password = \"password_goes_here\"\n}\n\nresource redshift_user \"tf_test__user2\" {\n  name = \"tf_test__user2\"\n  password = \"password_goes_here\"\n}\n\n\n# create test schema\n\nresource redshift_schema \"test_schema\" {\n  name = \"test_schema\"\n}\n\n\n# create groups and assign users to groups\n\nresource redshift_group \"test_schema__rw\" {\n  name = \"test_schema__rw\"\n  users = [redshift_user.tf__test_user.name]\n}\n\nresource redshift_group \"test_schema__r\" {\n  name = \"test_schema__r\"\n  users = [redshift_user.tf__test_user2.name]\n}\n\n\n# create schema permissions and schema table grants/default privileges and assign them to groups\n# \"owner\" defines the target user in ALTER DEFAULT PRIVILEGES\n\nresource redshift_grant_schema_group \"tf__test_schema__rw__test_schema\" {\n  group = redshift_group.test_schema__rw.name\n  schema = redshift_schema.test_schema.name\n  usage = true\n  create = true\n}\n\nresource redshift_grant_schema_group \"tf__test_schema__r__test_schema\" {\n  group = redshift_group.test_schema__r.name\n  schema = redshift_schema.test_schema.name\n  usage = true\n}\n\nresource redshift_grant_table_group \"tf__test_schema__rw__test_schema__tf__test_user\" {\n  group = redshift_group.test_schema__rw.name\n  schema = redshift_schema.test_schema.name\n  owner = redshift_user.tf__test_user.name\n  select = true\n  insert = true\n  update = true\n  delete = true\n  references = true\n\n  depends_on = [\n    redshift_grant_schema_group.tf__test_schema__rw__test_schema,\n  ]\n}\n\nresource redshift_grant_table_group \"tf__test_schema__r__test_schema__tf__test_user\" {\n  group = redshift_group.test_schema__r.name\n  schema = redshift_schema.test_schema.name\n  owner = redshift_user.tf__test_user.name\n  select = true\n\n  depends_on = [\n    redshift_grant_schema_group.tf__test_schema__r__test_schema,\n  ]\n}\n```\n\nTerraform CLI\n```\nterraform plan\nterraform apply -parallelism 1\n```\n#### Importing already existing resources\n\nmain.tf\n```\nresource redshift_user \"tf_test__user\" {\n  name = \"tf_test__user\"\n  password = \"password_goes_here\"\n}\n\nresource redshift_group \"tf_test__group\" {\n  name = \"tf_test__group\"\n}\n\nresource redshift_schema \"tf_test__schema\" {\n  name = \"tf_test__schema\"\n}\n```\n\nTerraform CLI\n```\nterraform import redshift_user.tf_test__user \u003cusesysid\u003e\nterraform import redshift_group.tf_test__group \u003cgrosysid\u003e\nterraform import redshift_schema.tf_test__schema \u003coid\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbetter%2Fterraform-provider-redshift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbetter%2Fterraform-provider-redshift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbetter%2Fterraform-provider-redshift/lists"}