hashicorp / terraform-provider-vault

Terraform Vault provider
https://www.terraform.io/docs/providers/vault/
Mozilla Public License 2.0
451 stars 535 forks source link

Azure Creds: Honors the documented default behavior (again) #2190

Closed TheLonelyGhost closed 3 months ago

TheLonelyGhost commented 3 months ago

If no environment is specified, will show up as an empty string and (currently) throw an error that "" is an unknown cloud provider. After this change it allows the environment attribute on the datasource to be optional again.

Ideally this would fetch the value from Vault, but for most cases we may want the default to be Azure Public Cloud, which is the default on the Vault backend if nothing is specified.

Description

Documented behavior of the azure credentials data source is that environment is optional. In reality, not providing it (only in v4.0.0) results in an error message saying "" is an unknown cloud provider.

Closes #2189

Checklist

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccDataSourceAzureAccessCredentials'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test -run=TestAccDataSourceAzureAccessCredentials -timeout 30m ./...
?       github.com/hashicorp/terraform-provider-vault   [no test files]
?       github.com/hashicorp/terraform-provider-vault/cmd/coverage      [no test files]
?       github.com/hashicorp/terraform-provider-vault/cmd/generate      [no test files]
?       github.com/hashicorp/terraform-provider-vault/internal/consts   [no test files]
?       github.com/hashicorp/terraform-provider-vault/helper    [no test files]
ok      github.com/hashicorp/terraform-provider-vault/codegen   0.319s [no tests to run]
?       github.com/hashicorp/terraform-provider-vault/internal/identity/group   [no test files]
?       github.com/hashicorp/terraform-provider-vault/internal/identity/mfa     [no test files]
?       github.com/hashicorp/terraform-provider-vault/internal/pki      [no test files]
ok      github.com/hashicorp/terraform-provider-vault/internal/identity/entity  (cached) [no tests to run]
?       github.com/hashicorp/terraform-provider-vault/internal/sync     [no test files]
?       github.com/hashicorp/terraform-provider-vault/schema    [no test files]
?       github.com/hashicorp/terraform-provider-vault/util/mountutil    [no test files]
ok      github.com/hashicorp/terraform-provider-vault/internal/provider (cached) [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/testutil  (cached) [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/util      (cached) [no tests to run]
ok      github.com/hashicorp/terraform-provider-vault/vault     0.654s

Community Note

hashicorp-cla commented 3 months ago

CLA assistant check
All committers have signed the CLA.