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
[x] Added CHANGELOG entry (only for user-facing changes)
[x] Acceptance tests where run against all supported Vault Versions
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
Please vote on this pull request by adding a đź‘Ť reaction to the original pull request comment to help the community and maintainers prioritize this request
Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request
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:
Community Note