Skip to content

Commit 511fbef

Browse files
authored
Merge branch 'main' into feature/CCM-13428-trigger-proxy-deploy
2 parents b2e5269 + b3ab7b5 commit 511fbef

15 files changed

+73
-30
lines changed

.github/workflows/stage-1-commit.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,16 @@ jobs:
152152
timeout-minutes: 10
153153
needs: detect-terraform-changes
154154
if: needs.detect-terraform-changes.outputs.terraform_changed == 'true'
155+
env:
156+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
155157
steps:
156158
- name: "Checkout code"
157159
uses: actions/checkout@v5
160+
- name: Setup NodeJS
161+
uses: actions/setup-node@v4
162+
with:
163+
node-version: ${{ inputs.nodejs_version }}
164+
registry-url: 'https://npm.pkg.github.com'
158165
- name: "Setup ASDF"
159166
uses: asdf-vm/actions/setup@v4
160167
- name: "Perform Setup"
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
resource "aws_lambda_event_source_mapping" "letter_updates_transformer_kinesis" {
2-
event_source_arn = aws_kinesis_stream.letter_change_stream.arn
3-
function_name = module.letter_updates_transformer.function_arn
4-
starting_position = "LATEST"
5-
batch_size = 10
6-
maximum_batching_window_in_seconds = 1
2+
event_source_arn = aws_kinesis_stream.letter_change_stream.arn
3+
function_name = module.letter_updates_transformer.function_arn
4+
starting_position = "LATEST"
5+
batch_size = 10
6+
maximum_batching_window_in_seconds = 1
77

88
depends_on = [
9-
module.letter_updates_transformer # ensures updates transformer exists
9+
module.letter_updates_transformer # ensures updates transformer exists
1010
]
1111
}

infrastructure/terraform/components/api/locals.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,7 @@ locals {
2828
APIM_CORRELATION_HEADER = "nhsd-correlation-id",
2929
DOWNLOAD_URL_TTL_SECONDS = 60
3030
}
31+
32+
core_pdf_bucket_arn = "arn:aws:s3:::comms-${var.core_account_id}-eu-west-2-${var.core_environment}-api-stg-pdf-pipeline"
33+
core_s3_kms_key_alias_name = "alias/comms-${var.core_environment}-api-s3"
3134
}

infrastructure/terraform/components/api/module_authorizer_lambda.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module "authorizer_lambda" {
2-
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.26/terraform-lambda.zip"
2+
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.29/terraform-lambda.zip"
33

44
aws_account_id = var.aws_account_id
55
component = var.component
@@ -31,7 +31,6 @@ module "authorizer_lambda" {
3131
enable_lambda_insights = false
3232
force_lambda_code_deploy = var.force_lambda_code_deploy
3333

34-
send_to_firehose = true
3534
log_destination_arn = local.destination_arn
3635
log_subscription_role_arn = local.acct.log_subscription_role_arn
3736

infrastructure/terraform/components/api/module_lambda_get_letter.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module "get_letter" {
2-
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.26/terraform-lambda.zip"
2+
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.29/terraform-lambda.zip"
33

44
function_name = "get_letter"
55
description = "Get letter status"
@@ -31,7 +31,6 @@ module "get_letter" {
3131
force_lambda_code_deploy = var.force_lambda_code_deploy
3232
enable_lambda_insights = false
3333

34-
send_to_firehose = true
3534
log_destination_arn = local.destination_arn
3635
log_subscription_role_arn = local.acct.log_subscription_role_arn
3736

infrastructure/terraform/components/api/module_lambda_get_letter_data.tf

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module "get_letter_data" {
2-
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.26/terraform-lambda.zip"
2+
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.29/terraform-lambda.zip"
33

44
function_name = "get_letter_data"
55
description = "Get the letter data"
@@ -31,7 +31,6 @@ module "get_letter_data" {
3131
force_lambda_code_deploy = var.force_lambda_code_deploy
3232
enable_lambda_insights = false
3333

34-
send_to_firehose = true
3534
log_destination_arn = local.destination_arn
3635
log_subscription_role_arn = local.acct.log_subscription_role_arn
3736

@@ -68,11 +67,43 @@ data "aws_iam_policy_document" "get_letter_data_lambda" {
6867
]
6968
}
7069

70+
statement {
71+
sid = "S3ListBucketForPresign"
72+
actions = [
73+
"s3:ListBucket"
74+
]
75+
resources = [
76+
module.s3bucket_test_letters.arn,
77+
local.core_pdf_bucket_arn
78+
]
79+
}
80+
7181
statement {
7282
sid = "S3GetObjectForPresign"
7383
actions = [
7484
"s3:GetObject",
75-
"s3:ListBucket"] # allows 404 response instead of 403 if object missing
76-
resources = ["${module.s3bucket_test_letters.arn}/*"]
85+
"s3:PutObject",
86+
] # allows 404 response instead of 403 if object missing
87+
resources = [
88+
"${module.s3bucket_test_letters.arn}/*",
89+
"${local.core_pdf_bucket_arn}/*",
90+
]
91+
}
92+
93+
statement {
94+
sid = "KMSForCoreS3Access"
95+
actions = [
96+
"kms:Decrypt",
97+
"kms:GenerateDataKey",
98+
"kms:DescribeKey"
99+
]
100+
resources = [
101+
"arn:aws:kms:${var.region}:${var.core_account_id}:key/*"
102+
]
103+
condition {
104+
test = "ForAnyValue:StringEquals"
105+
variable = "kms:ResourceAliases"
106+
values = [local.core_s3_kms_key_alias_name]
107+
}
77108
}
78109
}

infrastructure/terraform/components/api/module_lambda_get_letters.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module "get_letters" {
2-
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.26/terraform-lambda.zip"
2+
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.29/terraform-lambda.zip"
33

44
function_name = "get_letters"
55
description = "Get paginated letter ids"
@@ -31,7 +31,6 @@ module "get_letters" {
3131
force_lambda_code_deploy = var.force_lambda_code_deploy
3232
enable_lambda_insights = false
3333

34-
send_to_firehose = true
3534
log_destination_arn = local.destination_arn
3635
log_subscription_role_arn = local.acct.log_subscription_role_arn
3736

infrastructure/terraform/components/api/module_lambda_get_status.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module "get_status" {
2-
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-lambda.zip"
2+
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.29/terraform-lambda.zip"
33

44
function_name = "get_status"
55
description = "Healthcheck for service"
@@ -31,7 +31,6 @@ module "get_status" {
3131
force_lambda_code_deploy = var.force_lambda_code_deploy
3232
enable_lambda_insights = false
3333

34-
send_to_firehose = true
3534
log_destination_arn = local.destination_arn
3635
log_subscription_role_arn = local.acct.log_subscription_role_arn
3736

infrastructure/terraform/components/api/module_lambda_letter_status_update.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module "letter_status_update" {
2-
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-lambda.zip"
2+
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.29/terraform-lambda.zip"
33

44
function_name = "letter_status_update"
55
description = "Processes letter status updates"
@@ -31,7 +31,6 @@ module "letter_status_update" {
3131
force_lambda_code_deploy = var.force_lambda_code_deploy
3232
enable_lambda_insights = false
3333

34-
send_to_firehose = true
3534
log_destination_arn = local.destination_arn
3635
log_subscription_role_arn = local.acct.log_subscription_role_arn
3736

infrastructure/terraform/components/api/module_lambda_letter_updates_transformer.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module "letter_updates_transformer" {
2-
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.26/terraform-lambda.zip"
2+
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.29/terraform-lambda.zip"
33

44
function_name = "letter-updates-transformer"
55
description = "Letter Update Filter/Producer"
@@ -31,7 +31,6 @@ module "letter_updates_transformer" {
3131
force_lambda_code_deploy = var.force_lambda_code_deploy
3232
enable_lambda_insights = false
3333

34-
send_to_firehose = true
3534
log_destination_arn = local.destination_arn
3635
log_subscription_role_arn = local.acct.log_subscription_role_arn
3736

0 commit comments

Comments
 (0)