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

Removing secrets_list causes internal connector error #355

Open
nbaju1 opened this issue Sep 4, 2024 · 0 comments
Open

Removing secrets_list causes internal connector error #355

nbaju1 opened this issue Sep 4, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@nbaju1
Copy link

nbaju1 commented Sep 4, 2024

Describe the bug
We're currently in the process of migrating our Lambda connectors to be managed by Terraform. Each connector is being imported into a separate state. For some of the connectors we are also removing the secrets on the connector. When this is done with the TF configuration below (by not defining the secrets_list variable), the connector shows the following error:

"Setup test failed with "java.lang.NullPointerException: Cannot invoke "java.util.List.isEmpty()" because "credentials.secretsList" is null"

The fix we currently use it so manually add and remove a secret from the connector in the UI.

This might be an issue with how we define our Terraform configuration for the secrets, so any tips on a better approach is appreciated.

To Reproduce

data "fivetran_group" "lambda_connectors" {
  id = "<redacted>"
}

data "fivetran_destination" "destination" {
  id = "<redacted>"
}

variable "secrets_list" {
  description = "Dictionary of secrets"
  type = list(object({
    key   = string
    value = string
  }))
  default = []
}

resource "fivetran_connector" "lambda_connector" {
  group_id          = data.fivetran_group.lambda_connectors.id
  service           = "aws_lambda"
  networking_method = "Directly"
  config {
    bucket          = "<bucket_name>"
    external_id     = "<redacted>"
    function        = "<lambda_name>"
    region          = "<region>"
    role_arn        = "<role_arn>"
    sync_method     = "CLOUD_STORAGE"
    connection_type = "Directly"
    dynamic "secrets_list" {
      for_each = var.secrets_list
      content {
        key   = secrets_list.value.key
        value = secrets_list.value.value
      }
  destination_schema {
    name = "<schema_name>"
  }
}

Expected behavior
Connector is updated without the need for manual intervention.

Logs & Output
(Contracted)

          - secrets_list {
              # At least one attribute in this block is (or was) sensitive,
              # so its contents will not be displayed.
            }
        }

Plugin version:
1.2.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants