Skip to content

EKS Cluster

EKS Cluster #1

Workflow file for this run

name: EKS Cluster
on:
workflow_dispatch:
inputs:
cluster_ttl:
description: 'Cluster Time to Live (minutes)'
required: false
default: 240
type: number
jobs:
cluster:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
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: ${{ vars.AWS_CLUSTER_LOCATION }}
- name: Install Terraform
uses: hashicorp/setup-terraform@v3
- name: Stand up EKS cluster
run: |
cd eks
terraform init
terraform apply \
--var="cluster_location=${{ vars.AWS_CLUSTER_LOCATION }}" \
--var="cluster_machine_type=${{ vars.AWS_CLUSTER_MACHINE_TYPE }}" \
--auto-approve
- name: Results Time to Live Sleep
run: sleep ${{ inputs.cluster_ttl }}m
- name: Tear Down cluster
run: |
cd eks
terraform destroy \
--var="cluster_location=${{ vars.AWS_CLUSTER_LOCATION }}" \
--var="cluster_machine_type=${{ vars.AWS_CLUSTER_MACHINE_TYPE }}" \
--auto-approve