Hi Team, Testing how the new Terraform Provider wo...
# replication-ask-ai
i
Hi Team, Testing how the new Terraform Provider works locally(oss). I come across a
405 Not Allowed
error -- any help will be greatly appreciated. Setup Flow Setup Airbyte locally(Linux & Docker Desktop) following guide, which works fine.
Copy code
# clone Airbyte from GitHub
git clone <https://github.com/airbytehq/airbyte.git>

# switch into Airbyte directory
cd airbyte

# start Airbyte
./run-ab-platform.sh
Set up terraform using the Airbyte Terraform Provider setup guide. main.tf
Copy code
terraform {
  required_providers {
    airbyte = {
      source  = "airbytehq/airbyte"
      version = "0.3.1"
    }
  }
}

provider "airbyte" {
  username = "airbyte"
  password = "password"
  server_url = "<http://localhost:8000>"
}

resource "airbyte_source_stripe" "my_source_stripe" {
  configuration = {
    sourceType = "stripe"
    account_id = "acct_123"
    client_secret = "sklive_abc"
    start_date = "2023-07-01T00:00:00Z"
    lookback_window_days = 0
    slice_range = 365
  }
  name = "Stripe"
  workspace_id = "cfe713f3-d6cf-4152-94b4-f2b21f3e7153"}
After which I ran the
terraform plan
and
terraform apply
commands which results in the following error Error
Copy code
│ Error: unexpected response from API. Got an unexpected response code 405
│ 
│   with airbyte_source_stripe.my_source_stripe,
│   on <http://main.tf|main.tf> line 18, in resource "airbyte_source_stripe" "my_source_stripe":
│   18: resource "airbyte_source_stripe" "my_source_stripe" {
│ 
│ **Request**:
│ POST /sources HTTP/1.1
│ Host: localhost:8000
│ Accept: application/json
│ Authorization: Basic YWlyYnl0ZTpwYXNzd29yZA==
│ Content-Type: application/json
│ User-Agent: speakeasy-sdk/terraform 0.3.1 2.83.3 1.0.0
│ 
│ 
│ **Response**:
│ HTTP/1.1 405 Not Allowed
│ Transfer-Encoding: chunked
│ Connection: keep-alive
│ Content-Type: text/html
│ Date: Tue, 15 Aug 2023 10:45:56 GMT
│ Server: nginx/1.25.1
│ 
│ 115
│ <html>
│ <head><title>405 Not Allowed</title><script data-script="config-overwrites">
│                 window.TRACKING_STRATEGY = "segment";
│                 </script></head>
│ <body>
│ <center><h1>405 Not Allowed</h1></center>
│ <hr><center>nginx/1.25.1</center>
│ </body>
│ </html>
✅ 1
👀 1
k
Based on the information provided in the extracts, it seems like you're encountering a
405 Not Allowed
error when trying to use the Airbyte Terraform Provider. This error typically indicates that the HTTP method you're trying to use is not allowed by the server. However, the extracts do not provide specific information on how to resolve this issue with the Airbyte Terraform Provider. It's possible that there might be a mismatch between the API endpoints expected by the Terraform Provider and those provided by your local Airbyte instance. I recommend checking the following: 1. Ensure that your Airbyte instance is running and accessible at the
server_url
you specified in your Terraform configuration. 2. Verify that the Airbyte version you're running locally is compatible with the version of the Airbyte Terraform Provider you're using. 3. Check the Airbyte [API documentation](https://docs.airbyte.com/understanding-airbyte/api) to ensure the endpoints and methods align with those expected by the Terraform Provider. If the issue persists, I recommend reaching out to the Airbyte community on [Slack](https://airbytehq.slack.com) or [GitHub](https://github.com/airbytehq/airbyte) for further assistance.
i
Resolved by referring to docs https://github.com/airbytehq/airbyte-platform/tree/main/airbyte-api-server and ensuring Airbyte version was sufficiently up to date that the
Airbyte_api_server
is present in the docker_compose.yaml file. The following url can be used as the server_url in the terraform provider
<http://localhost:8006/v1/>
.