This repository contains source code accompanying the TIL about Cloud Spanner Video and Content Series.
- First Steps with Cloud Spanner (blog post, video)
- Choosing the right Primary Keys (blog post, video)
- Maximizing data load throughput (blog post, video)
- Google Cloud Project
- Google Cloud Spanner Instance (refer to the Cloud Spanner docs on how to create a Cloud Spanner Instance)
- Bucket in Google Cloud Storage (refer to the GCS docs on how to create a bucket)
- Google Cloud Container Registry (refer to the Container Registry docs how to enable the registry)
gcloud compute instances create cloud-spanner-til-01 --zone europe-west1-c --machine-type n1-highcpu-16 --scopes "https://www.googleapis.com/auth/cloud-platform" --image-project ubuntu-os-cloud --image-family ubuntu-1710
gcloud compute scp scripts/setup.sh cloud-spanner-til-01:setup.sh --zone europe-west1-c
gcloud compute ssh cloud-spanner-til-01 --zone europe-west1-c --command "sudo sh setup.sh"
If you develop on your local machine it's recommended to use a service account. To generate one that has the permissions to connect to Google Cloud Spanner and write to Google Cloud Storage run the following commands:
export CSTIL_PROJECT=`gcloud config list --format 'value(core.project)'`
gcloud iam service-accounts create cloud-spanner-til --display-name "Cloud Spanner TIL Service Account - generated"
gcloud iam service-accounts keys create service-account.json --iam-account cloud-spanner-til@$CSTIL_PROJECT.iam.gserviceaccount.com
gcloud projects add-iam-policy-binding cloud-spanner-til --member serviceAccount:cloud-spanner-til@$CSTIL_PROJECT.iam.gserviceaccount.com --role roles/spanner.admin
gcloud projects add-iam-policy-binding cloud-spanner-til --member serviceAccount:cloud-spanner-til@$CSTIL_PROJECT.iam.gserviceaccount.com --role roles/storage.objectAdmin
Contributions to this repository are always welcome and highly encouraged.
See CONTRIBUTING for more information on how to get started.
Apache 2.0 - See LICENSE for more information.
This is not an official Google product