Skip to content

Latest commit

History

History
40 lines (30 loc) 路 1.37 KB

getting-started-gce.md

File metadata and controls

40 lines (30 loc) 路 1.37 KB

Google Cloud

Getting Started - GCE edition

How to create a Service Account in GCP via gcloud cli

# Get current projectID
export PROJECTID=$(gcloud config get-value core/project 2>/dev/null)

# Create a service account
gcloud iam service-accounts create minctl \
--description "minectl-sa service account" \
--display-name "minctl"

# Get service account email
export SERVICEACCOUNT=$(gcloud iam service-accounts list | grep minctl | awk '{print $2}')

# Assign appropriate roles to minectl service account
gcloud projects add-iam-policy-binding $PROJECTID \
--member serviceAccount:$SERVICEACCOUNT \
--role roles/compute.admin
gcloud projects add-iam-policy-binding $PROJECTID \
--member serviceAccount:$SERVICEACCOUNT \
--role roles/iam.serviceAccountUser
gcloud projects add-iam-policy-binding $PROJECTID \
--member serviceAccount:$SERVICEACCOUNT \
--role roles/compute.osAdminLogin

# Create minectl service account key file
gcloud iam service-accounts keys create key.json \
--iam-account $SERVICEACCOUNT

Legal Disclaimer 馃懏

This project is not affiliated with Mojang Studios, XBox Game Studios, Double Eleven or the Minecraft brand.

"Minecraft" is a trademark of Mojang Synergies AB.

Other trademarks referenced herein are property of their respective owners.