Provision three tier architecture using terraform #10
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: Provision three tier architecture using terraform | |
on: | |
workflow_dispatch: | |
# push: | |
# branches: [main] | |
jobs: | |
provision-three-tier: | |
runs-on: ubuntu-latest | |
env: | |
TF_VAR_mykey: ${{ secrets.ssh_private_key }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_key }} | |
TF_VAR_db_user_name: ${{ secrets.db_user_name }} | |
TF_VAR_db_password: ${{ secrets.db_password }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: set up terraform | |
uses: hashicorp/setup-terraform@v2 | |
id: setupterraform | |
- name: terraform init | |
id: initailizeterraform | |
run: terraform init -migrate-state | |
- name: format terraform | |
id: formatterraform | |
run: terraform fmt | |
- name: terraform validate | |
id: validateterraform | |
run: terraform validate | |
- name: terraform plan | |
id: plan | |
run: terraform plan -input=false | |
- name: terraform apply | |
id: apply | |
run: terraform apply --auto-approve | |