-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/aws: validation: Add validation function for IAM Policies #14669
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1886,7 +1886,11 @@ func normalizeJsonString(jsonString interface{}) (string, error) { | |
return s, err | ||
} | ||
|
||
bytes, _ := json.Marshal(j) | ||
bytes, err := json.Marshal(j) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤔 wasn't this here to allow empty policies to passthrough? e.g. when it's interpolated from a variable and the only way to make it empty is to pass an empty string (not to omit the argument). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, possibly. Noticed we didn't catch the error returned there, and thought we should. I'll add a comment that it's on purpose. |
||
if err != nil { | ||
return s, err | ||
} | ||
|
||
return string(bytes[:]), nil | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit overkill to test validation function on a real resource, but 🤷♂️ I guess it does the job 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly wanted to test the HEREDOC evaluation would fail prior to the
apply
phase.