Skip to content

Commit

Permalink
cd: debug
Browse files Browse the repository at this point in the history
  • Loading branch information
brunograna committed May 23, 2024
1 parent 0326b0d commit 874f279
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
terraform:
runs-on: ubuntu-latest

# env:
# AWS_REGION: sa-east-1
# TERRAFORM_S3_STATEFILE_BUCKET: buildrun-sa-east-1-terraform-s3-statefile
# TERRAFORM_DYNAMODB_LOCK_TABLE: buildrun-terraform-state-lock
env:
AWS_REGION: ${{ secrets.AWS_REGION }}
TERRAFORM_S3_STATEFILE_BUCKET: ${{ secrets.TERRAFORM_S3_STATEFILE_BUCKET }}
TERRAFORM_DYNAMODB_LOCK_TABLE: ${{ secrets.TERRAFORM_DYNAMODB_LOCK_TABLE }}

defaults:
run:
Expand All @@ -28,18 +28,20 @@ jobs:
with:
terraform_version: 1.8.3

- name: debug
run: |
pwd &&
ls &&
echo "${{ CONTEXT.$AWS_REGION }}" &&
echo $AWS_REGION &&
echo $TERRAFORM_S3_STATEFILE_BUCKET &&
echo $TERRAFORM_DYNAMODB_LOCK_TABLE
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}

- name: Terraform Init
run: |
env && cd infra && terraform init
cd infra && terraform init \
-backend-config="bucket=${{ env.S3_BUCKET }}" \
-backend-config="key=path/to/terraform.tfstate" \
-backend-config="region=${{ env.AWS_REGION }}" \
-backend-config="dynamodb_table=${{ env.DYNAMODB_TABLE }}"
- name: Terraform Validate
run: terraform validate
Expand Down

0 comments on commit 874f279

Please sign in to comment.