Skip to content

Commit

Permalink
Turn on TF Logging (#1778)
Browse files Browse the repository at this point in the history
 Changes proposed
Add `TF_LOG` to the build and publish workflow step thats failing
`Configure AWS credentials`
  • Loading branch information
rylew1 authored Apr 18, 2024
1 parent 894dedd commit d45191c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/actions/configure-aws-credentials/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ runs:
using: "composite"
steps:
- name: Get AWS account authentication details (AWS account, IAM role, AWS region)
env:
TF_LOG: DEBUG
TF_LOG_PATH: './terraform-debug.log'
run: |
# Set up environment for detailed Terraform logging
echo "Enabling Terraform Debug Logging"
export TF_LOG="${{ env.TF_LOG }}"
export TF_LOG_PATH="${{ env.TF_LOG_PATH }}"
# Get AWS account authentication details (AWS account, IAM role, AWS region)
# associated with the application environment to figure out which AWS
# account to log into, which IAM role to assume, and which AWS region to use
Expand Down Expand Up @@ -50,6 +58,9 @@ runs:
echo "Setting env vars AWS_ROLE_TO_ASSUME and AWS_REGION..."
echo "AWS_ROLE_TO_ASSUME=$AWS_ROLE_TO_ASSUME" >> "$GITHUB_ENV"
echo "AWS_REGION=$AWS_REGION" >> "$GITHUB_ENV"
# Output Terraform log file contents
cat "$TF_LOG_PATH"
shell: bash
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
Expand Down

0 comments on commit d45191c

Please sign in to comment.