This repository has been archived by the owner on Nov 14, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
event_filters
to event triggers in cloudfunctions2 resource (#6…
…278) * Add `eventFilters` in cloudfunctions2 API definition * Remove trailing whitespace * Start adding cloudfunctions2 eventarc acceptance test that uses GCS * Add missing IAM bindings to prevent API errors during `FullGcsExample` acceptance test * Make `eventTrigger.pubsubTopic` default from the API to handle topics made by Eventarc * Update field description for `attribute` - info to learn more about possible values * Remove unneeded attribute from `google_storage_bucket_object` * Add API service enabling to new project in test, fix provider used to make project * Fix inbuilt function call in acceptance test * Add explicit dependencies to try make API calls happen after the API is turned on * Remove generated acceptance test and add handwritten test with 2 stages * Remove `depends_on` attributes from example config * Fix bug in test's TF config, make project ID and name the same * Replace use of `for_each` in acceptance test There is an open issue about how for_each loops don't work : hashicorp/terraform-plugin-sdk#536 * Add `run.googleapis.com` to project * Change `disable_dependent_services` to `false` for eventarc API in acceptance tests Change example config to match, too * Enable `artifactregistry.googleapis.com` in acceptance test & example * Add missing IAM binding to cloud function service account - `roles/artifactregistry.reader` Odd that this is needed, as it wasn't required when I created a similar cloud function in an existing GCP project (where APIs were already activated etc) * Add explicit dependency between cloud function resource and IAM bindings for its service account Address "Unable to retrieve the repository metadata" error that suggests service account doesn't have permissions in place * Enable `cloudbuild.googleapis.com` API in acceptance test and example * Enable `pubsub.googleapis.com` API in acceptance test and example * Fix test so step 1 of test enables all the APIs * Replace zipped cloud function code with zip made by `archive_file` Terraform resource * Add repo-level IAM binding (in addition to project level) using inferred repo ID * Fix missing quotation mark in test :( * Split project into 3 stages and remove repo-specific IAM binding This is after running the test locally and it succeeding in 3 steps but not in 2 steps * Fix problem where TF couldn't delete resources at end of test Couldn't delete the cloud function because the API had been disabled * Update test to get project ID from ENV instead of project created by the test Update test and example block with needed variables Remove handwritten test * Fix API spec to make required fields required * Update event_filter fields' descriptions for clarity * Change GCS event_filter test to basic as it can't use all fields * Add example test that shows the operator field in use * Fix whitespace * Add test for updating `event_filters` blocks * Reuse generated cloudfunction2 test functions in handwritten test Make code homogenous between the two tests to faciliatate this Signed-off-by: Modular Magician <[email protected]>
- Loading branch information