-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add support for folder-level audit configs #5282
Conversation
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.
I have just done a quick pass on this but I have an initial question before I keep reviewing. Why did you choose to rewrite the google_folder_iam_policy
resource from the existing resource generator to the hand written resourceGoogleFolderIamPolicy
?
If that can be avoided this PR is going to be much smaller and much easier to merge in. FWIW I took your extended tests and ran them against the existing version of the resource in master and they passed as is.
@@ -115,3 +115,25 @@ func getFolderIamPolicyByFolderName(folderName string, config *Config) (*cloudre | |||
|
|||
return v1Policy, nil | |||
} | |||
|
|||
func getFolderNameByParentAndDisplayName(parent, displayName string, config *Config) (string, error) { |
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.
This is a method that is only being called by a test. It should be moved into a _test
file until it's called by production code. Since it's only used by 1 test I think moving it to google/resource_google_folder_iam_audit_config_test.go
is fine for now.
Type: schema.TypeBool, | ||
Optional: true, | ||
}, | ||
"restore_policy": { |
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.
I don't understand why you are adding new fields that are already removed.
State: resourceGoogleFolderIamPolicyImport, | ||
}, | ||
|
||
Schema: map[string]*schema.Schema{ |
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.
I think this should be implemented by merging IamFolderSchema
with IamPolicyBaseSchema
as was implemented by resource_iam_policy
unless there is a reason to manually specify it here.
|
…orp#5282) file only opens utf8-encoded files https://www.terraform.io/docs/language/functions/filebase64.html Signed-off-by: Modular Magician <[email protected]>
…#10254) file only opens utf8-encoded files https://www.terraform.io/docs/language/functions/filebase64.html Signed-off-by: Modular Magician <[email protected]>
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Issue: #3755
Fixes #4130