Skip to content

Commit f31a572

Browse files
committed
CCM-11600: header name, targets, add alarm
1 parent 95631c8 commit f31a572

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
resource "aws_cloudwatch_metric_alarm" "alm-apim-client-certificate-near-expiry" {
2+
alarm_name = "${local.csi}-alm-apim-client-certificate-near-expiry"
3+
alarm_description = "RELIABILITY: An APIM client certificate is due to expire soon"
4+
5+
metric_name = "apim-client-certificate-near-expiry"
6+
namespace = "comms-apim-authorizer"
7+
8+
dimensions = {
9+
Environment = local.parameter_bundle.environment
10+
}
11+
12+
period = 60 * 60 * 4 //4 hours
13+
comparison_operator = "GreaterThanThreshold"
14+
threshold = "0"
15+
evaluation_periods = "1"
16+
statistic = "Sum"
17+
treat_missing_data = "notBreaching"
18+
19+
actions_enabled = "false"
20+
alarm_actions = []
21+
ok_actions = []
22+
}

infrastructure/terraform/components/api/module_authorizer_lambda.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module "authorizer_lambda" {
3838
lambda_env_vars = {
3939
CLOUDWATCH_NAMESPACE = "/aws/api-gateway/supplier/alarms",
4040
CLIENT_CERTIFICATE_EXPIRATION_ALERT_DAYS = 14,
41-
APIM_APPLICATION_ID_HEADER = "apim-application-id",
41+
APIM_APPLICATION_ID_HEADER = "NHSD-Supplier-ID",
4242
SUPPLIERS_TABLE_NAME = aws_dynamodb_table.suppliers.name
4343
}
4444
}

infrastructure/terraform/components/api/resources/spec.tmpl.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"authorizerCredentials": "${APIG_EXECUTION_ROLE_ARN}",
1010
"authorizerResultTtlInSeconds": 0,
1111
"authorizerUri": "arn:aws:apigateway:${AWS_REGION}:lambda:path/2015-03-31/functions/${AUTHORIZER_LAMBDA_ARN}/invocations",
12-
"identitySource": "method.request.header.apim-application-id",
12+
"identitySource": "method.request.header.NHSD-Supplier-ID",
1313
"type": "request"
1414
},
1515
"x-amazon-apigateway-authtype": "custom"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
- name: NHSD-Supplier-ID
22
header: NHSD-Supplier-ID
3-
required: false
3+
required: true

0 commit comments

Comments
 (0)