vsphere_entity_permissions
resource drops other built-in externally managed permissions on next apply
#1517
Labels
acknowledged
Status: Issue or Pull Request Acknowledged
bug
Type: Bug
duplicate
Status: Duplicate Issue
Terraform Version
Terraform v1.0.5
vSphere Provider Version
2.0.2
Affected Resource(s)
vsphere_entity_permissions
Terraform Configuration Files
Debug Output
https://gist.github.com/GolubevV/d3831fbd6cbae3b94a64d46c687c8557
Expected Behavior
When using
vsphere_entity_permissions
resource with explicitly specified permissions block, the provider should be managing only that specific permission on the Vsphere object, e.g - configured permission entity between Rule, target and grantee.Terraform should not be dropping permissions which it does not manage though the code - as an example, aws provider does not drop ingress/egress rules on SecurityGroup object that are changed outside terraform code.
Actual Behavior
At first execution, terraform proposed to add missing permission on the specified object (root folder) which is correct behaviour.
However, looks like during apply it retrieves all permissions which have been assigned to the object and stores them in the state.
During next run, terraform proposes to drop all permissions except those which are configured in the code.
The only way to workaround situation and do not drop some built-in permissions is to add
lifycycle/ignore changes
directive but that will also cause to ignore all changes on the permissions managed by terraform, which defeats the whole purpose of using it.Steps to Reproduce
vsphere_entity_permissions
resource with entity_id of some existing Vsphere object of typeFolder
which has some built-in permissions already attached to it (did not test for others Vmware objects).References
Community Note
The text was updated successfully, but these errors were encountered: