forked from aws-ia/terraform-aws-eks-blueprints
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (60 loc) · 2.26 KB
/
e2e-parallel-destroy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: e2e-parallel-destroy-only
on:
workflow_dispatch:
inputs:
TFDestroy:
description: 'Destroy TF Automatically (false/true) - Default: true'
required: true
default: 'true'
concurrency: e2e-parallel-destroy
permissions:
contents: read
jobs:
deploy:
name: Run e2e test
runs-on: ubuntu-latest
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
include:
- example_path: patterns/agones-game-controller
- example_path: patterns/fargate-serverless
- example_path: patterns/gitops/getting-started-argocd
- example_path: patterns/ipv6-eks-cluster
- example_path: patterns/karpenter
- example_path: patterns/multi-tenancy-with-teams
- example_path: patterns/stateful
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
- name: Setup backend
# Un-comment remote backend for use in workflow
run: sed -i "s/# //g" ${{ matrix.example_path }}/versions.tf
- name: Auth AWS
uses: aws-actions/[email protected]
with:
role-to-assume: ${{ secrets.ROLE_TO_ASSUME }}
aws-region: us-west-2
role-duration-seconds: 3600
role-session-name: GithubActions-Session
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.3.10
- name: Terraform Destroy
working-directory: ${{ matrix.example_path }}
run: |
terraform init -upgrade=true
terraform destroy -target=module.eks_blueprints_kubernetes_addons -no-color -input=false -auto-approve
terraform destroy -target=module.eks_blueprints_addons -no-color -input=false -auto-approve
terraform destroy -target=module.eks_blueprints -no-color -input=false -auto-approve
terraform destroy -target=module.eks -no-color -input=false -auto-approve
terraform destroy -no-color -input=false -auto-approve