Skip to content

Commit 1faf3c4

Browse files
committed
modularity
1 parent bcdd776 commit 1faf3c4

File tree

8 files changed

+11
-10
lines changed

8 files changed

+11
-10
lines changed

.github/workflows/deploy-template.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- name: Terraform Plan
4242
working-directory: ${{ vars.TERRAFORM_DIR_PATH }}
4343
run: |
44-
make plan environment=${{ inputs.environment }}
44+
make plan environment=${{ inputs.environment }} aws_account_name=int
4545
4646
terraform-apply:
4747
needs: terraform-plan
@@ -74,7 +74,7 @@ jobs:
7474
- name: Terraform Apply
7575
working-directory: ${{ vars.TERRAFORM_DIR_PATH }}
7676
run: |
77-
make plan environment=${{ inputs.environment }}
77+
make apply environment=${{ inputs.environment }} aws_account_name=int
7878
7979
e2e-tests:
8080
needs: terraform-apply

terraform_old/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
-include .env
22

33
environment ?= $(ENVIRONMENT)
4+
aws_account_name ?= $(AWS_ACCOUNT_NAME)
45
aws_profile ?= $(AWS_PROFILE) #apim-dev # Leave this here for pipeline
56
tf_cmd = $(if $(AWS_PROFILE),AWS_PROFILE=$(AWS_PROFILE) ,)terraform
67

@@ -9,7 +10,7 @@ project_short_name = imms
910
state_bucket = immunisation-preprod-terraform-state-files
1011
tf_state= -backend-config="bucket=$(state_bucket)"
1112

12-
tf_vars= -var="project_name=$(project_name)" -var="project_short_name=$(project_short_name)" -var="aws_account_name=$(environment)"
13+
tf_vars= -var="project_name=$(project_name)" -var="project_short_name=$(project_short_name)" -var="aws_account_name=$(aws_account_name)"
1314

1415
.PHONY : lock-provider workspace init plan apply clean destroy output state-list lambda-zip catch-all-zip
1516

terraform_old/api_gateway/mtls_cert.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
locals {
22
# NHSD cert file
3-
truststore_file_name = "server-renewed-cert-v2.pem"
3+
truststore_file_name = "server-renewed-cert.pem"
44
}
55

66
data "aws_s3_bucket" "cert_storage" {
7-
bucket = "imms-fhir-int-cert-storage"
7+
bucket = "imms-fhir-${var.aws_account_name}-cert-storage"
88
}
99

1010
data "aws_s3_object" "cert" {

terraform_old/api_gateway/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ variable "api_domain_name" {}
55
variable "environment" {}
66
variable "oas" {}
77
variable "config_env" {}
8-
8+
variable "aws_account_name" {}
99
locals {
1010
environment = terraform.workspace == "green" ? "prod" : terraform.workspace == "blue" ? "prod" : terraform.workspace
1111
}

terraform_old/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ provider "aws" {
2121
default_tags {
2222
tags = {
2323
Project = var.project_name
24-
Environment = "int"
24+
Environment = var.aws_account_name
2525
Service = var.service
2626
}
2727
}

terraform_old/route53.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ locals {
33
}
44

55
data "aws_route53_zone" "project_zone" {
6-
name = "imms.int.vds.platform.nhs.uk"
6+
name = "imms.${var.aws_account_name}.vds.platform.nhs.uk"
77
}

terraform_old/splunk.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
data "aws_secretsmanager_secret" "splunk_token" {
2-
name = "imms/splunk/int/hec"
2+
name = "imms/splunk/${var.aws_account_name}/hec"
33
}
44
data "aws_secretsmanager_secret_version" "splunk_token_id" {
55
secret_id = data.aws_secretsmanager_secret.splunk_token.id

terraform_old/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ variable "service" {
1919
data "aws_vpc" "default" {
2020
filter {
2121
name = "tag:Name"
22-
values = ["imms-int-fhir-api-vpc"]
22+
values = ["imms-${var.aws_account_name}-fhir-api-vpc"]
2323
}
2424
}
2525

0 commit comments

Comments
 (0)