-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
83 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: "Destroy terraform infra" | ||
description: "Destroy terraform infra" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Destroy terraform infra | ||
shell: bash | ||
working-directory: ${{ env.AUTO_TEST_DIR }} | ||
run: | | ||
mkdir -p logs/$RESOURCE | ||
cd $COMPLINCE | ||
cd $RESOURCE | ||
echo "Terraform Init..." | ||
if [ ${{ github.repository }} == 'epam/ecc-aws-rulepack' ]; then | ||
echo 'DONE' | ||
elif [ ${{ github.repository }} == 'epam/ecc-gcp-rulepack' ]; then | ||
echo 'TO DO' | ||
elif [ ${{ github.repository }} == 'epam/ecc-azure-rulepack' ]; then | ||
export TF_VAR_remote_state_region=$AWS_DEFAULT_REGION | ||
export TF_VAR_remote_state_bucket=$TF_BACKEND_STORAGE_NAME | ||
terraform init -backend-config="bucket=$TF_BACKEND_STORAGE_NAME" -backend-config="key=azure/states/${RESOURCE}/${COMPLINCE}.tfstate" -backend-config="region=$AWS_DEFAULT_REGION" | ||
fi | ||
echo "Terraform Destroy..." | ||
terraform destroy -auto-approve &> "${{ github.workspace }}/${AUTO_TEST_DIR}/logs/${RESOURCE}/${COMPLINCE}_down.txt" | ||
echo "Terraform State List..." | ||
terraform state list |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
resource "random_integer" "this" { | ||
min = 1 | ||
max = 98 | ||
max = 99 | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
resource "random_integer" "this" { | ||
min = 1 | ||
max = 98 | ||
max = 99 | ||
} |
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
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