A google_logging_folder_log_sink is used to test a Google FolderLogSink resource
# Getting folder sinks is complicated due to the name being generated by the server.
# This can be drastically simplified if you have the folder name when writing the test
describe.one do
google_resourcemanager_folders(parent: 'organizations/12345').names.each do |folder_name|
# name on a folder is in the form `folders/12345`
describe google_logging_folder_log_sink(folder: folder_name.split('/')[1], name: 'inspec-gcp-folder-sink') do
it { should exist }
its('filter') { should cmp 'resource.type = gce_instance AND severity >= ERROR' }
end
end
end
Properties that can be accessed from the google_logging_folder_log_sink resource:
foldernamefilterdestinationwriter_identityinclude_childrenEnsure the Stackdriver Logging API is enabled for the current project.
© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/inspec/resources/google_logging_folder_log_sink/