Add event_filters
to event triggers in cloudfunctions2 resource
#114
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Closes hashicorp/terraform-provider-google#12021
This PR adds the ability to set event filters within event triggers defined when creating a 2nd generation cloud function. Previously users could make 2nd gen functions be triggered by events sent from an 'event provider' (i.e. a Google API) within Eventarc, but now they can filter those events based on the event's attributes.
Valid attributes that can be used in filters differ by the event provider - here's the relevant part of the docs that describes a gcloud command to learn more about the events and attributes for a given event provider.
E.g. All events related to the
storage.googleapis.com
event provider have attributestype
andbucket
- and bucket wouldn't be an attribute on non-GCS eventsThings to note
How should- addressed in fb04576 - docs are here and path patterns aren't appropriate for all attributesoperator
be used? I couldn't work it out for an acceptance testThe
type
attribute cannot be used in the newevent_filters
block because it is already set by theevent_type
field inside theevent_trigger
block.A configuration similar to the one below causes this error
If this PR is for Terraform, I acknowledge that I have:
make test
andmake lint
to ensure it passes unit and linter tests.Release Note Template for Downstream PRs (will be copied)
Derived from GoogleCloudPlatform/magic-modules#6278