question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

gcp-periodic mode using http gets permission error when scheduler job tries to trigger cloud function

See original GitHub issue

Describe 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:closed
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kapiltcommented, Nov 5, 2020

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.

1reaction
kapiltcommented, Nov 3, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found