terraform-provider-airbyte icon indicating copy to clipboard operation
terraform-provider-airbyte copied to clipboard

Facebook Marketing connector expects field account_ids instead of single string account_id

Open FinnGebauer opened this issue 1 year ago • 1 comments

Description

It seems that since the Airbyte Facebook connector v1.3.0 (which allows for multiple ad account ids), the expectations of Terraform and Airbyte are not aligned anymore. Terraform only expects a field account_id while Airbyte expects a field account_ids. This is the case for v0.3.7 of the Terraform Airbyte Provider and v0.50.47 of Airbyte.

Airbyte Facebook Marketing Changelog

Steps to reproduce

  1. Create a new source for Facebook Marketing following the JSON schema provided by Terraform resource "airbyte_source_facebook_marketing" "my_source_facebook_marketing" { configuration = { access_token = "access_token" account_id = "account_id" source_type = "facebook-marketing" start_date = "2022-01-01T00:00:00Z" } name = "Facebook/Meta-Ads" workspace_id = "workspace_id" }

  2. Use terraform plan to get the planned updates

  3. Use terraform apply to apply the changes and receive the following error **Response**: │ HTTP/1.1 422 Unprocessable Entity │ Content-Length: 334 │ Connection: keep-alive │ Content-Type: application/problem+json │ Date: Wed, 07 Feb 2024 14:39:34 GMT │ Server: nginx/1.25.3 │ │ {"type":"https://reference.airbyte.com/reference/errors#unprocessable-entity","title":"unprocessable-entity","status":422,"detail":"The │ provided configuration does not fulfill the specification. Errors: json schema validation failed when comparing the data to the │ json schema. \nErrors: $.account_ids: is missing but it is required "}

FinnGebauer avatar Feb 07 '24 14:02 FinnGebauer

To add on to this, I tried setting account_ids as an array, but when I apply the plan, it returns an error Inappropriate value for attribute "configuration": attribute "account_id" is required. I tried setting both account_id and account_ids but that didn't work either. @FinnGebauer were you able to get a source setup using an array of account_ids? This is my config:

resource "airbyte_source_facebook_marketing" "facebook_source" { name = "FB Ads source" workspace_id = var.airbyte_workspace_id configuration = { access_token = var.facebook_token account_ids = ["12345","45677"] include_deleted = true start_date = "2021-01-25T00:00:00Z" } }

rshorser avatar Feb 18 '24 14:02 rshorser