chore: use terraform

This commit is contained in:
Kim, Jimin 2023-09-25 16:31:29 +09:00
parent 16681f599a
commit 19ad7d66e9
Signed by: pomp
GPG key ID: CE1DDB8A4A765403
8 changed files with 190 additions and 4 deletions

37
.github/workflows/terraform.yml vendored Normal file
View file

@ -0,0 +1,37 @@
name: Terraform
on:
push:
branches:
- master
permissions:
contents: read
jobs:
terraform:
name: Terraform
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
with:
cli_config_credentials_token: ${{ secrets.TERRAFORM_TOKEN }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-1 # just a random region (also used in main.tf)
- run: terraform init
- run: terraform fmt -check
- run: terraform plan -input=false
- run: terraform apply -auto-approve -input=false