Skip to content

Commit ab51ccc

Browse files
NRL-1664 New NFT/Performance/Load terraform environment
1 parent 47ba6be commit ab51ccc

File tree

9 files changed

+84
-10
lines changed

9 files changed

+84
-10
lines changed

terraform/account-wide-infrastructure/mgmt/route53.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,16 @@ resource "aws_route53_record" "NEW_qa_zone_delegation" {
136136
ttl = 300
137137
type = "NS"
138138
}
139+
140+
resource "aws_route53_record" "perftest_zone_delegation" {
141+
zone_id = aws_route53_zone.prod_zone.zone_id
142+
name = "perftest.record-locator.national.nhs.uk"
143+
records = [
144+
"ns-1821.awsdns-35.co.uk.",
145+
"ns-1449.awsdns-53.org.",
146+
"ns-933.awsdns-52.net.",
147+
"ns-500.awsdns-62.com."
148+
]
149+
ttl = 300
150+
type = "NS"
151+
}

terraform/account-wide-infrastructure/test/domain.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,11 @@ module "ref-custom-domain-name" {
3838
mtls_certificate_file = "s3://${module.ref-truststore-bucket.bucket_name}/${module.ref-truststore-bucket.certificates_object_key}"
3939
mtls_certificate_file_version = module.ref-truststore-bucket.certificates_object_version
4040
}
41+
42+
module "perftest-custom-domain-name" {
43+
source = "../modules/env-custom-domain-name"
44+
domain_name = var.perftest_api_domain_name
45+
domain_zone = aws_route53_zone.test-perftest-api-ns.name
46+
mtls_certificate_file = "s3://${module.perftest-truststore-bucket.bucket_name}/${module.perftest-truststore-bucket.certificates_object_key}"
47+
mtls_certificate_file_version = module.perftest-truststore-bucket.certificates_object_version
48+
}

terraform/account-wide-infrastructure/test/dynamodb__pointers-table.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,11 @@ module "ref-pointers-table" {
3030
enable_pitr = true
3131
kms_deletion_window_in_days = 30
3232
}
33+
34+
module "perftest-pointers-table" {
35+
source = "../modules/pointers-table"
36+
name_prefix = "nhsd-nrlf--perftest"
37+
enable_deletion_protection = true
38+
enable_pitr = true
39+
kms_deletion_window_in_days = 30
40+
}

terraform/account-wide-infrastructure/test/route53.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ resource "aws_route53_zone" "NEW_test-ref-ns" {
1717
resource "aws_route53_zone" "test-ref-ns" {
1818
name = "api.record-locator.ref.national.nhs.uk"
1919
}
20+
21+
resource "aws_route53_zone" "test-perftest-ns" {
22+
name = "perftest.record-locator.national.nhs.uk"
23+
}

terraform/account-wide-infrastructure/test/s3.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ module "ref-permissions-store-bucket" {
2424
name_prefix = "nhsd-nrlf--ref"
2525
}
2626

27+
module "perftest-permissions-store-bucket" {
28+
source = "../modules/permissions-store-bucket"
29+
name_prefix = "nhsd-nrlf--perftest"
30+
}
31+
2732
module "qa-truststore-bucket" {
2833
source = "../modules/truststore-bucket"
2934
name_prefix = "nhsd-nrlf--qa"
@@ -53,3 +58,9 @@ module "ref-truststore-bucket" {
5358
name_prefix = "nhsd-nrlf--ref"
5459
server_certificate_file = "../../../truststore/server/ref.pem"
5560
}
61+
62+
module "perftest-truststore-bucket" {
63+
source = "../modules/truststore-bucket"
64+
name_prefix = "nhsd-nrlf--perftest"
65+
server_certificate_file = "../../../truststore/server/perftest.pem"
66+
}

terraform/account-wide-infrastructure/test/secrets.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ resource "aws_secretsmanager_secret" "ref_smoke_test_apigee_app" {
1717
description = "APIGEE App used to run Smoke Tests against the REF environment"
1818
}
1919

20+
resource "aws_secretsmanager_secret" "perftest_smoke_test_apigee_app" {
21+
name = "${local.prefix}--perftest--apigee-app--smoke-test"
22+
description = "APIGEE App used to run Smoke Tests against the perftest environment"
23+
}
24+
2025
resource "aws_secretsmanager_secret" "backup_destination_parameters" {
2126
name = "${local.prefix}--backup-destination-parameters"
2227
description = "Parameters used to configure the backup destination"
@@ -50,6 +55,11 @@ resource "aws_secretsmanager_secret" "ref_smoke_test_parameters" {
5055
description = "Parameters used to run Smoke Tests against the ref environment"
5156
}
5257

58+
resource "aws_secretsmanager_secret" "perftest_smoke_test_parameters" {
59+
name = "${local.project}--perftest--smoke-test-parameters"
60+
description = "Parameters used to run Smoke Tests against the perftest environment"
61+
}
62+
5363

5464
#
5565
# Splunk Configuration secrets
@@ -107,6 +117,11 @@ resource "aws_secretsmanager_secret" "ref_environment_configuration" {
107117
description = "The environment configuration for the Ref environment"
108118
}
109119

120+
resource "aws_secretsmanager_secret" "perftest_environment_configuration" {
121+
name = "${local.project}--perftest--env-config"
122+
description = "The environment configuration for the Perftest environment"
123+
}
124+
110125
#
111126
# PowerBI secrets
112127
#

terraform/account-wide-infrastructure/test/vars.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ variable "ref_api_domain_name" {
2929
default = "ref.api.record-locator.ref.national.nhs.uk"
3030
}
3131

32+
variable "perftest_api_domain_name" {
33+
description = "The internal DNS name of the API Gateway for the perftest environment"
34+
default = "api.perftest.record-locator.national.nhs.uk"
35+
}
36+
3237
variable "enable_reporting" {
3338
type = bool
3439
description = "Enable account-wide reporting processes in the test account"

terraform/infrastructure/README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@ Each developer/QA can create their own ephemeral instance of the NRLF infrastruc
88

99
This project has a number of "persistent environments", similar to traditional dev, ref and prod environments. Each of these environments will typically contain multiple NRLF stacks, allowing for blue/green style deployment, and have shared storage infrastructure like DynamoDB tables and S3 buckets. The persistent environments are deployed as follows:
1010

11-
| Environment | TF Workspace | TF Config | AWS Account | Internal Domain | Public Domain |
12-
| ------------ | ------------- | ----------------- | ----------- | ------------------------------------ | ----------------------------------------- |
13-
| internal-dev | dev-N | `etc/dev.tfvars` | dev | `record-locator.dev.national.nhs.uk` | `internal-dev.api.service.nhs.uk` |
14-
| dev-sandbox | dev-sandbox-N | `etc/dev.tfvars` | dev | `record-locator.dev.national.nhs.uk` | `internal-dev-sandbox.api.service.nhs.uk` |
15-
| internal-qa | qa-N | `etc/qa.tfvars` | test | `qa.record-locator.national.nhs.uk` | `internal-qa.api.service.nhs.uk` |
16-
| qa-sandbox | qa-sandbox-N | `etc/qa.tfvars` | test | `qa.record-locator.national.nhs.uk` | `internal-qa-sandbox.api.service.nhs.uk` |
17-
| int | int-N | `etc/int.tfvars` | test | `record-locator.int.national.nhs.uk` | `int.api.service.nhs.uk` |
18-
| sandbox | int-sandbox-N | `etc/int.tfvars` | test | `record-locator.int.national.nhs.uk` | `sandbox.api.service.nhs.uk` |
19-
| ref | ref-N | `etc/ref.tfvars` | test | `record-locator.ref.national.nhs.uk` | `ref.api.service.nhs.uk` |
20-
| prod | prod-N | `etc/prod.tfvars` | prod | `record-locator.national.nhs.uk` | `api.service.nhs.uk` |
11+
| Environment | TF Workspace | TF Config | AWS Account | Internal Domain | Public Domain |
12+
| ------------ | ------------- | --------------------- | ----------- | ----------------------------------------- | ----------------------------------------- |
13+
| internal-dev | dev-N | `etc/dev.tfvars` | dev | `record-locator.dev.national.nhs.uk` | `internal-dev.api.service.nhs.uk` |
14+
| dev-sandbox | dev-sandbox-N | `etc/dev.tfvars` | dev | `record-locator.dev.national.nhs.uk` | `internal-dev-sandbox.api.service.nhs.uk` |
15+
| internal-qa | qa-N | `etc/qa.tfvars` | test | `qa.record-locator.national.nhs.uk` | `internal-qa.api.service.nhs.uk` |
16+
| qa-sandbox | qa-sandbox-N | `etc/qa.tfvars` | test | `qa.record-locator.national.nhs.uk` | `internal-qa-sandbox.api.service.nhs.uk` |
17+
| int | int-N | `etc/int.tfvars` | test | `record-locator.int.national.nhs.uk` | `int.api.service.nhs.uk` |
18+
| sandbox | int-sandbox-N | `etc/int.tfvars` | test | `record-locator.int.national.nhs.uk` | `sandbox.api.service.nhs.uk` |
19+
| perftest | perftest-N | `etc/perftest.tfvars` | test | `perftest.record-locator.national.nhs.uk` | `perftest.api.service.nhs.uk` |
20+
| ref | ref-N | `etc/ref.tfvars` | test | `record-locator.ref.national.nhs.uk` | `ref.api.service.nhs.uk` |
21+
| prod | prod-N | `etc/prod.tfvars` | prod | `record-locator.national.nhs.uk` | `api.service.nhs.uk` |
2122

2223
The `N` in the TF workspace name repesents the stack id in that environment. So, for example, the internal-dev environment might have two stacks, `dev-1` and `dev-2` with TF workspace names matching their stack names. All resources for the `dev-1` stack will be contained within the `dev-1` TF workspace.
2324

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
account_name = "perftest"
2+
aws_account_name = "test"
3+
4+
domain = "api.perftest.record-locator.national.nhs.uk"
5+
deletion_protection = true
6+
7+
public_domain = "perftest.api.service.nhs.uk"
8+
log_retention_period = 30
9+
enable_reporting = false

0 commit comments

Comments
 (0)