Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: destroy true #7

Merged
merged 1 commit into from
May 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/terraform-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,21 @@ jobs:
with:
role-to-assume: arn:aws:iam::179916804929:role/BuildRun-GithubActions-Role #change to reflect your IAM role’s ARN
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: ${{ vars.AWS_REGION }}
aws-region: ${{ env.AWS_REGION }}

- name: Read destroy configuration
id: read-destroy-config
run: |
DESTROY_DEV="$(jq -r '.dev' ./infra/destroy_config.json)"
DESTROY_PROD="$(jq -r '.prod' ./infra/destroy_config.json)"
echo "destroy_dev=$(echo $DESTROY_DEV)" >> $GITHUB_OUTPUT
echo "destroy_prod=$(echo $DESTROY_PROD)" >> $GITHUB_OUTPUT

- name: Terraform Init
run: |
cd infra && terraform init \
-backend-config="bucket=${{ vars.TERRAFORM_S3_STATEFILE_BUCKET }}" \
-backend-config="bucket=${{ env.TERRAFORM_S3_STATEFILE_BUCKET }}" \
-backend-config="key=${{ github.event.repository.name }}" \
-backend-config="region=${{ env.AWS_REGION }}" \
-backend-config="dynamodb_table=${{ vars.TERRAFORM_DYNAMODB_LOCK_TABLE }}"
-backend-config="dynamodb_table=${{ env.TERRAFORM_DYNAMODB_LOCK_TABLE }}"

- name: Terraform Validate
run: terraform validate
Expand Down