Skip to content

Terraform Files to Create a GCP VM Install Docker Docker-Compose and Run Airflow

Notifications You must be signed in to change notification settings

MichaelShoemaker/Terraform-Docker-Airflow-GCP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform-Docker-Airflow-GCP

Terraform Files to Create a GCP VM Install Docker Docker-Compose and Run Airflow

Walkthrough Video for Setup

Setup Walkthrough

Create a Project in GCP

til

Create a Service Account and Download the Key

Create a Service Account and give it Compute Engine Admin Permissions
Generate and download a key for the Service Account

Note: The variables.tf files are looking for a key titled terra-airflow.json in a .google directory in the root of the projects file structure.

til

Create a ./google directory and add your .json key there
Name it terra-airflow or update the varaibles.tf file variable
til

Update the Variables.tf File

Update the variables in variables.tf to match your project.

A good way to do this is to look at the Dashboard for the project name

Go to Compute Engine and click the Create Instance button.

The default shown for Region and Zone are most likely what you want to use.

til

Generate an SSH Key Pair


ssh-keygen -t rsa -f ~/.ssh/KEY_FILENAME -C USERNAME

The files as is will be looking for a private and public key pair with the name "GCP" in your users .ssh directoy.

Create Service Account for Airflow

You will now need to generate a Service Account with permissions to upload to a GCP Bucket. til

Create a key file for the service acount and place it at .google/credentials/google_credentials.json til

Deploy to GCP

From either the
file_user-script
or inline_user-script
directories run

terraform plan

to check for errors

terraform apply

to deploly to GCP

About

Terraform Files to Create a GCP VM Install Docker Docker-Compose and Run Airflow

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published