Terraform eks cluster #6
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 eks cluster" | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
inputs: | |
confirm: | |
description: 'Type "yes" to confirm destroy action' | |
required: true | |
jobs: | |
terraform_apply: | |
name: 'Terraform Apply' | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' | |
steps: | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-region: us-east-1 | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-session-token: ${{ secrets.AWS_SESSION_TOKEN }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v1 | |
with: | |
terraform_version: 1.8.2 | |
- name: Terraform Init | |
run: terraform init | |
- name: Terraform Plan | |
run: terraform plan | |
- name: Terraform Apply | |
run: terraform apply -auto-approve |