google_cloudbuild_triggers resource
Use the google_cloudbuild_triggers InSpec audit resource to to test a Google Cloud Trigger resource.
Examples
describe google_cloudbuild_triggers(project: 'chef-gcp-inspec') do
its('count') { should eq 1 }
end
google_cloudbuild_triggers(project: 'chef-gcp-inspec').ids.each do |id|
describe google_cloudbuild_trigger(project: 'chef-gcp-inspec', id: id) do
its('filename') { should eq 'cloudbuild.yaml' }
its('trigger_template.branch_name') { should eq 'trigger-branch' }
its('trigger_template.repo_name') { should eq 'trigger-repo' }
its('trigger_template.project_id') { should eq 'trigger-project' }
end
end
Properties
Properties that can be accessed from the google_cloudbuild_triggers resource:
See google_cloudbuild_trigger for more detailed information.
ids: an array ofgoogle_cloudbuild_triggeridnames: an array ofgoogle_cloudbuild_triggernamedescriptions: an array ofgoogle_cloudbuild_triggerdescriptiontags: an array ofgoogle_cloudbuild_triggertagsdisableds: an array ofgoogle_cloudbuild_triggerdisabledcreate_times: an array ofgoogle_cloudbuild_triggercreate_timesubstitutions: an array ofgoogle_cloudbuild_triggersubstitutionsfilenames: an array ofgoogle_cloudbuild_triggerfilenameignored_files: an array ofgoogle_cloudbuild_triggerignored_filesincluded_files: an array ofgoogle_cloudbuild_triggerincluded_filestrigger_templates: an array ofgoogle_cloudbuild_triggertrigger_templategithubs: an array ofgoogle_cloudbuild_triggergithubbuilds: an array ofgoogle_cloudbuild_triggerbuild
Filter criteria
This resource supports all of the above properties as filter criteria, which can be used
with where as a block or a method.
GCP permissions
Ensure the Cloud Build API is enabled for the current project.