Issue setting up Airbyte cloud with Terraform for connection and selecting fields

Summary

When setting up a connection and selecting fields in Airbyte cloud using Terraform, encountering a HTTP/2.0 400 Bad Request response. Looking for assistance in resolving this issue.


Question

Hi All,
I am setting up Airbyte cloud with Terraform and just run into an issue when trying to setup a connection and selecting fields. Not sure what I am doing wrong. Has anyone run into the a similar issue?

  data_residency                       =
  destination_id                       = 
  name                                 = "Zendesk"
  non_breaking_schema_updates_behavior = "propagate_columns"
  prefix                               = "zendesk_"
  source_id                            = 
  for_each =  { for stream in local.zendesk_streams.streams : stream.name => stream }
  configurations = {
    streams = [{
      name = each.value.name
      cursor_field = each.value.cursor_field
      selected_fields = [
        {
          field_path = each.value.selected_fields
        }
      ]
      sync_mode = each.value.sync_mode
    }]
  }
}```
The template renders correctly, but I get a `HTTP/2.0 400 Bad Request` response.

<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/p1730300649403449) if you want 
to access the original thread.

[Join the conversation on Slack](https://slack.airbyte.com)

<sub>
["airbyte-cloud", "terraform", "connection", "selecting-fields", "http-400-bad-request"]
</sub>

What happen if you remove the for_each loop? Can you try to create one connector without it?

I figured out the issue. In the selected fields, I cannot pass more than one field in the list. It has to be one attribute per field.
I also removed the for_each.

<@U01MMSDJGC9> now it complains about the cursor_field not being included in the selected_fields. But it I am including it, I the terraform plan output, I can see it is included. Is this a problems someone else has had?

<@U07TYLTKZ70> can you paste current terraform code?