/olt-infrastructure-as-code

O'Reilly Live Training - Infrastructure as Code

Primary LanguageHCLMozilla Public License 2.0MPL-2.0

O'Reilly Live Training - Infrastructure as Code

Example setup for O'Reilly Live Training.

Setup

  1. Create a GCP account and project.
  2. Set GCP project ID as CLOUDSDK_CORE_PROJECT environment variable.
  3. Run make setup to create the IAM account for GitHub Actions and the networks in dev and prod.
  4. Go into GCP and find the service account for pizza-github-actions.
    1. Create a key.
    2. Download the JSON file for the key and save it so you can add it to GitHub Actions later.
  5. In your GitHub Actions workflow, set the following secrets for each environment.
    Secret name Value
    CLOUDSDK_CORE_PROJECT GCP Project ID
    GOOGLE_SERVICE_ACCOUNT_JSON Base64-encoded contents of pizza-github-actions service account
    TF_SECRET_VARIABLES Base64-encoded contents of variables for Terraform to use
    TF_BACKEND Base64-encoded contents of backend for Terraform to use

Usage

Each part of the solution aligns with the concepts in the training.

Additional Resources