5

I'm trying to automate the process of creating and managing my projects on Google Cloud Platform. I want to create new project and generate API keys for it and use them.

I am unable to find any API to create API KEYS. Is there any solution ?

Thanks

3 Answers 3

4

You may not be able to create API keys programmatically, but you can create service accounts. Service accounts can do all the things on API keys can, and are much more secure than API keys. And you can create them via API calls!

Here's the API reference for creating service accounts, and for creating service account keys (which have a public/private keypair).

Here's the API reference for creating projects.

You should be able to do whatever you were trying to accomplish with these tools. But for most simple use-cases using the UI is recommended.

Sign up to request clarification or add additional context in comments.

2 Comments

IMO to create service account itself we need another service account (to which we granted permission to create another accounts).. is there anyway to create it first time without another service account?
@VishalZanzrukia you would certainly need some way to authorise the request. I.e. an API Key or a service account to identify the requestor.
2
❯ gcloud alpha services api-keys create --display-name=NAME

See: https://cloud.google.com/sdk/gcloud/reference/alpha/services/api-keys/create

1 Comment

0

From My little experience you can't . You have to use Google API Console

2 Comments

Thanks. I am dropping the plan now.
Yeap , Can you please set my anwser as accepted anwser

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.