GCP
Pricing
- DB Cost - The Simple AWS RDS and Google Cloud SQL Instance Pricing Sheet.
- Google Cloud Pricing Calculator
Administration
Services
Artifact Registry
Cloud Run
Compute Engine
- Machine families resource and comparison guide
e2-microis free inus-west1(Oregon)
GKE
IAM
Differences between iam_binding and iam_member:
bindingrevokes any other members from the role to which it appliesmemberjust adds a member alongside existing members.
Networking
Logging
Filter by principal
bash
protoPayload.authenticationInfo.principalEmail="[email protected]"gcloud
gcloud login
bash
gcloud auth login --update-adc
gcloud config set account $ACCOUNT_NAME
gcloud config configurations list
gcloud config configurations activate $ACCOUNT_NAMEMulti-profile setup
bash
gcloud config configurations create work-profile
gcloud auth login [email protected]
gcloud config set project work-project-idbash
CLOUDSDK_ACTIVE_CONFIG_NAME=work-profile
CLOUDSDK_CORE_PROJECT=work-project-idUsage
bash
# Switch to work
gcloud config configurations activate work
gcloud auth application-default login
# Switch to personal
gcloud config configurations activate personal
gcloud auth application-default loginGet bearer token
bash
gcloud auth print-identity-tokenGCP SDK
Colab login
python
from google.colab import auth
auth.authenticate_user()Docker
yaml
backend:
build: backend
ports:
- 8000:8000
environment:
GOOGLE_APPLICATION_CREDENTIALS: /opt/application_default_credentials.json
volumes:
- ~/.config/gcloud/application_default_credentials.json:/opt/application_default_credentials.jsonSet PROJECT_ID from environment variable
bash
GOOGLE_CLOUD_PROJECT=foo
GOOGLE_CLOUD_QUOTA_PROJECT=barCookbook
Set up cloud-sql-proxy
bash
brew install --cask google-cloud-sdk
gcloud auth application-default login
# see Releases for other versions
URL="https://storage.googleapis.com/cloud-sql-connectors/cloud-sql-proxy/v2.6.1"
curl "$URL/cloud-sql-proxy.darwin.arm64" -o cloud-sql-proxy
chmod +x cloud-sql-proxy
sudo mv cloud-sql-proxy /usr/local/bin/
cloud-sql-proxy --port <INTERNAL> <INSTANCE_CONNECTION_NAME>