Skip to content

Commit 24feded

Browse files
committed
Refactoring
1 parent fda28c6 commit 24feded

25 files changed

+39
-43
lines changed

terraform/.terraform.lock.hcl

Lines changed: 20 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

terraform/Makefile

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,16 @@
11
-include .env
22

3-
interactionId = $(ENVIRONMENT)# to change to lower case
4-
environment = $(ENVIRONMENT)
5-
aws_profile = $(AWS_PROFILE)#apim-dev # Leave this here for pipeline
6-
tf_cmd = AWS_PROFILE=$(aws_profile) terraform
7-
8-
project_name = immunisation
9-
project_short_name = imms
10-
state_bucket = $(BUCKET_NAME)#$(project_name)-$(APIGEE_ENVIRONMENT)-terraform-state-files
11-
tf_state= -backend-config="bucket=$(state_bucket)"
12-
13-
tf_vars= -var="project_name=$(project_name)" -var="project_short_name=$(project_short_name)"
14-
15-
.PHONY : lock-provider workspace init plan apply clean destroy output state-list lambda-zip catch-all-zip
3+
tf_cmd = AWS_PROFILE=$(AWS_PROFILE) terraform
4+
tf_state= -backend-config="bucket=$(STATE_BUCKET_NAME)"
5+
tf_vars= -var-file="./environments/$(ENVIRONMENT)/$(SUB_ENVIRONMENT)/variables.tfvars"
166

177
lock-provider:
188
# Run this only when you install a new terraform provider. This will generate sha code in lock file for all platform
199
echo "This may take a while. Be patient!"
2010
$(tf_cmd) providers lock -platform=darwin_arm64 -platform=darwin_amd64 -platform=linux_amd64 -platform=windows_amd64
2111

2212
workspace:
23-
$(tf_cmd) workspace new $(ENVIRONMENT) || $(tf_cmd) workspace select $(ENVIRONMENT) && echo "Switched to workspace/environment: $(ENVIRONMENT)"
13+
$(tf_cmd) workspace new $(SUB_ENVIRONMENT) || $(tf_cmd) workspace select $(SUB_ENVIRONMENT) && echo "Switched to workspace/environment: $(SUB_ENVIRONMENT)"
2414

2515
init:
2616
$(tf_cmd) init $(tf_state) -upgrade $(tf_vars)
@@ -43,7 +33,7 @@ clean:
4333
destroy: workspace
4434
$(tf_cmd) destroy $(tf_vars) -auto-approve
4535
$(tf_cmd) workspace select default
46-
$(tf_cmd) workspace delete $(ENVIRONMENT)
36+
$(tf_cmd) workspace delete $(SUB_ENVIRONMENT)
4737

4838
output:
4939
$(tf_cmd) output -raw $(name)
@@ -62,3 +52,5 @@ catch-all-zip:
6252

6353
tf-%:
6454
$(tf_cmd) $*
55+
56+
.PHONY : lock-provider workspace init plan apply clean destroy output state-list lambda-zip catch-all-zip
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
environment = "int"
22
sub_environment = "blue"
33
immunisation_account_id = "084828561157"
4+
dspp_core_account_id = "603871901111"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
environment = "int"
22
sub_environment = "green"
33
immunisation_account_id = "084828561157"
4+
dspp_core_account_id = "603871901111"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
environment = "non-prod"
22
sub_environment = "int"
33
immunisation_account_id = "345594581768"
4+
dspp_core_account_id = "603871901111"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
environment = "non-prod"
22
sub_environment = "internal-dev"
33
immunisation_account_id = "345594581768"
4+
dspp_core_account_id = "603871901111"
45
create_config_bucket = true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
environment = "non-prod"
22
sub_environment = "pr"
33
immunisation_account_id = "345594581768"
4+
dspp_core_account_id = "603871901111"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
environment = "non-prod"
22
sub_environment = "ref"
33
immunisation_account_id = "345594581768"
4+
dspp_core_account_id = "603871901111"

terraform/lambda.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ resource "aws_ecr_repository" "operation_lambda_repository" {
2121
#resource "docker_image" "lambda_function_docker" {
2222
module "docker_image" {
2323
source = "terraform-aws-modules/lambda/aws//modules/docker-build"
24-
version = "7.21.1"
24+
version = "8.0.1"
2525

2626
create_ecr_repo = false
2727
ecr_repo = "${local.prefix}-operation-lambda-repo"

terraform/mesh_processor.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ resource "aws_ecr_repository" "mesh_file_converter_lambda_repository" {
2020
module "mesh_processor_docker_image" {
2121
count = var.environment == "int" ? 0 : 1
2222
source = "terraform-aws-modules/lambda/aws//modules/docker-build"
23-
version = "7.21.1"
23+
version = "8.0.1"
2424

2525
create_ecr_repo = false
2626
ecr_repo = aws_ecr_repository.mesh_file_converter_lambda_repository[0].name

0 commit comments

Comments
 (0)