This repository uses Terraform to set up Google Cloud for the Columbia University's Operations Management in IT course. Using a list of student and instructor IDs (UNIs), it provisions Projects for each, granting access to the instructor and Associates (a.k.a. teaching assistants) via IAM.
This only needs to be done once per semester, by whichever instructor is managing Google Cloud.
-
If the number of students+instructors is larger than 20, request a Project Quota increase
-
Set up
gcloud
:gcloud auth application-default login gcloud config set project columbia-sps-tech-foundations gcloud auth application-default set-quota-project columbia-sps-tech-foundations
-
Download the student list
- Go to the SSOL
- Click
Class List
- Click
See Roster
- Click
Download comma delimited roster with Excel extension.
- Move to
terraform/students.csv
-
Run
terraform apply -parallelism=400
(arbitrarily high number)
As the course enrollment changes, re-run the last two steps.
As students go through the setup (below), you can re-run the apply
to get a report of who is missing billing.
Do these one-time setup steps to ensure you don't have to pay for Google Cloud use for this class. Credits are provided through the Google Cloud for Education program.
A Project has been created for you, which the instructors have access to for troubleshooting. You redeem the credits, which creates a Billing Account. You then have to associate that Billing Account with the existing Project.
- Redeem the credits - video walkthrough
- Instructor will send the coupon retrieval link
- Fill in the form
- Use your UNI for your email, not an alias
- When you get to the GCP Credit Application screen, make sure you've switched to your Columbia Google account
- Dismiss the Free Trial banner — should not need a credit card
- Confirm the credits were applied
- Go to the Billing Accounts page
- Click
Billing Account for Education
- In the sidebar, click
Credits
- You should see an
Operations Management in IT
credit for $50
- Switch to your Project
- In the top navigation bar, on the left side, click the drop-down
- You should see a
Select a resource
modal pop up - Click the
ALL
tab - Click
Ops Mgmt in IT - <your UNI>
- Change the Billing Account to
Billing Account for Education
If you missed the step above about switching to your Columbia Google account, the easiest fix is to follow these steps and make your <uni>@columbia.edu
user a Billing Account Administrator
on the Billing Account for Education
.
If you're using Google Cloud for something outside of this class, we suggest creating a separate Project to keep things isolated. The Billing Account for Education
is yours, so you're welcome to associate it with other Projects to use those credits.
We won't use the full $50 credit for this class, so you're welcome to take advantage of the remainder for other things. If you use it up, you'll start spending against your Free Trial. Beyond that, you'll have to pay.
At the end of the course:
- Delete all rows from
terraform/students.csv
. - Delete the
instructors
local values. - Run
terraform apply -parallelism=400
Instructors should have access to all student Projects. In the selector in the top of the nav bar, switch to their Project; the name ends with their UNI.
To help figure out what went wrong, it may be helpful to see what actions a student performed.
- Go to Logs Explorer
- Run a query with
protoPayload.authenticationInfo.principalEmail!="alf2215@columbia.edu"
to filter out setup calls made from this repository