Terraform Destroy #5
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: Terraform Destroy | |
on: | |
workflow_dispatch: | |
jobs: | |
destroy: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./user-service/terraform | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: eu-central-1 | |
- name: Set up Terraform | |
uses: hashicorp/setup-terraform@v3 | |
- name: Create varibales.tf file | |
run: | | |
cat <<EOF > terraform.tfvars | |
firebase_api_key = "${{ secrets.FIREBASE_API_KEY }}" | |
firebase_auth_domain = "${{ secrets.FIREBASE_AUTH_DOMAIN }}" | |
firebase_project_id = "${{ secrets.FIREBASE_PROJECT_ID }}" | |
firebase_storage_bucket = "${{ secrets.FIREBASE_STORAGE_BUCKET }}" | |
firebase_messaging_sender_id = "${{ secrets.FIREBASE_MESSAGING_SENDER_ID }}" | |
firebase_app_id = "${{ secrets.FIREBASE_APP_ID }}" | |
firebase_type = "${{ secrets.FIREBASE_TYPE }}" | |
firebase_private_key_id = "${{ secrets.FIREBASE_PRIVATE_KEY_ID }}" | |
firebase_private_key = "${{ secrets.FIREBASE_PRIVATE_KEY }}" | |
firebase_client_email = "${{ secrets.FIREBASE_CLIENT_EMAIL }}" | |
firebase_client_id = "${{ secrets.FIREBASE_CLIENT_ID }}" | |
firebase_auth_uri = "${{ secrets.FIREBASE_AUTH_URI }}" | |
firebase_token_uri = "${{ secrets.FIREBASE_TOKEN_URI }}" | |
firebase_auth_provider_x509_cert_url = "${{ secrets.FIREBASE_AUTH_PROVIDER_X509_CERT_URL }}" | |
firebase_client_x509_cert_url = "${{ secrets.FIREBASE_CLIENT_X509_CERT_URL }}" | |
EOF | |
- name: Initialize Terraform | |
run: terraform init | |
- name: Terraform Destroy | |
run: terraform destroy -auto-approve |