This is an example Terraform deployment that runs in a Codefresh pipeline using docker. More details can be found in the documentation page.
- Create a free Codefresh account
- Create a Google cloud account
- Create a Google Service account key
Service Account requires the following roles:
- roles/storage.admin
- roles/compute.instanceAdmin.v1
Following APIs needs to be enabled:
- compute.googleapis.com
To use Terraform with Codefresh
- Create a new pipeline
- Add the following variables:
- Service account json as a variable called
ACCOUNT_JSON_CONTENT
in a base64 encoded format - GCLOUD_PROJECT set to the GCP project name
- STACK_FILE set to the file name that you want to use to track live stack
- STACKS space separated list of possible stacks. E.g. "blue green"
- STORAGE_BUCKET name of the Google Cloud storage where to store the state
- Service account json as a variable called
- Add the pipeline content
That's it! Run the pipeline to see it in action.
Enjoy!