Created
February 20, 2018 22:17
-
-
Save darkn3rd/684a31b48ac0573a26175ac34f1ca7b8 to your computer and use it in GitHub Desktop.
Manage GCP Projects 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export TF_USER=${USER}. # user account, replace if not current user name | |
export TF_VAR_ORG_ID=$(gcloud organizations list | awk '!/^DISPLAY_NAME/ { print $2 }') | |
export TF_VAR_BILLING_ACCOUNT=$(gcloud beta billing accounts list | awk '!/^ID/ { print $1 }') | |
export TF_ADMIN=${TF_USER}-terraform-admin | |
# Create New Project | |
gcloud projects create ${TF_ADMIN} \ | |
--organization ${TF_VAR_ORG_ID} \ | |
--set-as-default | |
# Link Project to Billing Account | |
gcloud beta billing projects link ${TF_ADMIN} \ | |
--billing-account ${TF_VAR_BILLING_ACCOUNT} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment