vmware / terraform-provider-vcf

Terraform Provider for VMware Cloud Foundation
https://registry.terraform.io/providers/vmware/vcf/
Mozilla Public License 2.0
21 stars 9 forks source link

Improper Error message for missing SDDC info #238

Open pradeep17j opened 5 days ago

pradeep17j commented 5 days ago

Code of Conduct

Terraform

v1.7.2

Terraform Provider

0.9.1

VMware Cloud Foundation

v5.0

Description

When SDDC information is not provided while creating resource vcf_domain , the error message complains about missing Cloud builder information . The error message should have been about missing SDDC info

Planning failed. Terraform encountered an error while generating this plan.

β•·
β”‚ Error: Invalid provider configuration
β”‚
β”‚ Provider "registry.terraform.io/vmware/vcf" requires explicit configuration. Add a provider block to the root module and configure the provider's required arguments as described in the provider documentation.
β”‚
β•΅
β•·
β”‚ Error: CloudBuilder username, password and host must be provided
β”‚
β”‚   with provider["registry.terraform.io/vmware/vcf"],
β”‚   on <empty> line 0:
β”‚   (source code not available)

Affected Resources or Data Sources

resource/vcf_domain

Terraform Configuration

provider.tf file without provider vcf{} block

Debug Output

Planning failed. Terraform encountered an error while generating this plan.

β•·
β”‚ Error: Invalid provider configuration
β”‚
β”‚ Provider "registry.terraform.io/vmware/vcf" requires explicit configuration. Add a provider block to the root module and configure the provider's required arguments as described in the provider documentation.
β”‚
β•΅
β•·
β”‚ Error: CloudBuilder username, password and host must be provided
β”‚
β”‚   with provider["registry.terraform.io/vmware/vcf"],
β”‚   on <empty> line 0:
β”‚   (source code not available)

Panic Output

No response

Expected Behavior

Complains about missing Cloud builder information

Actual Behavior

Should have mentioned about missing SDDC manager information

Steps to Reproduce

terraform plan with out provider vcf { } block in provider.tf file

Environment Details

No response

Screenshots

No response

References

No response

tenthirtyam commented 5 days ago

Ah, this is an easy fix in the providerConfigure function where if the sddc manager username is not provided it's assume to be cloud builder. will need an else if and then an else with a generic provider credentials error.

tenthirtyam commented 4 days ago

Addressed in #239.