Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: align service token env vars with pscale cli #103

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

joemiller
Copy link
Member

Deprecate PLANETSCALE_SERVICE_TOKEN_NAME in favor of PLANETSCALE_SERVICE_TOKEN_ID to match the pscale CLI conventions.

  • Replace environment variable for better CLI alignment
  • Maintain backwards compatibility with warning messages
  • Update service-token limitation documentation

Reference: https://github.com/planetscale/cli/blob/main/README.md?plain=1#L97-L98

@joemiller joemiller requested review from a team as code owners January 23, 2025 17:22
mdlayher
mdlayher previously approved these changes Jan 23, 2025
Deprecate `PLANETSCALE_SERVICE_TOKEN_NAME` in favor of `PLANETSCALE_SERVICE_TOKEN_ID` to match the pscale CLI conventions.

- Replace environment variable for better CLI alignment
- Maintain backwards compatibility with warning messages
- Update service-token limitation documentation

Reference: https://github.com/planetscale/cli/blob/main/README.md?plain=1#L97-L98
@@ -7,7 +7,7 @@ description: |-
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
Note that the provider is not production ready and only for early testing at this time.
Known limitations:
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)
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mdlayher I know this looks weird, and it puzzled me for several minutes. This is generated by tfplugindocs. It is in the front-matter of the yaml and so I presume it is fine, because the actual rendered documentation a few lines lower in this file has the proper formatting and this is what is visbile on the TF registry page here: https://registry.terraform.io/providers/planetscale/planetscale/latest/docs

@joemiller joemiller merged commit bca1710 into main Jan 23, 2025
15 checks passed
@joemiller joemiller deleted the joem/align-token-env-vars branch January 23, 2025 18:12
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.

2 participants