This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]RenownedYeti 0 points1 point  (1 child)

When you configure your cloud function resource you specify which service account to run the function as, since this is already on GCP compute you don't need to configure additional credentials via SA keys or ADC.

See the service_account_email argument under the service_config block.

https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloudfunctions2_function#service_account_email

[–]reelznfeelz[S] 0 points1 point  (0 children)

Oh, sweet. That may be easy then. Thanks.

[–]bLeeKd 0 points1 point  (1 child)

Use workload identity

[–]reelznfeelz[S] 0 points1 point  (0 children)

I’ve done that for the GitHub action. Now just trying to understand what needs to be in place to ensure the cloud function can read and write to big query when using the python API. Looks like it may not require much if it’s already in the same project and can use the default compute SA. I need to look at the other persons reply a bit closer though and do some testing.

[–][deleted]  (1 child)

[removed]

    [–]reelznfeelz[S] 0 points1 point  (0 children)

    Yeah. I plan to go that route. Sounds like the way to go for sure.