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.

Missing Project Input for Service Account Key

See original GitHub issue

Hello!

  • 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)

Issue details

I noticed that gcp.serviceAccount.Key does not have a Project input. I would like to create a project, service account and service account key in the same stack. I don’t think this is currently possible.

serviceAccountKey, err := serviceaccount.NewKey(ctx, "service-account-key", &serviceaccount.KeyArgs{
    Project: project.ProjectId, // <-- This field is missing
    ServiceAccountId: serviceAccount.AccountId,
})
Diagnostics:
  gcp:serviceAccount:Key (service-account-key):
    error: 1 error occurred:
        * project: required field is not set

Steps to reproduce

I don’t think these are necessary since this seems like more of an oversight than a bug.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jdmaguirecommented, Jun 20, 2022

Thanks for the link Johannes and describing your workaround! For me, I was able to work around this by using Workload Identity; which I found is Google’s suggested approach.

I hope between the two of use, people stumbling into this issue have a workaround they can use.

1reaction
johannesdreschercommented, Mar 26, 2022

Hi @guineveresaenger, I see. I reported the limitation to Google. Will add a comment to this issue when/if it gets fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create and manage service account keys - IAM - Google Cloud
Create a service account key · In the Google Cloud console, go to the Service accounts page. · Select a project. · Click...
Read more >
Why is my Service Account Unable to Access GCP Projects?
Make sure to add your service account as a member to your Organization beside the project and assign it a Viewer role. Share....
Read more >
google - service-accounts - Terraform Registry
Terraform Service Accounts Module. This module allows easy creation of one or more service accounts, and granting them basic roles.
Read more >
Use API Keys with Places API - Google Developers
These credentials are in the form of an API key - a unique alphanumeric string that associates your Google billing account with your...
Read more >
Authentication - pandas-gbq - Read the Docs
Using service account credentials is particularly useful when working on remote servers without access to user input. Create a service account key via...
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