Skip to content

Commit da522c7

Browse files
committed
Fixes
1 parent 1faf3c4 commit da522c7

File tree

5 files changed

+26
-16
lines changed

5 files changed

+26
-16
lines changed

terraform_old/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ project_short_name = imms
1010
state_bucket = immunisation-preprod-terraform-state-files
1111
tf_state= -backend-config="bucket=$(state_bucket)"
1212

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

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

terraform_old/api_gateway/mtls_cert.tf

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

66
data "aws_s3_bucket" "cert_storage" {
@@ -15,6 +15,14 @@ data "aws_s3_object" "cert" {
1515
resource "aws_s3_bucket" "truststore_bucket" {
1616
bucket = "${var.prefix}-truststores"
1717
force_destroy = true
18+
19+
}
20+
21+
resource "aws_s3_bucket_versioning" "versioning" {
22+
bucket = aws_s3_bucket.truststore_bucket.id
23+
versioning_configuration {
24+
status = "Enabled"
25+
}
1826
}
1927

2028
resource "aws_s3_object_copy" "copy_cert_from_storage" {

terraform_old/api_gateway/variables.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ variable "zone_id" {}
44
variable "api_domain_name" {}
55
variable "environment" {}
66
variable "oas" {}
7-
variable "config_env" {}
87
variable "aws_account_name" {}
98
locals {
109
environment = terraform.workspace == "green" ? "prod" : terraform.workspace == "blue" ? "prod" : terraform.workspace

terraform_old/endpoints.tf

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ locals {
2424
imms_table_name = data.aws_dynamodb_table.events-dynamodb-table.name
2525
imms_lambda_env_vars = {
2626
"DYNAMODB_TABLE_NAME" = local.imms_table_name,
27-
"IMMUNIZATION_ENV" = local.environment,
27+
"IMMUNIZATION_ENV" = var.aws_account_name,
2828
"IMMUNIZATION_BASE_PATH" = strcontains(local.environment, "pr-") ? "immunisation-fhir-api-${local.environment}" : "immunisation-fhir-api"
2929
# except for prod and ref, any other env uses PDS int environment
3030
"PDS_ENV" = local.environment == "prod" ? "prod" : local.environment == "ref" ? "ref" : "int",
@@ -101,14 +101,14 @@ output "oas" {
101101
}
102102

103103
module "api_gateway" {
104-
source = "./api_gateway"
105-
prefix = local.prefix
106-
short_prefix = local.short_prefix
107-
zone_id = data.aws_route53_zone.project_zone.zone_id
108-
api_domain_name = local.service_domain_name
109-
environment = local.environment
110-
oas = local.oas
111-
config_env = local.config_env
104+
source = "./api_gateway"
105+
prefix = local.prefix
106+
short_prefix = local.short_prefix
107+
zone_id = data.aws_route53_zone.project_zone.zone_id
108+
api_domain_name = local.service_domain_name
109+
environment = local.environment
110+
oas = local.oas
111+
aws_account_name = var.aws_account_name
112112
}
113113

114114

terraform_old/variables.tf

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
variable "profile" {
22
default = "apim-dev"
33
}
4+
5+
variable "environment" {}
6+
47
variable "aws_account_name" {
58
default = "int"
69
}
@@ -83,15 +86,15 @@ data "aws_security_group" "existing_securitygroup" {
8386
}
8487

8588
data "aws_s3_bucket" "existing_config_bucket" {
86-
bucket = "imms-int-supplier-config"
89+
bucket = "imms-${var.aws_account_name}-supplier-config"
8790
}
8891

8992
data "aws_s3_bucket" "existing_destination_bucket" {
90-
bucket = "immunisation-batch-int-preprod-data-destinations"
93+
bucket = "immunisation-batch-${var.aws_account_name}-preprod-data-destinations"
9194
}
9295

9396
data "aws_s3_bucket" "existing_source_bucket" {
94-
bucket = "immunisation-batch-int-preprod-data-sources"
97+
bucket = "immunisation-batch-${var.aws_account_name}-preprod-data-sources"
9598
}
9699

97100
data "aws_kms_key" "existing_lambda_encryption_key" {
@@ -103,7 +106,7 @@ data "aws_kms_key" "existing_kinesis_encryption_key" {
103106
}
104107

105108
data "aws_dynamodb_table" "events-dynamodb-table" {
106-
name = "imms-int-imms-events"
109+
name = "imms-${var.aws_account_name}-imms-events"
107110
}
108111

109112
data "aws_dynamodb_table" "audit-table" {

0 commit comments

Comments
 (0)