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

Unexpected behavior during terraform apply step with fivetran_connector resource #368

Open
loeakaodas opened this issue Oct 11, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@loeakaodas
Copy link

loeakaodas commented Oct 11, 2024

Describe the bug
When attempting to run a terraform apply the below error is produced. No issues flagged when running terraform plan.

fivetran_connector.tf_test_connector: Creating...
╷
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to fivetran_connector.tf_test_connector, provider "provider[\"registry.terraform.io/fivetran/fivetran\"]" produced an unexpected new value: .config.api_version: was
│ cty.StringVal("random_value"), but now null.
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵

To Reproduce
Below is the resource block that is causing the issue. The config in this case intentionally has an extra value api_version as I'm testing how this would work if these k/v are provided by users and aren't validated. Running terraform apply with the latest version and example config causes the error.

resource "fivetran_connector" "tf_test_connector" {
  group_id        = fivetran_group.my_destination.id
  service         = "fivetran_log"
  run_setup_tests = true

  destination_schema {
    name = "tf_test_connector"
  }

  config {
    is_account_level_connector = "false"
    api_version                = "random_value"
  }

  timeouts {
    create = "60m"
    update = "60m"
  }

  depends_on = [
    fivetran_destination.my_destination
  ]
}

Expected behavior
I would expect that the connector config would be validated during the plan step and throw an error

Logs & Output
Provide terraform CLI output on plan | apply. If it is possible, please, refer to this guide to enable debug output.

Attached logs of [partial] plan and full apply steps:
tf_plan_log.txt
tf_apply_log.txt

Plugin version:
Using the latest provider version of 1.3.2

Additional context
I believe this is happening because the provider is patching the config fields here...possibly

@loeakaodas loeakaodas added the bug Something isn't working label Oct 11, 2024
@fivetran-jovanmanojlovic
Copy link
Contributor

The api_version is not expected for fivetran_log.

@loeakaodas
Copy link
Author

@fivetran-jovanmanojlovic yes, I am aware of that and would expect the provider throw an error during the plan step instead of the apply step. Because it actually creates the connector and throws an error

@fivetran-aleksandrboldyrev fivetran-aleksandrboldyrev added enhancement New feature or request and removed bug Something isn't working labels Oct 23, 2024
@rohitmsaxena
Copy link

@loeakaodas Were you able to find a workaround? I am also not sure why this is an enhancement when this makes the connector useless.

@loeakaodas
Copy link
Author

@loeakaodas Were you able to find a workaround? I am also not sure why this is an enhancement when this makes the connector useless.

@rohitmsaxena No, I do not have a workaround.

For my use case I could probably validate the inputs before they get to the provider with the OpenAPI spec or just write custom code to call the APIs directly, but this would add an additional maintenance burden for my project. This has delayed a POC I've been working on for over a year (#219) and as a result it's been deprioritized.

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

No branches or pull requests

4 participants