Skip to content

Commit cd5269f

Browse files
Merge pull request #1086 from NHSDigital/feature/axkr1-NRL-1664-new-nft-environment
NRL-1664 New NFT/Performance/Load terraform environment
2 parents 5838ec0 + 71cbbc4 commit cd5269f

File tree

22 files changed

+133
-28
lines changed

22 files changed

+133
-28
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ In order to do this, make sure you have AWS CLI installed and configured, then r
6565
make ENV=env truststore-pull-all
6666
```
6767

68-
Where `env` is one of `dev`, `qa` , `int`, `ref` or `prod`.
68+
Where `env` is one of `dev`, `qa` , `int`, `perftest`, `ref` or `prod`.
6969

7070
## Getting Started
7171

@@ -414,7 +414,7 @@ If the Producer API has changed, or the documentation for that API has changed,
414414

415415
Once you have a new release version ready, you can deploy it through our environments as follows:
416416

417-
1. Use the "Persistent Environment Deploy" Github Action workflow to deploy the release tag to `dev`, `dev-sandbox`, `qa`, `qa-sandbox`, `int` and `int-sandbox` environments.
417+
1. Use the "Persistent Environment Deploy" Github Action workflow to deploy the release tag to `dev`, `dev-sandbox`, `qa`, `qa-sandbox`, `int`, `int-sandbox` and `perftest` environments.
418418
2. If any issues arise in the deployment, fix the issues, create a new release version and start this process again.
419419
3. Once the deployments are complete, use the "Persistent Environment Deploy" Github Action workflow to deploy the release version to `ref`.
420420
4. Once that is complete, use the "Persistent Environment Deploy" workflow to deploy the release version to `prod`.

scripts/are_resources_shared_for_stack.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
"qa-sandbox-2",
1414
"ref-1",
1515
"ref-2",
16+
"perftest-1",
17+
"perftest-2",
1618
"int-1",
1719
"int-2",
1820
"int-sandbox-1",

scripts/aws_session_assume.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"qa": "test",
88
"qa-sandbox": "test",
99
"ref": "test",
10+
"perftest": "test",
1011
"int": "test",
1112
"int-sandbox": "test",
1213
"prod": "prod",

scripts/get-account-name-for-env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ case "${env}" in
1313
dev|dev-sandbox)
1414
echo "dev"
1515
;;
16-
qa|qa-sandbox|ref|int|int-sandbox)
16+
qa|qa-sandbox|perftest|ref|int|int-sandbox)
1717
echo "test"
1818
;;
1919
prod)

scripts/truststore.sh

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -246,17 +246,19 @@ function _restore_archived_cert() {
246246
}
247247

248248
function _truststore_build_all() {
249-
_truststore_build_ca "prod" "record-locator.national.nhs.uk_CA2"
250-
_truststore_build_ca "int" "record-locator.int.national.nhs.uk_CA2"
251-
_truststore_build_ca "ref" "record-locator.ref.national.nhs.uk_CA2"
252-
_truststore_build_ca "qa" "qa.record-locator.national.nhs.uk_CA2"
253-
_truststore_build_ca "dev" "record-locator.dev.national.nhs.uk_CA2"
254-
255-
_truststore_build_cert "prod" "prod" "api.record-locator.national.nhs.uk"
256-
_truststore_build_cert "int" "int" "int.api.record-locator.int.national.nhs.uk"
257-
_truststore_build_cert "ref" "ref" "ref.api.record-locator.ref.national.nhs.uk"
258-
_truststore_build_cert "qa" "qa" "api.qa.record-locator.national.nhs.uk"
259-
_truststore_build_cert "dev" "dev" "dev.api.record-locator.dev.national.nhs.uk"
249+
_truststore_build_ca "prod" "record-locator.national.nhs.uk_CA2"
250+
_truststore_build_ca "int" "record-locator.int.national.nhs.uk_CA2"
251+
_truststore_build_ca "ref" "record-locator.ref.national.nhs.uk_CA2"
252+
_truststore_build_ca "perftest" "perftest.record-locator.national.nhs.uk_CA2"
253+
_truststore_build_ca "qa" "qa.record-locator.national.nhs.uk_CA2"
254+
_truststore_build_ca "dev" "record-locator.dev.national.nhs.uk_CA2"
255+
256+
_truststore_build_cert "prod" "prod" "api.record-locator.national.nhs.uk"
257+
_truststore_build_cert "int" "int" "int.api.record-locator.int.national.nhs.uk"
258+
_truststore_build_cert "ref" "ref" "ref.api.record-locator.ref.national.nhs.uk"
259+
_truststore_build_cert "perftest" "perftest" "api.perftest.record-locator.national.nhs.uk"
260+
_truststore_build_cert "qa" "qa" "api.qa.record-locator.national.nhs.uk"
261+
_truststore_build_cert "dev" "dev" "dev.api.record-locator.dev.national.nhs.uk"
260262

261263
echo -e "✅ Successfully built all truststore files"
262264
return 0

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module "dev-custom-domain-name" {
55
domain_zone = aws_route53_zone.dev-ns.name
66
mtls_certificate_file = "s3://${module.dev-truststore-bucket.bucket_name}/${module.dev-truststore-bucket.certificates_object_key}"
77
mtls_certificate_file_version = module.dev-truststore-bucket.certificates_object_version
8+
depends_on = [aws_route53_zone.dev-ns]
89
}
910

1011
module "devsandbox-custom-domain-name" {
@@ -13,4 +14,5 @@ module "devsandbox-custom-domain-name" {
1314
domain_zone = aws_route53_zone.dev-ns.name
1415
mtls_certificate_file = "s3://${module.dev-truststore-bucket.bucket_name}/${module.dev-truststore-bucket.certificates_object_key}"
1516
mtls_certificate_file_version = module.dev-truststore-bucket.certificates_object_version
17+
depends_on = [aws_route53_zone.dev-ns]
1618
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ data "aws_secretsmanager_secret" "test_backup_account_id" {
3838
name = "${local.project}--mgmt--test-backup-account-id"
3939
}
4040

41+
data "aws_secretsmanager_secret" "test_restore_account_id" {
42+
name = "${local.project}--mgmt--test-restore-account-id"
43+
}
44+
4145
data "aws_secretsmanager_secret_version" "dev_account_id" {
4246
secret_id = data.aws_secretsmanager_secret.dev_account_id.name
4347
}
@@ -49,3 +53,7 @@ data "aws_secretsmanager_secret_version" "test_account_id" {
4953
data "aws_secretsmanager_secret_version" "test_backup_account_id" {
5054
secret_id = data.aws_secretsmanager_secret.test_backup_account_id.name
5155
}
56+
57+
data "aws_secretsmanager_secret_version" "test_restore_account_id" {
58+
secret_id = data.aws_secretsmanager_secret.test_restore_account_id.name
59+
}

terraform/account-wide-infrastructure/mgmt/iam__developer-role.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ module "developer_policy" {
6363
Resource = [
6464
"arn:aws:iam::${data.aws_secretsmanager_secret_version.dev_account_id.secret_string}:role/terraform",
6565
"arn:aws:iam::${data.aws_secretsmanager_secret_version.test_account_id.secret_string}:role/terraform",
66-
"arn:aws:iam::${data.aws_secretsmanager_secret_version.test_backup_account_id.secret_string}:role/terraform"
66+
"arn:aws:iam::${data.aws_secretsmanager_secret_version.test_backup_account_id.secret_string}:role/terraform",
67+
"arn:aws:iam::${data.aws_secretsmanager_secret_version.test_restore_account_id.secret_string}:role/terraform"
6768
]
6869
},
6970
{

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-885.awsdns-46.net.",
145+
"ns-1995.awsdns-57.co.uk.",
146+
"ns-239.awsdns-29.com.",
147+
"ns-1424.awsdns-50.org."
148+
]
149+
ttl = 300
150+
type = "NS"
151+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ module "dev-custom-domain-name" {
66
domain_zone = aws_route53_zone.prod-ns.name
77
mtls_certificate_file = "s3://${module.prod-truststore-bucket.bucket_name}/${module.prod-truststore-bucket.certificates_object_key}"
88
mtls_certificate_file_version = module.prod-truststore-bucket.certificates_object_version
9+
depends_on = [aws_route53_zone.prod-ns]
910
}

0 commit comments

Comments
 (0)