gcp-periodic mode using http gets permission error when scheduler job tries to trigger cloud function
See original GitHub issueDescribe the bug Not sure if it’s a bug or a feature request since GCP is still beta. I ran a gcp-periodic mode policy which deployed a Cloud Scheduler job and Cloud Function with Http trigger successfully. But Cloud Scheduler job did not have auth header setup so it gets permission error when scheduler job tries to trigger cloud function via HTTP.
To Reproduce Ran this policy ` policies:
- name: custodian-periodic-test resource: gcp.sql-instance mode: type: gcp-periodic service-account: ‘testing123@project-id.iam.gserviceaccount.com’ schedule: ‘0 0 * * 1-5’ `
Expected behavior I’ve played around with it. If I manually setup Auth header by adding OIDC token to the Cloud Scheduler job using the service-account ‘testing123@project-id.iam.gserviceaccount.com’, permission issue goes away and scheduler job triggers cloud function correctly.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Getting permission denied error when calling Google cloud ...
This means that events created by or routed through Pub/Sub, Eventarc, Cloud Scheduler, Cloud Tasks and Workflows cannot trigger these functions ...
Read more >Use Cloud Scheduler to invoke private Cloud Functions with ...
This tutorial shows you how to use Cloud Scheduler to invoke a private Cloud Function using HTTP targets and triggers and OIDC ...
Read more >cloud-custodian/cloud-custodian - Gitter
Then I tried to change mode to gcp-periodic and schedule to run every hour and it deployed alright, but I'm getting an error:...
Read more >Getting Started — Cloud Custodian documentation
custodian\Scripts\activate.bat # Or use this for CMD users pip install c7n ... If you get an error about “complete -D” not being supported,...
Read more >How to Schedule a Serverless Google Cloud Function to Run ...
Do you have some code that needs to be run regularly? Read along to learn how to do this using a serverless function...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
its one topic per periodic policy, custodian already has support for creating the pub/sub topic as we use it for doing api audit log response (cloudtrail style) policies. at least for gcp serverless we already have support for deleting things, we do need to wire processing gcp serverless policies that into mugc though, but its a relatively light lift.
thats fair re reference to service account and that sounds reasonable to support, but i think we’ll still want to switch to default pub/sub as its less to configure for the user, is there a concern with pub/sub, just wondering why http endpoint is useful.