A google_logging_project_sinks is used to test a Google ProjectSink resource
describe google_logging_project_sinks(project: 'chef-gcp-inspec') do
its('names') { should include 'inspec-gcp-org-sink' }
end
describe google_logging_project_sinks(project: 'chef-inspec-gcp') do
its('count') { should be <= 100}
end
describe google_logging_project_sinks(project: 'chef-inspec-gcp') do
its('sink_names') { should include "my-sink" }
end
describe google_logging_project_sinks(project: 'chef-inspec-gcp') do
its('sink_destinations') { should include "storage.googleapis.com/a-logging-bucket" }
end
google_logging_project_sinks(project: 'chef-inspec-gcp').where(sink_name: /project/).sink_names.each do |sink_name|
describe google_logging_project_sink(project: 'chef-inspec-gcp', sink: sink_name) do
its('writer_identity') { should eq "serviceAccount:my-logging-service-account.iam.gserviceaccount.com" }
end
end
Properties that can be accessed from the google_logging_project_sinks resource:
See the google_logging_project_sink resource for more information.
projectsgoogle_logging_project_sink projectnamesgoogle_logging_project_sink namefiltersgoogle_logging_project_sink filterdestinationsgoogle_logging_project_sink destinationwriter_identitiesgoogle_logging_project_sink writer_identityinclude_childrengoogle_logging_project_sink include_childrenThis resource supports all of the above properties as filter criteria, which can be used with where as a block or a method.
Ensure 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_project_sinks/