-
Notifications
You must be signed in to change notification settings - Fork 630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correctly handle Access Group schema transformations #917
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ensures operations like importing sync the application name attribute to Terraform state and prevent flapping changes.
To avoid swallowing exception messages we should err check `d.Set` calls where the value isn't a simple type to avoid missing underlying issues.
jacobbednarz
force-pushed
the
fix-access-import
branch
from
January 27, 2021 23:59
61a080a
to
96a720e
Compare
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes the ability to have Access Policies be able to be imported and still
maintain the policy conditions. The cause of the bug is due to the change in
schema made many moons ago and the schema not matching the API responses. This
was an issue as out of the box, Terraform can do some conversion however the
Access Policy resources are complex structures. The issue was made worse by the
omission of error handling
d.Set
calls which can slightly fail.Looking at this PR, I bet you're thinking "this looks really verbose, surely
there is a better way" and you'd be partially correct. This is pretty verbose.
It's essentially the counterpart to
BuildAccessGroupCondition
whichconditionally builds the API request whereas this focused on the API response =>
schema conversion. The reason it is so verbose is due to the remote API and the
flexibility this API has in the conditions and combinations. You can have a
myriad of
include
,exclude
andrequire
conditions that all work in unisonto provide a fitting policy.
Fixes #681