Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Iac and Terratest tests for Secure AKS Construction Set #65

Merged
merged 409 commits into from
Jul 30, 2021
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
409 commits
Select commit Hold shift + click to select a range
5f31927
flux
eedorenko Apr 9, 2021
41461f0
awesome
eedorenko Apr 9, 2021
0ef31f7
super wierd
eedorenko Apr 9, 2021
174ec89
wrong
eedorenko Apr 9, 2021
1374a0f
fix it
eedorenko Apr 9, 2021
c4247b2
Add enterprise_scale/construction_sets/aks/online/aks_secure_baseline…
eedorenko Apr 9, 2021
7508260
Add enterprise_scale/construction_sets/aks/online/aks_secure_baseline…
eedorenko Apr 9, 2021
15492fd
Add enterprise_scale/construction_sets/aks/online/aks_secure_baseline…
eedorenko Apr 9, 2021
80c93dd
deploy
eedorenko Apr 9, 2021
f54b56c
Merge branch 'eedorenko/levels' of https://github.com/kaizentm/caf-te…
eedorenko Apr 9, 2021
0c3637d
pipeline
eedorenko Apr 9, 2021
c7086d3
Update enterprise_scale/construction_sets/aks/online/aks_secure_basel…
eedorenko Apr 9, 2021
12fe835
pipeline
eedorenko Apr 9, 2021
c0c9c20
Merge branch 'eedorenko/levels' of https://github.com/kaizentm/caf-te…
eedorenko Apr 9, 2021
d51bd35
owner
eedorenko Apr 9, 2021
f720e2d
pipeline
eedorenko Apr 9, 2021
f17d721
owner
eedorenko Apr 9, 2021
73d979c
doc
eedorenko Apr 9, 2021
678538c
Update enterprise_scale/construction_sets/aks/online/aks_secure_basel…
eedorenko Apr 9, 2021
f7b8013
link
eedorenko Apr 9, 2021
5279946
Merge branch 'eedorenko/levels' of https://github.com/kaizentm/caf-te…
eedorenko Apr 9, 2021
7dd5ec8
link
eedorenko Apr 9, 2021
254f2dc
link
eedorenko Apr 9, 2021
7773aff
change branch name
eedorenko Apr 9, 2021
644eecd
Merge branch 'starter' into eedorenko/levels
eedorenko Apr 9, 2021
3530546
Merge pull request #1 from kaizentm/eedorenko/levels
eedorenko Apr 9, 2021
2c4a844
launchpad
eedorenko Apr 12, 2021
32c9432
caf/public
eedorenko Apr 12, 2021
012dd93
fix
eedorenko Apr 12, 2021
a48edbb
clean
eedorenko Apr 12, 2021
b54cb19
cleaning
eedorenko Apr 12, 2021
6e1d8b3
aks version
eedorenko Apr 12, 2021
b51895f
clean
eedorenko Apr 12, 2021
2f427cf
clean
eedorenko Apr 12, 2021
b3ee57b
aaaa
eedorenko Apr 12, 2021
7889030
clean
eedorenko Apr 12, 2021
e6b36ce
clean
eedorenko Apr 12, 2021
231e2c6
clean
eedorenko Apr 12, 2021
8efdc95
clean
eedorenko Apr 12, 2021
b30bc4e
Add enterprise_scale/construction_sets/aks/online/aks_secure_baseline…
eedorenko Apr 12, 2021
d11b57c
Add enterprise_scale/construction_sets/aks/online/aks_secure_baseline…
eedorenko Apr 12, 2021
9dd5cc0
Add enterprise_scale/construction_sets/aks/online/aks_secure_baseline…
eedorenko Apr 12, 2021
4af0fcb
Delete enterprise_scale/construction_sets/aks/online/aks_secure_basel…
eedorenko Apr 12, 2021
6a62a88
Delete enterprise_scale/construction_sets/aks/online/aks_secure_basel…
eedorenko Apr 12, 2021
57f91bc
Delete enterprise_scale/construction_sets/aks/online/aks_secure_basel…
eedorenko Apr 12, 2021
0aefeb0
Merge pull request #2 from kaizentm/eedorenko/pr-to-caf
eedorenko Apr 12, 2021
b1a397f
azure network policy
eedorenko Apr 13, 2021
bfd8fbd
Test network policy
eedorenko Apr 13, 2021
7144971
cmment
eedorenko Apr 13, 2021
a780830
test
eedorenko Apr 13, 2021
a67b43b
kaizentm -> azure
eedorenko Apr 13, 2021
a74d6f6
Add manifests
Apr 13, 2021
36ba99f
Add manifests
Apr 13, 2021
3fd6ab7
upgrade
eedorenko Apr 13, 2021
0770dc2
network policy
eedorenko Apr 13, 2021
3634b79
np
eedorenko Apr 13, 2021
4ddaf55
aks-hack
eedorenko Apr 13, 2021
e22710f
fix
eedorenko Apr 14, 2021
1bf3f85
aksoperations
eedorenko Apr 14, 2021
13d5448
pipeline
eedorenko Apr 14, 2021
11e2260
policy
eedorenko Apr 14, 2021
9babd40
Add enterprise_scale/construction_sets/aks/online/aks_secure_baseline…
eedorenko Apr 14, 2021
af6bda9
Add enterprise_scale/construction_sets/aks/online/aks_secure_baseline…
eedorenko Apr 14, 2021
bae7424
Add enterprise_scale/construction_sets/aks/online/aks_secure_baseline…
eedorenko Apr 14, 2021
659f818
test
eedorenko Apr 14, 2021
21e54ac
fix
eedorenko Apr 14, 2021
ba77487
Add enterprise_scale/construction_sets/aks/online/aks_secure_baseline…
eedorenko Apr 14, 2021
543faf6
Add enterprise_scale/construction_sets/aks/online/aks_secure_baseline…
eedorenko Apr 14, 2021
5f47584
Add enterprise_scale/construction_sets/aks/online/aks_secure_baseline…
eedorenko Apr 14, 2021
d73b81b
vars
eedorenko Apr 14, 2021
82a5bb2
doc update
eedorenko Apr 15, 2021
4957b2e
clean
eedorenko Apr 15, 2021
8cf70dd
Merge branch 'starter' into eedorenko/azure-npm
eedorenko Apr 15, 2021
6b3c166
network policy
eedorenko Apr 15, 2021
629d628
fix
eedorenko Apr 15, 2021
fc24822
Merge pull request #4 from kaizentm/eedorenko/azure-npm
eedorenko Apr 15, 2021
5cab6b5
remove network policy
eedorenko Apr 16, 2021
d1fabf7
Merge branch 'starter' into eedorenko/pr-to-caf
eedorenko Apr 16, 2021
3137083
typo
eedorenko Apr 19, 2021
5a39226
comment K8s version
eedorenko Apr 20, 2021
5f04dd3
manual
eedorenko Apr 21, 2021
a9a865c
added manual instructions
eedorenko Apr 21, 2021
5356e63
token
eedorenko Apr 21, 2021
64d2bd2
remove test_prefix
eedorenko Apr 21, 2021
9d29ffd
comment in doc
eedorenko Apr 21, 2021
a7f8d1c
data sources for k8s access
eedorenko Apr 21, 2021
c0fa79d
move flux to add_ons
eedorenko Apr 22, 2021
f6c4446
firewall restrictions
eedorenko Apr 22, 2021
9eb330b
typo
eedorenko Apr 23, 2021
b85b9e5
Merge pull request #50 from kaizentm/eedorenko/pr-to-caf
hieumoscow Apr 23, 2021
2731b3d
Update docker-compose.yml
eedorenko May 11, 2021
d77f8d4
Update main.tf
eedorenko May 11, 2021
4aee0f7
Update providers.tf
eedorenko May 11, 2021
5600a06
Update providers.tf
eedorenko May 11, 2021
7fdfd99
Update providers.tf
eedorenko May 11, 2021
af327ad
Update providers.tf
eedorenko May 11, 2021
a9ecd38
Update ExpectedValues.yml
eedorenko May 11, 2021
0ee3a9f
Update level3_aks_test.go
eedorenko May 11, 2021
fe379b8
Update level3_aks_test.go
eedorenko May 11, 2021
23c2d80
Update firewall_application_rule_collection_definition.tfvars
eedorenko May 11, 2021
9e0635c
Update flux.tfvars
eedorenko May 11, 2021
983510a
Update flux.tfvars
eedorenko May 11, 2021
c9fa9c8
Update flux.tfvars
eedorenko May 11, 2021
0fa5527
Update level3_aks_test.go
eedorenko May 11, 2021
249e2d9
Update level3_aks_test.go
eedorenko May 11, 2021
77ef69c
rename levels to parts
eedorenko May 12, 2021
7f06ddc
GoLang is not in the rover container
eedorenko May 12, 2021
cf11a56
Merge branch 'starter' into CSE-AKS-terratest
eedorenko May 13, 2021
940afb8
test
eedorenko May 13, 2021
b2459b1
Update deploy-secure-aks-baseline.yaml for Azure Pipelines
eedorenko May 14, 2021
d876534
Refactor AKS construction set to landingzone & standalone
hieumoscow May 14, 2021
c210c06
Added Levels in Readme
hieumoscow May 14, 2021
212def6
Added Readme prerequisite
hieumoscow May 14, 2021
2cb636c
Remove comments
hieumoscow May 14, 2021
2a3e53f
Fix AAD & Azure Monitor Addon
hieumoscow May 15, 2021
628dc5e
Removed redundant readme and Added minor format change
hieumoscow May 24, 2021
c799763
Refactor AKS RI folders
hieumoscow May 26, 2021
181418f
Update pre-commit & rover version
hieumoscow May 29, 2021
d134081
Merge branch 'starter' of https://github.com/Azure/caf-terraform-land…
hieumoscow May 29, 2021
8f03e18
Upgrade Pod Identity to 1.8.0 & Readmes
hieumoscow May 30, 2021
fe59674
Refactor READMEs
hieumoscow May 31, 2021
99b89bc
Updated Standalone README
hieumoscow May 31, 2021
0dbdb0a
Changed Readme
hieumoscow May 31, 2021
7ff6ffa
Adding ARM_PARTNER_ID
hieumoscow Jun 1, 2021
9012273
fix azdo pipeline
eedorenko Jun 2, 2021
8956b0d
fixing pipeline
eedorenko Jun 3, 2021
4593aff
seccret
eedorenko Jun 3, 2021
cde262c
dont check secrets
eedorenko Jun 3, 2021
a6e62f5
typo
eedorenko Jun 3, 2021
b985705
test
eedorenko Jun 3, 2021
a23117c
Add standalone test
hieumoscow Jun 3, 2021
163a1a6
Modified level to part
hieumoscow Jun 3, 2021
9a3ccc6
move tests
eedorenko Jun 3, 2021
88b0c7c
Move to landingzone
eedorenko Jun 3, 2021
1182cca
landingzone
eedorenko Jun 3, 2021
b528101
prefix
eedorenko Jun 4, 2021
1307a81
no parts anymore
eedorenko Jun 4, 2021
cd396ff
update documents
eedorenko Jun 4, 2021
ee45eac
Reorient pipelines on landingzones
eedorenko Jun 4, 2021
12eac2b
Rename testing.md to README.md
hieumoscow Jun 4, 2021
d89bff7
Update 01-terraform.md
hieumoscow Jun 4, 2021
b680929
GH actions and some fixes
eedorenko Jun 4, 2021
4b8305d
Modified standalone to use landingzone flux addon. Modified pod ident…
hieumoscow Jun 5, 2021
759a847
Change flux tfvar to use target_path
hieumoscow Jun 5, 2021
6878e95
Remove comments & test output
hieumoscow Jun 5, 2021
33aa36c
Refactor readmes
hieumoscow Jun 6, 2021
40ab1fe
change test scripts
hieumoscow Jun 7, 2021
cfd5217
Change test in azure pipeline yml
hieumoscow Jun 7, 2021
54755dc
Modify pipeline
hieumoscow Jun 7, 2021
f4f284b
Modify pipeline
hieumoscow Jun 7, 2021
8ed42e0
Modify pipeline
hieumoscow Jun 7, 2021
36556f5
Modify Pipeline
hieumoscow Jun 7, 2021
afb2337
Added env to pipeline
hieumoscow Jun 7, 2021
34c8383
Modified launchpad.sh
hieumoscow Jun 7, 2021
787ec04
Modify pipeline
hieumoscow Jun 7, 2021
bb74322
esaks
hieumoscow Jun 7, 2021
9417ffb
prefix
hieumoscow Jun 7, 2021
6f94cfb
prefix
hieumoscow Jun 7, 2021
e44ce34
pipeline
hieumoscow Jun 7, 2021
510c56d
pipeline
hieumoscow Jun 7, 2021
5a42957
prefix
hieumoscow Jun 7, 2021
5c1077b
depends on
hieumoscow Jun 7, 2021
e245f98
prefix
hieumoscow Jun 7, 2021
aeae920
prefix
hieumoscow Jun 7, 2021
dbbc786
-var="random_length=0"
hieumoscow Jun 7, 2021
550212c
pipeline
hieumoscow Jun 7, 2021
b126b44
pipeline
hieumoscow Jun 7, 2021
6fb2688
pipeline
hieumoscow Jun 7, 2021
40d9a46
Remove run_test.sh
hieumoscow Jun 7, 2021
42b27e8
Split to deploy & destroy pipelines
hieumoscow Jun 7, 2021
d653cf5
destroy
hieumoscow Jun 7, 2021
13fddbe
rover
hieumoscow Jun 7, 2021
4f47ed6
Merge branch 'starter' into CSE-AKS-terratest
hieumoscow Jun 7, 2021
393889c
Remove random_length, prefix
hieumoscow Jun 11, 2021
904c03c
Merge branch 'CSE-AKS-terratest' of https://github.com/Azure/caf-terr…
hieumoscow Jun 11, 2021
40a2961
Changed GitHub action
hieumoscow Jun 16, 2021
d3bfa9c
Added GitHub Action trigger on CSE-AKS-terratest push
hieumoscow Jun 16, 2021
7d42e18
update prefix gh action
hieumoscow Jun 16, 2021
e36145b
env
hieumoscow Jun 16, 2021
515ac39
test
hieumoscow Jun 16, 2021
f9aba3b
prefix output
hieumoscow Jun 16, 2021
9013f28
fix
hieumoscow Jun 16, 2021
d6ed7cc
change lz_key spoke
hieumoscow Jun 16, 2021
1b78049
meow
hieumoscow Jun 16, 2021
2c51cbc
Fix GitHub Action & Azure Pipeline
hieumoscow Jun 16, 2021
8a61238
Fix GitHub Action & Azure Pipeline 1
hieumoscow Jun 16, 2021
36a9d12
Fix GitHub Action & Azure Pipeline 2
hieumoscow Jun 16, 2021
509e5c2
Fix GitHub Action & Azure Pipeline 3
hieumoscow Jun 16, 2021
a9d19cd
on: workflow_dispatch
hieumoscow Jun 16, 2021
cc41900
Fix GitHub Action & Azure Pipeline 4
hieumoscow Jun 16, 2021
c5690b6
Fix GitHub Action & Azure Pipeline 5
hieumoscow Jun 17, 2021
5bd6954
Fix GitHub Action & Azure Pipeline 6
hieumoscow Jun 17, 2021
431ade9
workflow dispatch
hieumoscow Jun 17, 2021
a4aec05
Add destroy GitHub Action
hieumoscow Jun 17, 2021
7568308
test
hieumoscow Jun 17, 2021
3e68638
Fix toyota
hieumoscow Jun 17, 2021
be0a094
Fix pipeline
hieumoscow Jun 17, 2021
99e7493
Add ARM_PARTNER_ID to pipelines
hieumoscow Jun 21, 2021
2b95bec
Fix Flux & Pipelines
hieumoscow Jun 22, 2021
fb05e20
Merge pipelines
hieumoscow Jun 22, 2021
e61e0f4
Fix typo
hieumoscow Jun 22, 2021
b881cd6
Fix typo 2
hieumoscow Jun 22, 2021
483c1b4
Fix typo 3
hieumoscow Jun 22, 2021
8d0b683
Add Run id as ENVIRONMENT
hieumoscow Jun 22, 2021
d4490bc
Remove TF_VAR_environment: $(ENVIRONMENT)
hieumoscow Jun 22, 2021
5aa8822
Fix env
hieumoscow Jun 22, 2021
292a6e7
Add Environment for deploy addon
hieumoscow Jun 22, 2021
75ab8ff
Fix ENVIRONMENT for Deploy Addon
hieumoscow Jun 23, 2021
9d843ad
Delete Kured & add var image, purge in pipelines
hieumoscow Jun 23, 2021
328ca42
fix env
hieumoscow Jun 23, 2021
ce486f5
test
hieumoscow Jun 23, 2021
9953e89
Fix image: aztfmod/rover-preview:0.15.3-2105.210707
hieumoscow Jun 23, 2021
402b93e
Add purge for Pipeline
hieumoscow Jun 23, 2021
e59c446
Rename purge job
hieumoscow Jun 23, 2021
29f60a6
Comment ad group add delete out
hieumoscow Jun 23, 2021
9230ad2
Add standalone GitHub Action
hieumoscow Jun 24, 2021
8401844
Change Terraform version to 0.15.3
hieumoscow Jun 24, 2021
b1870c0
test
hieumoscow Jun 24, 2021
94d7269
Upgrade Flux
hieumoscow Jul 12, 2021
fe5b740
Merge branch 'starter' of https://github.com/Azure/caf-terraform-land…
hieumoscow Jul 12, 2021
5cb07ec
Fix flux for standalone
hieumoscow Jul 12, 2021
85e077f
Add echo
hieumoscow Jul 12, 2021
8c26e55
Update to aztfmod/rover-preview:0.15.3-2105.210707
hieumoscow Jul 12, 2021
64649e0
Added -auto-approve
hieumoscow Jul 12, 2021
6866504
Clone moved to master
hieumoscow Jul 12, 2021
0585f1e
Changed cd enterprise_scale/construction_sets/aks/online/aks_secure_b…
hieumoscow Jul 12, 2021
85c29ba
Add TF_VAR_environment standalone
hieumoscow Jul 12, 2021
6b7719c
go 1.15
hieumoscow Jul 12, 2021
03a6048
Fix terraform output paths
hieumoscow Jul 12, 2021
7c48eeb
Fix path
hieumoscow Jul 12, 2021
717479b
Path
hieumoscow Jul 12, 2021
f273ec4
CI
hieumoscow Jul 12, 2021
28c14bc
echos
hieumoscow Jul 12, 2021
aeb5659
output.json
hieumoscow Jul 12, 2021
f9585ad
CI
hieumoscow Jul 12, 2021
d8e3e34
Fix tf output and jq
hieumoscow Jul 13, 2021
3d3d337
JQ
hieumoscow Jul 13, 2021
066f212
Fix terraform output for jq
hieumoscow Jul 13, 2021
d6d3153
remove echoes
hieumoscow Jul 13, 2021
a83eb5e
Update standalone aks doc
hieumoscow Jul 20, 2021
80491af
TF 1.0.3
hieumoscow Jul 24, 2021
8cfb693
Add Standalone Azure Pipeline
hieumoscow Jul 24, 2021
93582c1
Upgrade aztfmod/caf/azurerm to 5.4.0
hieumoscow Jul 24, 2021
4838ba1
Upgrade flux version standalone, fix launchpad test
hieumoscow Jul 24, 2021
0dca1c9
Fix flux ns destroy & azuread caf var
hieumoscow Jul 24, 2021
1fcd666
Removed flux add_on from tfstate for destroy
hieumoscow Jul 28, 2021
27cba90
Remove flux_addon module during azure pipeline destroy
hieumoscow Jul 28, 2021
04d1e0a
Fix azure pipeline purge
hieumoscow Jul 28, 2021
fcf9adb
fmt
hieumoscow Jul 29, 2021
d60a087
Update settings.json
hieumoscow Jul 29, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
467 changes: 467 additions & 0 deletions .github/workflows/deploy-aks-online-landingzone.yaml

Large diffs are not rendered by default.

107 changes: 107 additions & 0 deletions .github/workflows/deploy-aks-online-standalone.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Deploy_AKS_Online_Standalone
# The pipeline is triggered on:
# - PR/Issue comments "/deploy-all", "/deploy-launchpad", "/deploy-shared-services", "/deploy-networking-hub",
# "/deploy-networking-spoke", "/deploy-aks", "/deploy-addons"

on:
workflow_dispatch:
push:
branches:
- CSE-AKS-terratest
# issue_comment:
# types:
# - created

env:
AZURE_CREDENTIALS: '{"clientId":"${{ secrets.ARM_CLIENT_ID }}", "clientSecret":"${{ secrets.ARM_CLIENT_SECRET }}", "subscriptionId":"${{ secrets.ARM_SUBSCRIPTION_ID }}", "tenantId":"${{ secrets.ARM_TENANT_ID }}"}'
event_sha: +refs/pull/${{ github.event.issue.number }}/merge
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }}
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
ARM_PARTNER_ID: "f85b2775-ec1d-4fef-949e-bbd6957082af"
ENVIRONMENT: ${{ github.run_id }}

jobs:
deploy-standalone:
runs-on: ubuntu-latest
outputs:
prefix: ${{ steps.test.outputs.PREFIX }}
steps:
- name: Checkout Repository
if: contains(github.event.comment.body, '/deploy-all') || contains(github.event.comment.body, '/deploy-launchpad') || github.event_name != 'issue_comment'
uses: actions/checkout@v2
- name: Checkout PR code
if: contains(github.event.comment.body, '/deploy-all') || contains(github.event.comment.body, '/deploy-launchpad')
run: |
git fetch origin ${{ env.event_sha }}
git checkout FETCH_HEAD

- name: Azure Login
if: contains(github.event.comment.body, '/deploy-all') || contains(github.event.comment.body, '/deploy-launchpad') || github.event_name != 'issue_comment'
uses: azure/login@v1
with:
creds: ${{ env.AZURE_CREDENTIALS }}

- uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.0.3
terraform_wrapper: false
# https://stackoverflow.com/questions/65170927/terraform-output-value-failed-formatted-by-jq-in-github-actions

- name: Deploy Standalone
if: contains(github.event.comment.body, '/deploy-all') || contains(github.event.comment.body, '/deploy-launchpad') || github.event_name != 'issue_comment'
run: |
pwd
cd enterprise_scale/construction_sets/aks/online/aks_secure_baseline/standalone/
configuration_folder=configuration
parameter_files=$(find $configuration_folder -not -path "*launchpad*" | grep .tfvars | sed 's/.*/-var-file &/' | xargs)
terraform init -upgrade
eval terraform apply ${parameter_files} -var tags='{testing_job_id='"$ENVIRONMENT"'}' -auto-approve
- name: Test
id: test
if: contains(github.event.comment.body, '/deploy-all') || contains(github.event.comment.body, '/deploy-launchpad') || github.event_name != 'issue_comment'
run: |
pwd
cd enterprise_scale/construction_sets/aks/online/aks_secure_baseline/standalone/
ls -lta
export ARM_SUBSCRIPTION_ID=$(az account show --query id -o tsv)
export PREFIX=$(terraform output -json | jq -r '.global_settings.value.prefixes[0]')
echo $(terraform output -json | jq -r .aks_clusters_kubeconfig.value.cluster_re1.aks_kubeconfig_admin_cmd) | bash

cd ../test
go mod tidy
go test -v shared_services/shared_services_test.go
go test -v aks/aks_test.go
go test -v flux/flux_test.go
- name: Destroy Standalone
if: contains(github.event.comment.body, '/deploy-all') || contains(github.event.comment.body, '/deploy-launchpad') || github.event_name != 'issue_comment'
run: |
ls -lta
pwd
cd enterprise_scale/construction_sets/aks/online/aks_secure_baseline/standalone
configuration_folder=configuration
parameter_files=$(find $configuration_folder -not -path "*launchpad*" | grep .tfvars | sed 's/.*/-var-file &/' | xargs)
# remove flux from state as flux provider has issues with destroy
terraform state rm 'module.flux_addon'
eval terraform destroy ${parameter_files} -var tags='{testing_job_id='"$ENVIRONMENT"'}' -auto-approve
purge:
name: purge
runs-on: ubuntu-latest
if: ${{ failure() || cancelled() }}
needs: [deploy-standalone]
steps:
- name: Login azure
run: |
az login --service-principal -u '${{ env.ARM_CLIENT_ID }}' -p '${{ env.ARM_CLIENT_SECRET }}' --tenant '${{ env.ARM_TENANT_ID }}'
az account set -s ${{ env.ARM_SUBSCRIPTION_ID }}
- name: Complete purge
run: |
for i in `az monitor diagnostic-settings subscription list -o tsv --query "value[?contains(name, '${{ github.run_id }}' )].name"`; do echo "purging subscription diagnostic-settings: $i" && $(az monitor diagnostic-settings subscription delete --name $i --yes); done
for i in `az monitor log-profiles list -o tsv --query '[].name'`; do az monitor log-profiles delete --name $i; done
# for i in `az ad group list --query "[?contains(displayName, '${{ github.run_id }}')].objectId" -o tsv`; do echo "purging Azure AD group: $i" && $(az ad group delete --verbose --group $i || true); done
# for i in `az ad app list --query "[?contains(displayName, '${{ github.run_id }}')].appId" -o tsv`; do echo "purging Azure AD app: $i" && $(az ad app delete --verbose --id $i || true); done
for i in `az keyvault list-deleted --query "[?tags.testing_job_id=='${{ github.run_id }}'].name" -o tsv`; do az keyvault purge --name $i; done
for i in `az group list --query "[?tags.testing_job_id=='${{ github.run_id }}'].name" -o tsv`; do echo "purging resource group: $i" && $(az group delete -n $i -y --no-wait || true); done
for i in `az role assignment list --query "[?contains(roleDefinitionName, '${{ github.run_id }}')].roleDefinitionName" -o tsv`; do echo "purging role assignment: $i" && $(az role assignment delete --role $i || true); done
for i in `az role definition list --query "[?contains(roleName, '${{ github.run_id }}')].roleName" -o tsv`; do echo "purging custom role definition: $i" && $(az role definition delete --name $i || true); done
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ landingzones
**/*.key
**/*.pem
**/*.cer
**/*.output
*output.json
Loading