feat: tf aws ci cd #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Tf Plan Flow' | |
on: | |
workflow_call: | |
inputs: | |
environment: | |
description: 'App Env' | |
required: false | |
type: string | |
default: devel | |
working_directory: | |
description: 'App Path' | |
required: false | |
type: string | |
default: infrastructure/aws | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
tf-plan: | |
runs-on: ubuntu-latest | |
environment: ${{ inputs.environment }} | |
steps: | |
- name: Configure AWS | |
uses: aws-actions/configure-aws | |
with: | |
role-to-assume: ${{ secrets.AWS_TF_ROLE }} | |
aws-region: us-east-1 | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v3 | |
- name: TF init | |
working-directory: ${{ inputs.working_directory }} | |
run: | | |
terraform init | |
- name: TF plan | |
working-directory: ${{ inputs.working_directory }} | |
run: | | |
terraform plan | |