You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,13 +22,13 @@ terraform {
22
22
}
23
23
```
24
24
25
-
You must then configure the provider to either use a service token, or an access token. Either can be configured in the provider config block, or via env vars (`PLANETSCALE_SERVICE_TOKEN_NAME` and `PLANETSCALE_SERVICE_TOKEN`, or `PLANETSCALE_ACCESS_TOKEN`):
25
+
You must then configure the provider to either use a service token, or an access token. Either can be configured in the provider config block, or via env vars (`PLANETSCALE_SERVICE_TOKEN_ID` and `PLANETSCALE_SERVICE_TOKEN`, or `PLANETSCALE_ACCESS_TOKEN`):
26
26
27
27
```hcl
28
28
provider "planetscale" {
29
29
# use a service token
30
-
service_token_name = "..." # ID of the service token to use, e.g "8fbddg0zlq0r"
31
-
service_token = "..." # Secret for the service token.
30
+
service_token_id = "..." # ID of the service token to use, e.g "8fbddg0zlq0r"
31
+
service_token = "..." # Secret for the service token.
32
32
33
33
# or use an access token
34
34
access_token = "..." # Secret for the access token.
@@ -48,7 +48,7 @@ Contributions should follow this workflow, or integrate with it.
48
48
49
49
### Tests
50
50
51
-
You will need to set either `PLANETSCALE_ACCESS_TOKEN` or `PLANETSCALE_SERVICE_TOKEN_NAME` and `PLANETSCALE_SERVICE_TOKEN` to run acceptance tests.
51
+
You will need to set either `PLANETSCALE_ACCESS_TOKEN` or `PLANETSCALE_SERVICE_TOKEN_ID` and `PLANETSCALE_SERVICE_TOKEN` to run acceptance tests.
52
52
53
53
The org to create resources under is currently hardcoded in the tests. You may need to change this to match your own org. Acceptance tests create real resources in your PlanetScale org.
Copy file name to clipboardExpand all lines: docs/index.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ description: |-
7
7
access token credentials, configured or stored in the environment variable PLANETSCALE_ACCESS_TOKENservice token credentials, configured or stored in the environment variables PLANETSCALE_SERVICE_TOKEN_NAME and PLANETSCALE_SERVICE_TOKEN
8
8
Note that the provider is not production ready and only for early testing at this time.
9
9
Known limitations:
10
-
Support for deployments, deploy queues, deploy requests and reverts is not implemented at this time. If you have a use case for it, please let us know in the repository issues.Service tokens don't immediately have read/write access on the resources they create. For now, access must be granted via the UI or via the CLI (pscale service-token add-access)
10
+
Support for deployments, deploy queues, deploy requests and reverts is not implemented at this time. If you have a use case for it, please let us know in the repository issues.When using service tokens (recommended), ensure the token has the create_databases organization-level permission. This allows terraform to create new databases and automatically grants the token all other permissions on the databases created by the token.
11
11
---
12
12
13
13
# planetscale Provider
@@ -21,7 +21,7 @@ Note that the provider is not production ready and only for early testing at thi
21
21
22
22
Known limitations:
23
23
- Support for deployments, deploy queues, deploy requests and reverts is not implemented at this time. If you have a use case for it, please let us know in the repository issues.
24
-
-Service tokens don't immediately have read/write access on the resources they create. For now, access must be granted via the UI or via the CLI (`pscale service-token add-access`)
24
+
-When using service tokens (recommended), ensure the token has the `create_databases` organization-level permission. This allows terraform to create new databases and automatically grants the token all other permissions on the databases created by the token.
25
25
26
26
## Example Usage
27
27
@@ -47,4 +47,5 @@ provider "planetscale" {
47
47
-`access_token` (String, Sensitive) Name of the service token to use. Alternatively, use `PLANETSCALE_SERVICE_TOKEN_NAME`. Mutually exclusive with `service_token_name` and `service_token`.
48
48
-`endpoint` (String) If set, points the API client to a different endpoint than `https:://api.planetscale.com/v1`.
49
49
-`service_token` (String, Sensitive) Value of the service token to use. Alternatively, use `PLANETSCALE_SERVICE_TOKEN`. Mutually exclusive with `access_token`.
50
-
-`service_token_name` (String) Name of the service token to use. Alternatively, use `PLANETSCALE_SERVICE_TOKEN_NAME`. Mutually exclusive with `access_token`.
50
+
-`service_token_id` (String) ID of the service token to use. Alternatively, use `PLANETSCALE_SERVICE_TOKEN_ID`. Mutually exclusive with `access_token`.
51
+
-`service_token_name` (String, Deprecated) Name of the service token to use. Alternatively, use `PLANETSCALE_SERVICE_TOKEN_NAME`. Mutually exclusive with `access_token`. (Deprecated, use `service_token_id` instead)
Copy file name to clipboardExpand all lines: docs/resources/database.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,15 +5,15 @@ subcategory: ""
5
5
description: |-
6
6
A PlanetScale database.
7
7
Known limitations:
8
-
When the provider is configured with a service token, the service token needs to manually be granted permission on this database resource. This can be done in the UI or via the CLI (pscale service-token add-access).
8
+
When using service tokens (recommended), ensure the token has the create_databases organization-level permission. This allows terraform to create new databases and automatically grants the token all other permissions on the databases created by the token.
9
9
---
10
10
11
11
# planetscale_database (Resource)
12
12
13
13
A PlanetScale database.
14
14
15
15
Known limitations:
16
-
- When the provider is configured with a service token, the service token needs to manually be granted permission on this database resource. This can be done in the UI or via the CLI (`pscale service-token add-access`).
16
+
- When using service tokens (recommended), ensure the token has the `create_databases` organization-level permission. This allows terraform to create new databases and automatically grants the token all other permissions on the databases created by the token.
- When the provider is configured with a service token, the service token needs to manually be granted permission on this database resource. This can be done in the UI or via the CLI (`+"`pscale service-token add-access`"+`).`,
135
+
- When using service tokens (recommended), ensure the token has the `+"`create_databases`"+` organization-level permission. This allows terraform to create new databases and automatically grants the token all other permissions on the databases created by the token.`,
136
136
Attributes: map[string]schema.Attribute{
137
137
"organization": schema.StringAttribute{
138
138
Description: "The organization this database belongs to.",
@@ -62,7 +63,7 @@ Note that the provider is not production ready and only for early testing at thi
62
63
63
64
Known limitations:
64
65
- Support for deployments, deploy queues, deploy requests and reverts is not implemented at this time. If you have a use case for it, please let us know in the repository issues.
65
-
- Service tokens don't immediately have read/write access on the resources they create. For now, access must be granted via the UI or via the CLI (`+"`pscale service-token add-access`"+`)`,
66
+
- When using service tokens (recommended), ensure the token has the `+"`create_databases`"+` organization-level permission. This allows terraform to create new databases and automatically grants the token all other permissions on the databases created by the token.`,
66
67
Attributes: map[string]schema.Attribute{
67
68
"endpoint": schema.StringAttribute{
68
69
MarkdownDescription: "If set, points the API client to a different endpoint than `https:://api.planetscale.com/v1`.",
MarkdownDescription: "Name of the service token to use. Alternatively, use `PLANETSCALE_SERVICE_TOKEN_NAME`. Mutually exclusive with `access_token`.",
91
+
MarkdownDescription: "Name of the service token to use. Alternatively, use `PLANETSCALE_SERVICE_TOKEN_NAME`. Mutually exclusive with `access_token`. (Deprecated, use `service_token_id` instead)",
82
92
Optional: true,
93
+
DeprecationMessage: "Use service_token_id instead. This field will be removed in a future version.",
0 commit comments