Skip to content

Commit dbea23c

Browse files
committed
env
1 parent f09dc53 commit dbea23c

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

azure/azure-pr-teardown-pipeline.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,17 @@ jobs:
4747
export AWS_PROFILE=apim-dev
4848
account_id="$(aws sts get-caller-identity --query Account --output text)"
4949
50-
export sub_environment="$(WORKSPACE)"
51-
52-
BUCKET_NAME="immunisation-${sub_environment}-terraform-state-files"
53-
FALLBACK_BUCKET_NAME="immunisation-internal-dev-terraform-state-files"
54-
5550
export ENVIRONMENT="internal-dev"
56-
export BUCKET_NAME="$FALLBACK_BUCKET_NAME"
57-
cd terraform
51+
export BUCKET_NAME="immunisation-internal-dev-terraform-state-files"
52+
make init
5853
make init
5954
60-
export ENVIRONMENT="$sub_environment"
61-
export BUCKET_NAME="immunisation-${sub_environment}-terraform-state-files"
55+
export ENVIRONMENT="dev"
56+
export SUB_ENVIRONMENT="pr-711"
57+
export BUCKET_NAME="immunisation-pr-711-terraform-state-files"
6258
6359
cd terraform
64-
make workspace sub_environment=$sub_environment
65-
make destroy sub_environment=$sub_environment aws_account_no=${account_id}
60+
terraform workspace select $(WORKSPACE)
61+
make destroy aws_account_no=${account_id} environment=$(WORKSPACE)
6662
displayName: Destroy terraform PR workspace and linked resources
6763
retryCountOnTaskFailure: 2

terraform/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ tf_state = -backend-config="bucket=$(bucket_name)"
1212

1313
tf_vars = \
1414
-var="sub_environment=$(sub_environment)" \
15-
-var-file=./environments/$(sub_environment)/variables.tfvars
15+
-var-file=./environments/$(environment)/$(sub_environment_dir)/variables.tfvars
1616

1717
lock-provider:
1818
# Run this only when you install a new terraform provider. This will generate sha code in lock file for all platform

0 commit comments

Comments
 (0)