Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCP eventarc path filter doesn't work #831

Closed
petercheng00 opened this issue Jun 14, 2022 · 4 comments
Closed

GCP eventarc path filter doesn't work #831

petercheng00 opened this issue Jun 14, 2022 · 4 comments
Labels
kind/bug Some behavior is incorrect or out of spec resolution/by-design This issue won't be fixed because the functionality is working as designed

Comments

@petercheng00
Copy link

What happened?

I'd like an eventarc trigger based on a specific file pattern in google cloud storage. This is done via --event-filters-path-pattern in google cloud documentation.

See the slack thread here: https://pulumi-community.slack.com/archives/CRFUR2DGB/p1655238434066829

Steps to reproduce

Here's what I'm using (the resourceName section is copied directly from this google sample as a test :

        matchingCriterias: [
            {
                attribute: "type",
                value: "google.cloud.storage.object.v1.finalized",
            },
            {
                attribute: "bucket",
                value: bucketName,
            },
            {
                attribute: "resourceName",
                value: "/projects/_/buckets/bucket-1/objects/*",
                operator: "match-path-pattern"
            }
        ],

Expected Behavior

Trigger gets created

Actual Behavior

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

Versions used

CLI
Version 3.34.1
Go Version go1.17.11
Go Compiler gc

Plugins
NAME VERSION
docker 3.2.0
gcp 6.24.0
nodejs unknown

Host
OS ubuntu
Version 20.04
Arch x86_64

Dependencies:
NAME VERSION
@types/node 14.18.18
@pulumi/docker 3.2.0
@pulumi/gcp 6.24.0
@pulumi/pulumi 3.33.1

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@petercheng00 petercheng00 added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Jun 14, 2022
@stack72
Copy link
Contributor

stack72 commented Jun 16, 2022

Hi @petercheng00

Thanks for opening the issue here - please can you provide the code that will help us try and recreate the issue. That will help be able to isolate the problem here

Paul

@stack72 stack72 added awaiting-feedback and removed needs-triage Needs attention from the triage team labels Jun 17, 2022
@petercheng00
Copy link
Author

trigger = new gcp.eventarc.Trigger("trigger", {
    location: serviceLocation,
    serviceAccount: serviceAccount,
    matchingCriterias: [
        {
            attribute: "type",
            value: "google.cloud.storage.object.v1.finalized",
        },
        {
            attribute: "bucket",
            value: bucketName,
        },
        {
            attribute: "resourceName",
            value: "/projects/_/buckets/bucket-1/objects/*",
            operator: "match-path-pattern"
        }
    ],
    destination: {
        cloudRunService: {
            service: serviceName,
            region: serviceLocation,
        },
    },
});

@linco95
Copy link

linco95 commented Feb 27, 2023

@petercheng00 The trigger you linked is using the google.cloud.audit.log.v1.written event, which contains the resourceName attribute, and hence works in their example. While the trigger you've shown here is using google.cloud.storage.object.v1.finalized and that only contains bucket and type attribute.

@mikhailshilkov mikhailshilkov added the resolution/by-design This issue won't be fixed because the functionality is working as designed label Oct 27, 2023
@mikhailshilkov
Copy link
Member

Given the previous comment, I'll close the issue as by design. Let me know if you think it's wrong.

@mikhailshilkov mikhailshilkov closed this as not planned Won't fix, can't repro, duplicate, stale Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec resolution/by-design This issue won't be fixed because the functionality is working as designed
Projects
None yet
Development

No branches or pull requests

4 participants