Using Terraform for Marketplace Connectors

Summary

User inquires about the possibility of utilizing Terraform for deploying Marketplace connectors, specifically referencing the MixMax integration documentation.


Question

Is there a way to use terraform for Marketplace connectors? Looking at MixMax: https://docs.airbyte.com/integrations/sources/mixmax



This topic has been created from a Slack thread to give it more visibility.
It will be on Read-Only mode here. Click here if you want
to access the original thread.

Join the conversation on Slack

['terraform', 'marketplace-connectors', 'mixmax', 'airbyte']

Airbyte team generates and adds new connectors from time to time to terraform provider. If something is not supported with a special resource yet, you can use “generic” one

https://registry.terraform.io/providers/airbytehq/airbyte/latest/docs/resources/source_custom
https://registry.terraform.io/providers/airbytehq/airbyte/latest/docs/resources/destination_custom

:warning: I think there might be an error in docs
if configuration = { "user" : "charles" } doesn’t work, you need something like configuration = jsonencode({ "user" : "charles" })

I’m trying it for gong, get errors Inappropriate value for attribute "configuration": string required.

  configuration = {"gong_access_key": "abcd1234", "gong_access_secret": "hadslkfjhsadllkjhlasjdhf"}
  name          = "gong" ...```

adding the jsonencode:

│ 
│ Invalid value for "str" parameter: string required.
╵```

you didn’t use jsonencode

https://registry.terraform.io/providers/airbytehq/airbyte/latest/docs/resources/source_custom
definition_id (String) The UUID of the connector definition. One of configuration.sourceType or definitionId must be provided. Requires replacement if changed.
Let me know if configuration works with definition_id = "32382e40-3b49-4b99-9c5c-4076501914e7"
https://github.com/airbytehq/airbyte/blob/5e17bbc604fc20b3d18e7205d437a85d8c419755/airbyte-integrations/connectors/source-gong/metadata.yaml#L9|metadata.yaml#L9

  configuration = jsonencode({
    access_key        = "..."
    access_key_secret = "..."
  })

  name = "gong"
  
  definition_id = "32382e40-3b49-4b99-9c5c-4076501914e7"

  # ...
}```

Another option is with sourceType in configuration

  configuration = jsonencode({
    access_key        = "..."
    access_key_secret = "..."
    sourceType        = "gong"
  })

  name = "gong"

  # ...
}```

Airbyte team generates and adds new connectors from time to time to terraform provider. If something is not supported with a special resource yet, you can use “generic” one

https://registry.terraform.io/providers/airbytehq/airbyte/latest/docs/resources/source_custom
https://registry.terraform.io/providers/airbytehq/airbyte/latest/docs/resources/destination_custom

:warning: I think there might be an error in docs
if configuration = { "user" : "charles" } doesn’t work, you need something like configuration = jsonencode({ "user" : "charles" })

I’m trying it for gong, get errors Inappropriate value for attribute "configuration": string required.

  configuration = {"gong_access_key": "abcd1234", "gong_access_secret": "hadslkfjhsadllkjhlasjdhf"}
  name          = "gong" ...```

adding the jsonencode:

│ 
│ Invalid value for "str" parameter: string required.
╵```

you didn’t use jsonencode

  configuration = jsonencode({"gong_access_key": "...", "gong_access_secret": "..."})
  name          = "gong"
}```

│ unknown status code returned: Status 422
│ {“status”:422,“type”:“https://reference.airbyte.com/reference/errors#unprocessable-entity”,“title”:“unprocessable-entity”,“detail”:“The body of the request was not
│ understood”,“documentationUrl”:null,“data”:null}

the result using jsonencode :woman-facepalming:

every connector has specification about fields and their names

in case of source-gong connector https://github.com/airbytehq/airbyte/blob/5e17bbc604fc20b3d18e7205d437a85d8c419755/airbyte-integrations/connectors/source-gong/manifest.yaml#L252-L263|manifest.yaml#L252-L263
I think configuration will look like this

  configuration = jsonencode({
    access_key        = "..."
    access_key_secret = "..."
  })

  name = "gong"
  
  # ...
}```

still getting

│ unknown status code returned: Status 422
│ {"status":422,"type":"<https://reference.airbyte.com/reference/errors#unprocessable-entity>","title":"unprocessable-entity","detail":"The body of the request was not
│ understood","documentationUrl":null,"data":null}
╵```

https://registry.terraform.io/providers/airbytehq/airbyte/latest/docs/resources/source_custom
definition_id (String) The UUID of the connector definition. One of configuration.sourceType or definitionId must be provided. Requires replacement if changed.
Let me know if configuration works with definition_id = "32382e40-3b49-4b99-9c5c-4076501914e7"
https://github.com/airbytehq/airbyte/blob/5e17bbc604fc20b3d18e7205d437a85d8c419755/airbyte-integrations/connectors/source-gong/metadata.yaml#L9|metadata.yaml#L9

  configuration = jsonencode({
    access_key        = "..."
    access_key_secret = "..."
  })

  name = "gong"
  
  definition_id = "32382e40-3b49-4b99-9c5c-4076501914e7"

  # ...
}```

Another option is with sourceType in configuration

  configuration = jsonencode({
    access_key        = "..."
    access_key_secret = "..."
    sourceType        = "gong"
  })

  name = "gong"

  # ...
}```

that worked! thank you, now I know where to get the definition id!