Nested TypeSet
structures in avi_cloud resource always report as changed
#19
Labels
TypeSet
structures in avi_cloud resource always report as changed
#19
Issue Description
The Avi provider is incorrectly reporting changes to
avi_cloud
resources when a nestedTypeSet
is defined in TF config files.Steps to Reproduce
avi_cloud
resource.apply
, immediately execute anotherplan
without making code changes.Expected Result
Terraform should report no changes. Console output should be...
Actual Result
Terraform reports changes to the entire
oshiftk8s_configuration
dict.Analysis
As you can see, the Avi provider is not doing a proper diff of the nested
oshiftk8s_configuration
resource. After some research, it appears the issue is related to how the schema for this resource is defined.oshiftk8s_configuration
is defined asTypeSet
and includes other nestedTypeSet
attributes, such asavi_bridge_subnet
,docker_registry_se
, etc. Based on this comment, it appears the usage of nestedTypeSet
resources is a limitation of the current version of the Terraform SDK. In order to preserve the current config structure, it is recommended to useTypeList
withMaxItems: 1
instead ofTypeSet
. I tried making this change locally, however, I ran into type conversion errors...This error is thrown within
SetDefaultsInAPIRes
method inutils.go
.Considering this is common behavior in managing Avi resources via Terraform, I believe this is a critical bug.
The text was updated successfully, but these errors were encountered: