confluentinc / terraform-provider-confluent

Terraform Provider for Confluent
Apache License 2.0
118 stars 61 forks source link

401 While Creating a Connector #361

Closed markjbyrne closed 4 months ago

markjbyrne commented 4 months ago

hey folks, I am encountering a 401 when I attempt to create a postgres sink connector using the terraform provider. Error below,

confluent_connector.postgres_sink_connector: Creating...
╷
│ Error: error creating Connector: error creating Connector: error sending validation request: 401 Unauthorized
│ 
│   with confluent_connector.postgres_sink_connector,
│   on main.tf line 238, in resource "confluent_connector" "postgres_sink_connector":
│  238: resource "confluent_connector" "postgres_sink_connector" {

I do not believe this is an issue with the terraform service account as I am able to create all other resources related to creating a connector (service account, ACLs etc.) using it.

However, I have also tested the database credentials by successfully creating a Postgres sink connector via the console using the same creds.

Hard coding the database credentials into the main.tf file to eliminate credential retrieval via secrets has also led to the same 401 error.

Can you provide any pointers to what this 401 error is related to to help me narrow down the cause.

markjbyrne commented 4 months ago

seeing a 401 when trying to create role bindings also

markjbyrne commented 4 months ago

I have solved this issue. It was due to the service account being created with a reference to a specific provider alias.