<@U04S8PLJWMT>: Warning: Deprecated │ │ with air...
# replication-ask-ai
e
@kapa.ai: Warning: Deprecated │ │ with airbyte_source_mongodb_v2.mongodb_source_v2, │ on main.tf line 88, in resource "airbyte_source_mongodb_v2" "mongodb_source_v2": │ 88: resource "airbyte_source_mongodb_v2" "mongodb_source_v2" { │ │ This resource is deprecated and will be removed in v1.1. Use airbyte_source │ instead (with airbyte_connector_configuration for optional config │ validation). See the v1 migration guide: │ https://registry.terraform.io/providers/airbytehq/airbyte/latest/docs/guides/v1_migration_guide │ │ (and 4 more similar warnings elsewhere) ╵ ╷ │ Error: Error making request
k
You're seeing this warning because
airbyte_source_mongodb_v2
is a typed connector-specific resource that is deprecated in provider 1.0 and will be removed in 1.1. You need to migrate to the generic
airbyte_source
resource. [Migrating to 1.0] Here's how to migrate your MongoDB source: Step 1 — Replace the typed resource Before:
Copy code
resource "airbyte_source_mongodb_v2" "mongodb_source_v2" {
  configuration = {
    database_config = {
      self_managed_replica_set = {
        connection_string = "mongodb://example1.host.com:27017,..."
        databases         = ["mydb"]
        username          = "...my_username..."
        password          = "...my_password..."
        auth_source       = "admin"
        schema_enforced   = false
      }
    }
  }
  name         = "...my_name..."
  workspace_id = var.workspace_id
}
After:
Copy code
data "airbyte_connector_configuration" "mongodb_config" {
  connector_name = "source-mongodb-v2"

  configuration = {
    database_config = {
      self_managed_replica_set = {
        connection_string = "mongodb://example1.host.com:27017,..."
        databases         = ["mydb"]
        username          = "...my_username..."
        auth_source       = "admin"
        schema_enforced   = false
      }
    }
  }

  configuration_secrets = {
    password = var.db_password
  }
}

resource "airbyte_source" "mongodb_source_v2" {
  name          = "...my_name..."
  workspace_id  = var.workspace_id
  definition_id = data.airbyte_connector_configuration.mongodb_config.definition_id
  configuration = data.airbyte_connector_configuration.mongodb_config.configuration_json
}

# Prevents Terraform from destroying and recreating the existing resource
moved {
  from = airbyte_source_mongodb_v2.mongodb_source_v2
  to   = airbyte_source.mongodb_source_v2
}
Step 2 — Update any references
Copy code
# Before:
source_id = airbyte_source_mongodb_v2.mongodb_source_v2.source_id

# After:
source_id = airbyte_source.mongodb_source_v2.source_id
Step 3 — Plan and apply Run
terraform plan
and confirm there are no destroy actions — Terraform should show
moved
for the resource, not `create`/`destroy`. Then run
terraform apply
. [Migration walkthrough] > Note: The
moved
block requires Terraform 1.8 or later. The
airbyte_connector_configuration
data source also validates your configuration against the connector's JSON schema at
terraform plan
time, catching errors before apply. 👍 0 button 👎 0 button ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.