-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Output project API keys from supabase_project resource #71
Comments
Hey thanks for the suggestion. We can certainly add service keys to terraform output. My only concern is that it may take up to a few minutes before a new project becomes ready to serve requests. Do you know if there's an idiomatic way in terraform to check for service health before fetching api keys? |
I'm unfortunately not familiar enough with terraform to answer that. I know it's possible to wait for a resource to be "ready" because creation of certain resources can take a long time (try creating a Redis instance in AWS for example). I got a bit curious and did some digging though, it seems like what you need to do is to not return from the call in ProjectResource::Create() until the project is fully completed, reference: https://discuss.hashicorp.com/t/wait-for-certain-status/54526 So assuming Supabase has some API for polling the ready-state you could just poll until the project is ready to serve requests and that should be fine. Another "solution" would be to not wait at all, this seems to be what the web UI on supabase.com does (it does display an indication that it's not ready though). Terraform is mainly used for setting up infrastructure, but the API key seems to be mostly useful for applications. Most users should be fine with Supabase not being able to serve requests immediately after setup but it does seem a bit ugly. |
Thank you for the input! I will try to implement the no-wait solution next week. |
Has there been any updates on this? |
Bug report
Describe the bug
Currently there is no way of accessing the project API keys for a Supabase project created via Terraform. This means that you need to go into the Supabase UI in order to access these.
If you are (like me 😄 ) trying to setup your database together with your application in Terraform, there is no way to get all the needed data into the application without this manual step.
To Reproduce
N/A
Expected behavior
Service role key and regular keys can be accessed as outputs on the "supabase_project" resource (service role key should be marked as "sensitive").
Screenshots
N/A
System information
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: