JO
joatmon08/olt-infrastructure-as-code
O'Reilly Live Training - Infrastructure as Code
O'Reilly Live Training - Infrastructure as Code
Example setup for O'Reilly Live Training.
Setup
- Create a GCP account and project.
- Set GCP project ID as
CLOUDSDK_CORE_PROJECTenvironment variable. - Run
make setupto create the IAM account for GitHub Actions and the networks indevandprod. - Go into GCP and find the service account for
pizza-github-actions.- Create a key.
- Download the JSON file for the key and save it so you can add it to GitHub Actions later.
- 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-actionsservice accountTF_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
- Infrastructure as Code, 2nd Edition
- Infrastructure as Code (IAC) Cookbook
- Patterns and Practices for Infrastructure as Code
- Terraform: Up & Running, 2nd Edition
- Manage your infrastructure as code dependencies
- Testing your Cloud Infrastructure (as Code)
- Test-Driven Development (TDD) for Infrastructure
- Slides for Hands-on Policy as Code
- Exploring Policy as Code for Cloud Infrastructure
- Applying Application Feature Toggles to Infrastructure
On this page
Languages
HCL71.4%Python25.9%Makefile2.7%
Contributors
Mozilla Public License 2.0
Created September 1, 2021
Updated September 13, 2024