Summary
The user is encountering an ‘Invalid Attribute Type’ error when configuring Google Sheets as a source in Airbyte using Terraform. They are specifically having issues with the credentials block for service account authentication.
Question
I am working on automating data synchronization between Google Sheets and Teradata Vantage using Airbyte with Terraform. My goal is to set up a source in Airbyte for Google Sheets, but I am encountering configuration issues specifically with Google Sheets authentication.
Here is the configuration code I have set up in http://main.tf|main.tf:
required_providers {
airbyte = {
source = "airbytehq/airbyte"
version = "0.3.3"
}
}
}
provider "airbyte" {
// If running on Airbyte Cloud,
// generate & save your API key from <https://portal.airbyte.com>
bearer_auth = var.api_key
}
resource "airbyte_source_google_sheets" "my_source_gsheets" {
configuration = {
source_type = "google-sheets"
credentials = {
auth_type = "Service"
service_account_info = var.google_private_key
},
names_conversion = true,
spreadsheet_id = var.spreadsheet_id
}
name = "googlesheets_from_api"
workspace_id = var.workspace_id
}```
When running terraform apply, I receive the following error:
```➜ terraform_airbyte terraform apply
╷
│ Error: Invalid Attribute Type
│
│ with airbyte_source_google_sheets.my_source_gsheets,
│ on <http://main.tf|main.tf> line 16, in resource "airbyte_source_google_sheets" "my_source_gsheets":
│ 16: resource "airbyte_source_google_sheets" "my_source_gsheets" {
│
│ Attribute configuration.credentials value must have exactly one child attribute defined,
│ got:
│ {"source_google_sheets_authentication_authenticate_via_google_o_auth":<null>,"source_google_sheets_authentication_service_account_key_authentication":<null>,"source_google_sheets_update_authentication_authenticate_via_google_o_auth":<null>,"source_google_sheets_update_authentication_service_account_key_authentication":<null>}```
I am following the quickstart tutorial which recommends using docs to retrieve configuration attributes, and I am using those docs to figure out the attributes. However I am unsure of what I am doing wrong.
1. Is my configuration for the `credentials` block in the `airbyte_source_google_sheets` resource correct for service account authentication?
2. How should the `credentials` block be structured to avoid the "Invalid Attribute Type" error?
3. Are there any known issues or additional steps I should be aware of when configuring Google Sheets as a source in Airbyte via Terraform?
Any assistance or insights into resolving this issue would be greatly appreciated.
Thank you!
<br>
---
This topic has been created from a Slack thread to give it more visibility.
It will be on Read-Only mode here. [Click here](https://airbytehq.slack.com/archives/C021JANJ6TY/p1707430374932509) if you want to access the original thread.
[Join the conversation on Slack](https://slack.airbyte.com)
<sub>
["google-sheets", "teradata-vantage", "airbyte", "terraform", "authentication", "service-account", "configuration", "error"]
</sub>