Open amandahla opened 2 weeks ago
@amandahla,
Overall this look good, thank you for the detail.
I'm unsure of stringplanmodifier.RequiresReplace()
for changing the access level. Why do the extra work? It's done that way for JaaS due to limitation of their API as far as I know.
I just noticed that the juju_access_model
resource does the same thing which has me scratching my head. The rest of the code has some logic errors in this area too.
I'd prefer to have improved behavior rather than repeating mistakes made in juju_access_model
.
In that case, the resource would need to check during the update whether a grant or revoke should be run, right? For example, if the access level is initially 'admin' and then changes to 'read', the provider should call 'revoke' instead of 'grant'.
Hi, although the issue was not closed, I started working on a draft PR that is now ready for review. While working on it, I noticed why Access was set to RequiresReplace: it changes the ID, and without it, the update fails. I’ve marked the PR as ready for review, but if there are any updates on this issue, I can revert it back to a draft.
Type of change
Adding new schema
Description
Details
Example terraform plan
Notes & References
This schema is a step for providing CMR via Juju Terraform Provider. It was discussed in the last sprint (Oct/2024).
When removing/changing a juju_access_offer we should have in mind that revoke does not remove all access levels as per the documentation example: