The above code block leads to deletion and creation of the lake formation permission on multiple runs due to internal/implicit reordering in the provider to lexical order.
Changing the source in Terraform for permissions to be lexical order stops this unexpected behaviour.
The documentation hints towards implicit lexical ordering. This helped with troubleshooting this issue. Happy to document this in the provider explicitly.
Valid values may include ALL, ALTER, ASSOCIATE, CREATE_DATABASE, CREATE_TABLE, DATA_LOCATION_ACCESS, DELETE, DESCRIBE, DROP, INSERT, and SELECT
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
If you are interested in working on this issue, please leave a comment.
If this would be your first contribution, please review the contribution guide.
Terraform Core Version
1.3.6
AWS Provider Version
4.64.0
Affected Resource(s)
Expected Behavior
The following code block should not lead to deletion/creation of resources if unchanged.
Actual Behavior
The above code block leads to deletion and creation of the lake formation permission on multiple runs due to internal/implicit reordering in the provider to lexical order.![image](https://user-images.githubusercontent.com/491396/235586881-4e120d7e-fbc5-4988-9217-149be2dd9d31.png)
Changing the source in Terraform for permissions to be lexical order stops this unexpected behaviour.
Relevant Error/Panic Output Snippet
Terraform Configuration Files
N/A
Steps to Reproduce
N/A
Debug Output
N/A
Panic Output
N/A
Important Factoids
The documentation hints towards implicit lexical ordering. This helped with troubleshooting this issue. Happy to document this in the provider explicitly.
References
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lakeformation_permissions
Would you like to implement a fix?
Yes