Skip to content

Commit f60ad97

Browse files
committed
CCM-12875: remove lambda from some of the resource names
1 parent 3119697 commit f60ad97

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

infrastructure/terraform/components/dl/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ No requirements.
4343
| <a name="module_lambda_apim_key_generation"></a> [lambda\_apim\_key\_generation](#module\_lambda\_apim\_key\_generation) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-lambda.zip | n/a |
4444
| <a name="module_lambda_lambda_apim_refresh_token"></a> [lambda\_lambda\_apim\_refresh\_token](#module\_lambda\_lambda\_apim\_refresh\_token) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-lambda.zip | n/a |
4545
| <a name="module_mesh_poll"></a> [mesh\_poll](#module\_mesh\_poll) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-lambda.zip | n/a |
46-
| <a name="module_pdm_mock_lambda"></a> [pdm\_mock\_lambda](#module\_pdm\_mock\_lambda) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-lambda.zip | n/a |
46+
| <a name="module_pdm_mock"></a> [pdm\_mock](#module\_pdm\_mock) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-lambda.zip | n/a |
4747
| <a name="module_s3bucket_cf_logs"></a> [s3bucket\_cf\_logs](#module\_s3bucket\_cf\_logs) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-s3bucket.zip | n/a |
4848
| <a name="module_s3bucket_letters"></a> [s3bucket\_letters](#module\_s3bucket\_letters) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-s3bucket.zip | n/a |
4949
| <a name="module_s3bucket_static_assets"></a> [s3bucket\_static\_assets](#module\_s3bucket\_static\_assets) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-s3bucket.zip | n/a |
@@ -58,8 +58,8 @@ No requirements.
5858
| Name | Description |
5959
|------|-------------|
6060
| <a name="output_deployment"></a> [deployment](#output\_deployment) | Deployment details used for post-deployment scripts |
61-
| <a name="output_pdm_mock_lambda_endpoint"></a> [pdm\_mock\_lambda\_endpoint](#output\_pdm\_mock\_lambda\_endpoint) | The base URL of the PDM Mock Lambda (null when not deployed) |
62-
| <a name="output_pdm_mock_lambda_id"></a> [pdm\_mock\_lambda\_id](#output\_pdm\_mock\_lambda\_id) | The ID of the PDM Mock Lambda API Gateway (null when not deployed) |
61+
| <a name="output_pdm_mock_endpoint"></a> [pdm\_mock\_endpoint](#output\_pdm\_mock\_endpoint) | The base URL of the PDM Mock (null when not deployed) |
62+
| <a name="output_pdm_mock_id"></a> [pdm\_mock\_id](#output\_pdm\_mock\_id) | The ID of the PDM Mock API Gateway (null when not deployed) |
6363
<!-- vale on -->
6464
<!-- markdownlint-enable -->
6565
<!-- END_TF_DOCS -->

infrastructure/terraform/components/dl/apigateway_pdm_mock.tf

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
resource "aws_api_gateway_rest_api" "pdm_mock" {
22
count = local.deploy_pdm_mock ? 1 : 0
33

4-
name = "${var.project}-${var.environment}-pdm-mock-lambda"
4+
name = "${var.project}-${var.environment}-pdm-mock"
55
description = "PDM Mock API for testing integration with Patient Data Manager"
66

77
endpoint_configuration {
88
types = ["REGIONAL"]
99
}
1010

1111
tags = {
12-
Name = "${var.project}-${var.environment}-pdm-mock-lambda"
12+
Name = "${var.project}-${var.environment}-pdm-mock"
1313
Project = var.project
1414
Environment = var.environment
1515
Component = local.component
@@ -74,7 +74,7 @@ resource "aws_api_gateway_integration" "create_document_reference" {
7474

7575
integration_http_method = "POST"
7676
type = "AWS_PROXY"
77-
uri = module.pdm_mock_lambda[0].function_invoke_arn
77+
uri = module.pdm_mock[0].function_invoke_arn
7878
}
7979

8080
resource "aws_api_gateway_method" "get_document_reference" {
@@ -95,15 +95,15 @@ resource "aws_api_gateway_integration" "get_document_reference" {
9595

9696
integration_http_method = "POST"
9797
type = "AWS_PROXY"
98-
uri = module.pdm_mock_lambda[0].function_invoke_arn
98+
uri = module.pdm_mock[0].function_invoke_arn
9999
}
100100

101-
resource "aws_lambda_permission" "pdm_mock_lambda_gateway" {
101+
resource "aws_lambda_permission" "pdm_mock_gateway" {
102102
count = local.deploy_pdm_mock ? 1 : 0
103103

104104
statement_id = "AllowAPIGatewayInvoke"
105105
action = "lambda:InvokeFunction"
106-
function_name = module.pdm_mock_lambda[0].function_name
106+
function_name = module.pdm_mock[0].function_name
107107
principal = "apigateway.amazonaws.com"
108108

109109
source_arn = "${aws_api_gateway_rest_api.pdm_mock[0].execution_arn}/*/*"
@@ -147,7 +147,7 @@ resource "aws_api_gateway_stage" "pdm_mock" {
147147
xray_tracing_enabled = true
148148

149149
access_log_settings {
150-
destination_arn = aws_cloudwatch_log_group.pdm_mock_lambda_gateway[0].arn
150+
destination_arn = aws_cloudwatch_log_group.pdm_mock_gateway[0].arn
151151
format = jsonencode({
152152
requestId = "$context.requestId"
153153
ip = "$context.identity.sourceIp"
@@ -163,34 +163,34 @@ resource "aws_api_gateway_stage" "pdm_mock" {
163163
}
164164

165165
tags = {
166-
Name = "${var.project}-${var.environment}-pdm-mock-lambda-stage"
166+
Name = "${var.project}-${var.environment}-pdm-mock-stage"
167167
Project = var.project
168168
Environment = var.environment
169169
Component = local.component
170170
}
171171
}
172172

173-
resource "aws_cloudwatch_log_group" "pdm_mock_lambda_gateway" {
173+
resource "aws_cloudwatch_log_group" "pdm_mock_gateway" {
174174
count = local.deploy_pdm_mock ? 1 : 0
175175

176-
name = "/aws/apigateway/${var.project}-${var.environment}-pdm-mock-lambda"
176+
name = "/aws/apigateway/${var.project}-${var.environment}-pdm-mock"
177177
retention_in_days = var.log_retention_in_days
178178
kms_key_id = module.kms.key_arn
179179

180180
tags = {
181-
Name = "${var.project}-${var.environment}-pdm-mock-lambda-logs"
181+
Name = "${var.project}-${var.environment}-pdm-mock-logs"
182182
Project = var.project
183183
Environment = var.environment
184184
Component = local.component
185185
}
186186
}
187187

188-
output "pdm_mock_lambda_endpoint" {
189-
description = "The base URL of the PDM Mock Lambda (null when not deployed)"
188+
output "pdm_mock_endpoint" {
189+
description = "The base URL of the PDM Mock (null when not deployed)"
190190
value = local.deploy_pdm_mock ? aws_api_gateway_stage.pdm_mock[0].invoke_url : null
191191
}
192192

193-
output "pdm_mock_lambda_id" {
194-
description = "The ID of the PDM Mock Lambda API Gateway (null when not deployed)"
193+
output "pdm_mock_id" {
194+
description = "The ID of the PDM Mock API Gateway (null when not deployed)"
195195
value = local.deploy_pdm_mock ? aws_api_gateway_rest_api.pdm_mock[0].id : null
196196
}

infrastructure/terraform/components/dl/module_lambda_pdm_mock_api.tf renamed to infrastructure/terraform/components/dl/module_lambda_pdm_mock.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
module "pdm_mock_lambda" {
1+
module "pdm_mock" {
22
count = local.deploy_pdm_mock ? 1 : 0
33
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-lambda.zip"
44

5-
function_name = "pdm-mock-lambda"
5+
function_name = "pdm-mock"
66
description = "A lambda function for mocking PDM (Patient Data Manager) API endpoints"
77

88
aws_account_id = var.aws_account_id
@@ -16,7 +16,7 @@ module "pdm_mock_lambda" {
1616
kms_key_arn = module.kms.key_arn
1717

1818
iam_policy_document = {
19-
body = data.aws_iam_policy_document.pdm_mock_lambda[0].json
19+
body = data.aws_iam_policy_document.pdm_mock[0].json
2020
}
2121

2222
function_s3_bucket = local.acct.s3_buckets["lambda_function_artefacts"]["id"]
@@ -43,7 +43,7 @@ module "pdm_mock_lambda" {
4343
}
4444
}
4545

46-
data "aws_iam_policy_document" "pdm_mock_lambda" {
46+
data "aws_iam_policy_document" "pdm_mock" {
4747
count = local.deploy_pdm_mock ? 1 : 0
4848

4949
statement {

lambdas/pdm-mock-lambda/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# PDM Mock Lambda
1+
# PDM Mock
22

33
This Lambda function provides a mock implementation of the PDM (Patient Data Manager) API for testing purposes. It allows the NHS Notify Digital Letters system to test integration with PDM without requiring access to the actual PDM service.
44

0 commit comments

Comments
 (0)