WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 226a486

Browse files
committed
add example, update readme and docs for data api usage
1 parent 9e31f87 commit 226a486

File tree

3 files changed

+44
-10
lines changed

3 files changed

+44
-10
lines changed

README.md

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,41 @@
11
# Terraform Provider for AWS Redshift
22

3-
This provider allows to manage with Terraform [AWS Redshift](https://aws.amazon.com/redshift/) objects like users, groups, schemas, etc..
3+
This provider allows to manage with Terraform [AWS Redshift](https://aws.amazon.com/redshift/) objects like users, groups, schemas, etc...
44

55
It's published on the [Terraform registry](https://registry.terraform.io/providers/dbsystel/redshift/latest/docs).
66

77
## Requirements
88

9-
- [Terraform](https://www.terraform.io/downloads.html) >= 1.0
10-
- [Go](https://golang.org/doc/install) 1.24 (to build the provider plugin)
9+
- [Terraform](https://www.terraform.io/downloads.html) >= 1.0
10+
- [Go](https://golang.org/doc/install) 1.24 (to build the provider plugin)
1111

1212
## Limitations
1313

14+
### Untested features
15+
1416
Due to limited testing capacities, the following features are not tested/stable yet:
1517

1618
* External Schemas
17-
* Hive Database
18-
* RDS Postgres Database
19-
* RDS MySQL Database
20-
* Redshift Database
19+
* Hive Database
20+
* RDS Postgres Database
21+
* RDS MySQL Database
22+
* Redshift Database
2123
* Temporary Credentials Cluster Identifier
2224
* Temporary Credentials Assume Role
2325
* Datashares
2426

27+
### Using the AWS Redshift Data API
28+
29+
This provider *does* support connecting to the Redshift instance using the AWS Redshift Data API. However, this is not
30+
the default behavior, requires some additional configuration and comes along with some caveats:
31+
32+
* Transactions are not run as real DB-level transactions, but rather as a sequence of individual statements.
33+
* Due to the unsupported state of transactions, interfering DB interactions might lead to unexpected results.
34+
* In order to
35+
prevent [errors due to conflicts with concurrent transactions](https://stackoverflow.com/questions/37344942/redshift-could-not-complete-because-of-conflict-with-concurrent-transaction),
36+
all statements depend on one lock across resources. This may lead to longer execution times, especially when multiple
37+
resources are created or updated at the same time.
38+
2539
## Building The Provider
2640

2741
```sh
@@ -34,14 +48,15 @@ Enter the provider directory and build the provider
3448
$ cd terraform-provider-redshift
3549
$ make build
3650
```
51+
3752
## Development
3853

3954
If you're new to provider development, a good place to start is the [Extending
4055
Terraform](https://www.terraform.io/docs/extend/index.html) docs.
4156

4257
### Running Tests
4358

44-
Acceptance tests require a running real AWS Redshift cluster.
59+
Acceptance tests require a running real AWS Redshift cluster.
4560

4661
```sh
4762
REDSHIFT_HOST=<cluster ip or DNS>
@@ -52,6 +67,7 @@ make testacc
5267
```
5368

5469
If your cluster is only accessible from within the VPC, you can connect via a socks proxy:
70+
5571
```sh
5672
ALL_PROXY=socks5[h]://[<socks-user>:<socks-password>@]<socks-host>[:<socks-port>]
5773
NO_PROXY=127.0.0.1,192.168.0.0/24,*.example.com,localhost
@@ -71,8 +87,9 @@ Use `go generate` to update generated docs.
7187

7288
## Releasing
7389

74-
Builds and releases are automated with GitHub Actions and [GoReleaser](https://github.com/goreleaser/goreleaser/).
75-
The changelog is managed with [github-changelog-generator](https://github.com/github-changelog-generator/github-changelog-generator).
90+
Builds and releases are automated with GitHub Actions and [GoReleaser](https://github.com/goreleaser/goreleaser/).
91+
The changelog is managed
92+
with [github-changelog-generator](https://github.com/github-changelog-generator/github-changelog-generator).
7693

7794
Currently there are a few manual steps to this:
7895

docs/index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ provider "redshift" {
5454

5555
### Optional
5656

57+
- `data_api` (Block List, Max: 1) Configuration for using the Redshift Data API. This can only be used for serverless Redshift clusters. (see [below for nested schema](#nestedblock--data_api))
5758
- `database` (String) The name of the database to connect to. The default is `redshift`.
5859
- `host` (String) Name of Redshift server address to connect to.
5960
- `max_connections` (Number) Maximum number of connections to establish to the database. Zero means unlimited.
@@ -63,6 +64,15 @@ provider "redshift" {
6364
- `temporary_credentials` (Block List, Max: 1) Configuration for obtaining a temporary password using redshift:GetClusterCredentials (see [below for nested schema](#nestedblock--temporary_credentials))
6465
- `username` (String) Redshift user name to connect as.
6566

67+
<a id="nestedblock--data_api"></a>
68+
### Nested Schema for `data_api`
69+
70+
Required:
71+
72+
- `region` (String) The AWS region where the Redshift Serverless workgroup is located. If not specified, the region will be determined from the AWS SDK configuration.
73+
- `workgroup_name` (String) The name of the Redshift Serverless workgroup to connect to.
74+
75+
6676
<a id="nestedblock--temporary_credentials"></a>
6777
### Nested Schema for `temporary_credentials`
6878

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
provider "redshift" {
2+
database = "exampledb"
3+
data_api {
4+
workgroup_name = "example-workgroup"
5+
region = "us-west-2"
6+
}
7+
}

0 commit comments

Comments
 (0)