Skip to content

Commit 7112ad2

Browse files
committed
CCM-11586: use shared s3 module; always gen dummy certs
1 parent d6a7c30 commit 7112ad2

File tree

6 files changed

+60
-173
lines changed

6 files changed

+60
-173
lines changed

infrastructure/terraform/components/api/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ No requirements.
2929
| Name | Source | Version |
3030
|------|--------|---------|
3131
| <a name="module_authorizer_lambda"></a> [authorizer\_lambda](#module\_authorizer\_lambda) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/lambda | v2.0.4 |
32+
| <a name="module_domain_truststore"></a> [domain\_truststore](#module\_domain\_truststore) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/s3bucket | v2.0.17 |
3233
| <a name="module_get_letters"></a> [get\_letters](#module\_get\_letters) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/lambda | v2.0.10 |
3334
| <a name="module_hello_world"></a> [hello\_world](#module\_hello\_world) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/lambda | v2.0.10 |
3435
| <a name="module_kms"></a> [kms](#module\_kms) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/kms | v2.0.10 |
36+
| <a name="module_logging_bucket"></a> [logging\_bucket](#module\_logging\_bucket) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/s3bucket | v2.0.17 |
3537
| <a name="module_patch_letters"></a> [patch\_letters](#module\_patch\_letters) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/lambda | v2.0.10 |
3638
| <a name="module_supplier_ssl"></a> [supplier\_ssl](#module\_supplier\_ssl) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/ssl | v2.0.17 |
3739
## Outputs
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module "domain_truststore" {
2+
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/s3bucket?ref=v2.0.17"
3+
4+
name = "${local.csi_s3}-truststore"
5+
aws_account_id = var.aws_account_id
6+
component = var.component
7+
environment = var.environment
8+
project = var.project
9+
region = var.region
10+
11+
default_tags = merge(local.default_tags, { "Enable-Backup" = var.enable_backups }, { "Enable-S3-Continuous-Backup" = var.enable_backups }, { "SKIP_S3_AUDIT" = "true" })
12+
kms_key_arn = module.kms.key_id
13+
14+
bucket_logging_target = {
15+
bucket = module.logging_bucket.bucket
16+
prefix = "${name}/"
17+
}
18+
19+
policy_documents = [
20+
aws_iam_policy_document.truststore.json
21+
]
22+
23+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
module "logging_bucket" {
2+
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/s3bucket?ref=v2.0.17"
3+
4+
name = "${local.csi_s3}-bucket-logs"
5+
aws_account_id = var.aws_account_id
6+
component = var.component
7+
environment = var.environment
8+
project = var.project
9+
region = var.region
10+
11+
default_tags = merge(local.default_tags, { "Enable-Backup" = var.enable_backups }, { "Enable-S3-Continuous-Backup" = var.enable_backups }, { "SKIP_S3_AUDIT" = "true" })
12+
kms_key_arn = module.kms.key_id
13+
14+
policy_documents = [
15+
aws_iam_policy_document.logging.json
16+
]
17+
}
18+
19+
data "aws_iam_policy_document" "logging" {
20+
statement {
21+
sid = "s3-log-delivery"
22+
effect = "Allow"
23+
24+
principals {
25+
type = "Service"
26+
identifiers = ["logging.s3.amazonaws.com"]
27+
}
28+
29+
actions = ["s3:PutObject"]
30+
31+
resources = [
32+
"${aws_s3_bucket.logging.arn}/*",
33+
]
34+
}
35+
}

infrastructure/terraform/components/api/module_supplier_ssl.tf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module "supplier_ssl" {
22
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/ssl?ref=v2.0.17"
33

4-
count = var.manually_configure_mtls_truststore ? 0 : 1
5-
64
name = "sapi_trust"
75
aws_account_id = var.aws_account_id
86
default_tags = local.default_tags

infrastructure/terraform/components/api/s3_bucket_logging.tf

Lines changed: 0 additions & 90 deletions
This file was deleted.

infrastructure/terraform/components/api/s3_bucket_truststore.tf

Lines changed: 0 additions & 81 deletions
This file was deleted.

0 commit comments

Comments
 (0)