Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

username/password not supported in provider #2

Closed
bluedog13 opened this issue Oct 15, 2021 · 3 comments
Closed

username/password not supported in provider #2

bluedog13 opened this issue Oct 15, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@bluedog13
Copy link

The examples specify that username/password can be used in the provider. However, in my case when I try the same

provider "confluentcloud" {
  username = var.api_key
  password = var.api_secret
}

I see the below error

Error: Unsupported argument
│ 
│   on providers.tf line 2, in provider "confluentcloud":
│    2:   username = var.api_key
│ 
│ An argument named "username" is not expected here.
╵
╷
│ Error: Unsupported argument
│ 
│   on providers.tf line 3, in provider "confluentcloud":
│    3:   password = var.api_secret
│ 
│ An argument named "password" is not expected here.

Much appreciated.

@bluedog13
Copy link
Author

The below works. The right configuration would be

provider "confluentcloud" {
  api_key    = var.api_key
  api_secret = var.api_secret
}

@linouk23
Copy link
Collaborator

Thanks for both opening the issue and sharing the fix! 👏

You're right, one needs to use api_key instead of username and api_secret instead of password, e.g.:

$ cat variables.tf
variable "confluent_cloud_api_key" {
  type = string
  description = "Cloud API Key"
  sensitive = true
}

variable "confluent_cloud_api_secret" {
  type = string
  description = "Cloud API Secret"
  sensitive = true
}

$ cat terraform.tfvars
confluent_cloud_api_key="..."
confluent_cloud_api_secret="..."

$ cat main.tf
terraform {
  required_providers {
    confluentcloud = {
      source  = "confluentinc/confluentcloud"
      version = "0.1.0"
    }
  }
}

provider "confluentcloud" {
  api_key = var.confluent_cloud_api_key
  api_secret = var.confluent_cloud_api_secret
}

# Create the resources
...

We're going to fix it in our next release 👌

@linouk23 linouk23 added the bug Something isn't working label Oct 24, 2021
@linouk23
Copy link
Collaborator

linouk23 commented Nov 5, 2021

@bluedog13 check out the docs for our new 0.2.0 version where we fixed that documentation bug.
image
Thank you for catching the issue!

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

No branches or pull requests

2 participants