-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathterraform-apply.yml
More file actions
52 lines (44 loc) · 1.53 KB
/
terraform-apply.yml
File metadata and controls
52 lines (44 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Terraform Apply (Manual Trigger)
on:
workflow_dispatch:
inputs:
env_name:
description: 'Environment to run Terraform Apply for'
required: true
type: choice
options:
- dev
- uat
- prod
default: dev
run_id:
description: 'The GitHub run id to reference when downloading a specific Terraform Plan.'
required: true
push:
branches:
- '**'
jobs:
terraform-apply:
runs-on: ubuntu-latest
name: Terraform Apply After Approval
env:
ENV_NAME: dev
TERRAFORM_DIRECTORY: ./infrastructure/redshelf-dev/dev/data-ingestion-api/terraform
# ENV_NAME: $ {{ github.event.inputs.env_name }}
# TERRAFORM_DIRECTORY: ./infrastructure/redshelf-$ {{ github.event.inputs.env_name }}/$ {{ github.event.inputs.env_name }}/data-ingestion-api/terraform
steps:
- name: Checkout code
uses: actions/checkout@v6.0.2
- name: Configure AWS Credentials for Deployment
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets[format('{0}_AWS_ACCESS_KEY_ID', env.ENV_NAME)] }}
aws-secret-access-key: ${{ secrets[format('{0}_AWS_SECRET_ACCESS_KEY', env.ENV_NAME)] }}
aws-region: ${{ vars[format('{0}_AWS_REGION', env.ENV_NAME)] }}
- name: Download Terraform Plan
uses: actions/download-artifact@v4
# with:
# name: terraform-plan-${{ env.ENV_NAME }}
# run-id:
- name: Run Terraform Apply
run: make apply_${{ env.ENV_NAME }}