OpenNebula / terraform-provider-opennebula

Terraform provider for OpenNebula
https://www.terraform.io/docs/providers/opennebula/
Mozilla Public License 2.0
61 stars 54 forks source link

Unable to supply credentials using OPENNEBULA_USERNAME and OPENNEBULA_PASSWORD environment variables #501

Closed jamie-pate closed 5 months ago

jamie-pate commented 8 months ago

Description

The documentation says that we should be able to pass username and password using environment variables:

https://registry.terraform.io/providers/OpenNebula/opennebula/latest/docs#environment-variables

But the username and password fields are required in 1.3.1 and

Terraform and Provider version

Terraform v1.6.2 on linux_amd64

Affected resources and data sources

provider

Terraform configuration

provider "opennebula" {
  endpoint      = var.one.endpoint
  flow_endpoint = var.one.flow_endpoint
}

Expected behavior

As documented I expect to be able to omit the username and password fields in the provider configuration and have the provider read them from the environment.

Actual behavior

These properties are required, and if they are blank then the provider throws an error:

╷
│ Error: username should be defined
│ 
│   with provider["registry.terraform.io/opennebula/opennebula"],
│   on main.tf line 64, in provider "opennebula":
│   64: provider "opennebula" {
│ 
╵
│ Error: password should be defined
│ 
│   with provider["registry.terraform.io/opennebula/opennebula"],
│   on main.tf line 64, in provider "opennebula":
│   64: provider "opennebula" {
│ 

Steps to Reproduce

Create a configuration and try to use OPENNEBULA_USERNAME and OPENNEBULA_PASSWORD following the documentation

Debug output

No response

Panic output

No response

Important factoids

No response

References

https://registry.terraform.io/providers/OpenNebula/opennebula/latest/docs#environment-variables https://github.com/OpenNebula/terraform-provider-opennebula/issues/121#issuecomment-1112159627

github-actions[bot] commented 7 months ago

This issue is stale because it has been open for 30 days with no activity and it has not the 'status: confirmed' label or it is not in a milestone. Remove the 'status: stale' label or comment, or this will be closed in 5 days.

jamie-pate commented 7 months ago

Afaik this is still an issue?

github-actions[bot] commented 6 months ago

This issue is stale because it has been open for 30 days with no activity and it has not the 'status: confirmed' label or it is not in a milestone. Remove the 'status: stale' label or comment, or this will be closed in 5 days.

jamie-pate commented 6 months ago

not fixing itself.. 30 days seems really short for 'stale'

frousselet commented 6 months ago

Hello @jamie-pate,

How do you export both variables? Tried on my side and I get it working properly.

github-actions[bot] commented 5 months ago

This issue is stale because it has been open for 30 days with no activity and it has not the 'status: confirmed' label or it is not in a milestone. Remove the 'status: stale' label or comment, or this will be closed in 5 days.