Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terraform import doesn't work resource because definition_id forces replacement and re-create the source #88

Open
tdebroc opened this issue Mar 29, 2024 · 1 comment

Comments

@tdebroc
Copy link

tdebroc commented Mar 29, 2024

For our migration from Octavia to Terraform, we want to import already existing datasource (they are in incremental since 6 months) and we can't afford to rebuild from scratch. So we need to import them.
But there is a bug:

How to reproduce:

We create a source with Terraform

resource "airbyte_source_salesforce" "source_salesforce_account" {
configuration = {
auth_type = "Client"
client_id = var.SFSC_CLIENT_ID
client_secret = var.SFSC_CLIENT_SECRET
force_use_bulk_api = true
is_sandbox = false
refresh_token = var.SFSC_REFRESH_TOKEN
start_date = "2024-03-29T13:00:00Z"
stream_slice_step = "PT4H"
streams_criteria = [
{
criteria = "exacts"
value = "Account"
}
]
}
definition_id = "b117307c-14b6-41aa-9422-947e34922962"
name = "Account TF"
workspace_id = var.WORKSPACE_ID
}

Then
terraform state rm airbyte_source_salesforce.source_salesforce_account

Then we import it

terraform import airbyte_source_salesforce.source_salesforce_account XXXXXXXX

XXXXXXXX being the ID of the source that we see into the URL in the UI.

The import goes well.

But then when we do a "terraform apply", we have the following output:

airbyte_source_salesforce.source_salesforce_account22 must be replaced

-/+ resource "airbyte_source_salesforce" "source_salesforce_account22" {
~ configuration = {

  • client_id = "3MVG9HxRZv05HarQD4KPXs1SprmUf7sqvsddljJgqwRtB.gY3YmujSN03R_n5mPQwowobbUoBpSQL6LZl28MW"
  • client_secret = "6651430040331492980"
  • force_use_bulk_api = true
  • is_sandbox = false
  • refresh_token = (sensitive value)
  • start_date = "2024-03-29T13:00:00Z"
  • streams_criteria = [
  • {
  • criteria = "exacts"
  • value = "Account"
    },
    ]
    }
  • definition_id = "b117307c-14b6-41aa-9422-947e34922962" # forces replacement
    name = "Account TF 22"
    ~ source_id = "8fea0e25-7e46-47f4-9af8-f04689de48dd" -> (known after apply)
    ~ source_type = "salesforce" -> (known after apply)

(1 unchanged attribute hidden)

}

Which is bad because we don't want to source to be re-created. We need to be able to import them.

There might be a workaround by commenting "definition_id" but not clear if no side effect.

Is it possible to fix the bug ?

Thanks

Best regards

@octavia-squidington-iii

Zendesk ticket #5513 has been linked to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants