title | platform |
---|---|
About the google_project_alert_policies resource |
gcp |
A google_project_alert_policies
is used to test a Google AlertPolicy resource
describe google_project_alert_policies(project: 'chef-gcp-inspec') do
it { should exist }
its('policy_display_names') { should include 'Display'}
its('combiners') { should include 'OR'}
end
Test that there are no more than a specified number of project alert policies available for the project
describe google_project_alert_policies(project: 'chef-inspec-gcp') do
its('count') { should be <= 100}
end
describe google_project_alert_policies(project: 'chef-inspec-gcp') do
its('policy_names') { should include 'projects/spaterson-project/alertPolicies/9271751234503117449' }
end
describe google_project_alert_policies(project: 'chef-inspec-gcp') do
its('policy_display_names') { should_not include 'banned policy' }
end
describe google_project_alert_policies(project: 'chef-inspec-gcp') do
its('policy_enabled_states') { should_not include false }
end
Properties that can be accessed from the google_project_alert_policies
resource:
See google_project_alert_policy.md for more detailed information
policy_names
: an array ofgoogle_project_alert_policy
namepolicy_display_names
: an array ofgoogle_project_alert_policy
display_namecombiners
: an array ofgoogle_project_alert_policy
combinercreation_records
: an array ofgoogle_project_alert_policy
creation_recordpolicy_enabled_states
: an array ofgoogle_project_alert_policy
enabledconditions
: an array ofgoogle_project_alert_policy
conditionsnotification_channels
: an array ofgoogle_project_alert_policy
notification_channelsuser_labels
: an array ofgoogle_project_alert_policy
user_labelsdocumentations
: an array ofgoogle_project_alert_policy
documentation
This 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 Monitoring API is enabled for the current project.