terraform-provider-avi icon indicating copy to clipboard operation
terraform-provider-avi copied to clipboard

Default api_version should match provider version

Open adamfowleruk opened this issue 2 years ago • 1 comments

Describe the bug

The default value for api_version is hardcoded to quite an old version. This means every use of a current release will fail on certain calls (E.g. resource systemconfiguration). The error is here:-

https://github.com/vmware/terraform-provider-avi/blob/69020e02183968fd05244eb9b11cd9fb89747706/avi/provider.go#L300

The error message is not clear, stating that a value is provided (even if it isn't, it just has a default value of false, like common_criteria_enabled) that is not supported when it is, because it's documented and implemented in the provider.

Also this error is not picked up in the plan step but only in the apply step.

Reproduction steps

1. Run any non-trivial call against a recent version of Avi Controller
2.
3.
...

Expected behavior

The default version of the API should, by default, match the release version of the provider.

Also this version mismatch should be better documented in all examples. (Anywhere avi_provider is configured)

Please also validate the configuration applicability to api_version in the plan step, not the apply step.

Also please introduce a test between versions to ensure that as api_version is increased, and new elements introduced, that the resources are not deleted and recreated.

Additional context

No response

adamfowleruk avatar Jun 02 '22 20:06 adamfowleruk