Skip to content

Commit d45191c

Browse files
authored
Turn on TF Logging (#1778)
Changes proposed Add `TF_LOG` to the build and publish workflow step thats failing `Configure AWS credentials`
1 parent 894dedd commit d45191c

File tree

1 file changed

+11
-0
lines changed
  • .github/actions/configure-aws-credentials

1 file changed

+11
-0
lines changed

.github/actions/configure-aws-credentials/action.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ runs:
1515
using: "composite"
1616
steps:
1717
- name: Get AWS account authentication details (AWS account, IAM role, AWS region)
18+
env:
19+
TF_LOG: DEBUG
20+
TF_LOG_PATH: './terraform-debug.log'
1821
run: |
22+
# Set up environment for detailed Terraform logging
23+
echo "Enabling Terraform Debug Logging"
24+
export TF_LOG="${{ env.TF_LOG }}"
25+
export TF_LOG_PATH="${{ env.TF_LOG_PATH }}"
26+
1927
# Get AWS account authentication details (AWS account, IAM role, AWS region)
2028
# associated with the application environment to figure out which AWS
2129
# account to log into, which IAM role to assume, and which AWS region to use
@@ -50,6 +58,9 @@ runs:
5058
echo "Setting env vars AWS_ROLE_TO_ASSUME and AWS_REGION..."
5159
echo "AWS_ROLE_TO_ASSUME=$AWS_ROLE_TO_ASSUME" >> "$GITHUB_ENV"
5260
echo "AWS_REGION=$AWS_REGION" >> "$GITHUB_ENV"
61+
62+
# Output Terraform log file contents
63+
cat "$TF_LOG_PATH"
5364
shell: bash
5465
- name: Configure AWS credentials
5566
uses: aws-actions/configure-aws-credentials@v3

0 commit comments

Comments
 (0)