Hi! I'm trying to create an eventarc trigger based...
# google-cloud
c
Hi! I'm trying to create an eventarc trigger based on a filename match in google cloud storage. (
--event-filters-path-pattern
in the gcp documentation). I don't understand how to specify that in Pulumi though. The docs here mention operator might be
match-path-pattern
, but I don't know what to put for
attribute
and
value
. E.g. here's my not-working config:
Copy code
matchingCriterias: [
                {
                    attribute: "type",
                    value: "google.cloud.storage.object.v1.finalized",
                },
                {
                    attribute: "bucket",
                    value: bucketName
                },
                {
                    attribute: "resourceName",
                    value: "/**/metadata.yaml",
                    operator: "match-path-pattern"

                }
            ],
g
I think, based on the docs for GCP itself, that the event path filter might be pre-general-availiability, so it might not be in the provider just yet. However, reading those docs, I'd say that maybe the value needs to have projects in it?
/projects/**/metadata.yaml
Note that, if I'm reading this doc correctly, that flag/operator is only available for Cloud Audit Log triggers (though I might be misreading the note)
c
I think projects is probably just a prefix they're using in that example. Ah, that note does seem like it may not be supported then. Do you know what the
match-path-pattern
in pulumi docs is for then?
g
Unfortunately, no. It's in the upstream gcp doc spec and in the related Terraform spec with no further information (same exact wording, which makes sense as Pulumi's docs here are auto-generated from upstream): https://cloud.google.com/config-connector/docs/reference/resource-docs/eventarc/eventarctrigger However, I did find a sample from Google themselves: https://github.com/GoogleCloudPlatform/declarative-resource-client-library/blob/ea137f607a2d00eda762cc9565bce1f3bd9c3dfd/services/google/eventarc/samples/basic.trigger.json#L29-L31
c
Oh that's a great example...Unfortunately, even when using their exact values, I still get
Copy code
error: 1 error occurred:
    	* Error updating Trigger: googleapi: Error 400: The request was invalid: The request was invalid: invalid attribute "resourceName" for trigger.event_filters
g
hmmm... that's odd.
Interestingly, the Terraform provider (which uses the same bridge as our classic provider) runs into an issue on this, as well: https://github.com/hashicorp/terraform-provider-google/issues/11312
I suspect it's an issue upstream, but it's one our team would like to know about. Do you mind opening up an issue on our provider and providing these details (a link to the Slack thread is fine, too)? https://github.com/pulumi/pulumi-gcp/issues/new?assignees=&labels=kind%2Fbug%2Cneeds-triage&template=bug.yaml
c
Will do, thanks! here it is for anyone following along: https://github.com/pulumi/pulumi-gcp/issues/831
🙏 2