Create a service account in the Google Cloud Platform using the command line:
Shahriyar Al Mustakim Mitul
Posted on October 8, 2022
Use this command to create the service account:
gcloud iam service-accounts create test-service-account2 --display-name "test-service-account2"
Note: If you see the following output, type y and press ENTER
Now if you go to the Navigation bar and then IAM & Admin and then Service accounts, you can see out service account:
Also we can give it a role using command line. For example, lets give this service account the project viewer role:
gcloud projects add-iam-policy-binding $GOOGLE_CLOUD_PROJECT --member serviceAccount:test-service-account2@${GOOGLE_CLOUD_PROJECT}.iam.gserviceaccount.com --role roles/viewer
Done!
đ đĒ đ
đŠ
Shahriyar Al Mustakim Mitul
Posted on October 8, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
googlecloud Building a Kubernetes Client for Google Kubernetes Engine (GKE) in Python
November 25, 2024