Skip to content

Instantly share code, notes, and snippets.

@rdemoraes
Last active February 3, 2022 21:54
Show Gist options
  • Save rdemoraes/4569a3d5431724a0a281e7512df49324 to your computer and use it in GitHub Desktop.
Save rdemoraes/4569a3d5431724a0a281e7512df49324 to your computer and use it in GitHub Desktop.
parent.gitlab-ci.yml
---
stages:
- dev
- staging
- production
##
## Child pipeline
## Job: Terraform main pipeline: Init, validate, fmt, plan and apply
## Env: Dev
##
terraform-dev:
stage: dev
variables:
TF_ENV_PATH: dev
IMAGE_TAG: v0.15.5 # Terraform cli version v0.15.5
AWS_ACCOUNT_ID: 111111111111
AWS_IAM_ROLE: "Terraform_Provisioner_Role"
AWS_REGION: "us-east-1"
trigger:
include:
- project: 'infrastructure-as-code/templates/cicd'
ref: main
file:
- '/workflows/Terraform.gitlab-ci.yml'
strategy: depend
##
## Child pipeline
## Job: Terraform main pipeline: Init, validate, fmt, plan and apply
## Env: staging
##
terraform-stg:
stage: staging
variables:
TF_ENV_PATH: staging
IMAGE_TAG: v0.15.5 # Terraform cli version v0.15.5
AWS_ACCOUNT_ID: 111111111111
AWS_IAM_ROLE: "Terraform_Provisioner_Role"
AWS_REGION: "us-east-1"
trigger:
include:
- project: 'infrastructure-as-code/templates/cicd'
ref: main
file:
- '/workflows/Terraform.gitlab-ci.yml'
strategy: depend
needs:
- job: "terraform-dev"
##
## Child pipeline
## Job: Terraform main pipeline: Init, validate, fmt, plan and apply
## Environment: Production
##
terraform-prd:
stage: production
variables:
TF_ENV_PATH: production
IMAGE_TAG: v0.15.5 # Terraform cli version v0.15.5
AWS_ACCOUNT_ID: 111111111111
AWS_IAM_ROLE: "Terraform_Provisioner_Role"
AWS_REGION: "us-east-1"
trigger:
include:
- project: 'infrastructure-as-code/templates/cicd'
ref: main
file:
- '/workflows/Terraform.gitlab-ci.yml'
strategy: depend
needs:
- job: "terraform-stg"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment