Missing Project Input for Service Account Key
See original GitHub issueHello!
- 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:
- Created a year ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top 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 >
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 Free
Top 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

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.
Hi @guineveresaenger, I see. I reported the limitation to Google. Will add a comment to this issue when/if it gets fixed.