dbt-labs / terraform-provider-dbtcloud

dbt Cloud Terraform Provider
https://registry.terraform.io/providers/dbt-labs/dbtcloud
MIT License
80 stars 18 forks source link

dbtcloud_repository resource issue with auto-retrieval of the `github_installation_id` #187

Closed ruben-cit closed 9 months ago

ruben-cit commented 10 months ago

When trying to implement the resource "dbtcloud_repository" "github_repo_other" here I run into the following error.

│ Error: Invalid index
│
│   on transform.tf line 30, in locals:
│   30:   github_installation_id = jsondecode(data.http.github_installations_response.response_body)[0].id
│     ├────────────────
│     │ data.http.github_installations_response.response_body is "{\"status\":{\"code\":400,\"is_success\":false,\"user_message\":\"The request was invalid. Please double check the provided data and try again.\",\"developer_message\":\"\"},\"data\":{\"reason\":\"This endpoint cannot be accessed with a service token.\"}}"

I ended up just setting this up manually but just wanted to flag for y'all. Lmk if you need more details.

b-per commented 10 months ago

Thanks for raising the issue. I will add more details in the docs about it. I'll check with the team if there would be a way to make the endpoint work with a service token but as the GitHub integration is set via OAuth I don't know if it will be possible.

b-per commented 9 months ago

Closing for now as I have updated the docs but let's see if it will be possible at some point to retrieve the GH installation ID using service tokens.