Skip to content

Commit 54a1fd5

Browse files
committed
(ELI-623) adding logging and auditng to lambda and api gateway
1 parent 083d5bb commit 54a1fd5

1 file changed

Lines changed: 2 additions & 18 deletions

File tree

infrastructure/stacks/api-layer/api_gateway.tf

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -56,24 +56,8 @@ resource "aws_api_gateway_stage" "eligibility-signposting-api" {
5656
# A subscription filter (see csoc_log_forwarding.tf) forwards these logs to CSOC
5757
access_log_settings {
5858
destination_arn = module.eligibility_signposting_api_gateway.cloudwatch_destination_arn
59-
format = <<EOF
60-
{
61-
"accountId": "$context.accountId",
62-
"apiId": "$context.apiId",
63-
"api_key": "$context.identity.apiKey",
64-
"caller": "$context.identity.caller",
65-
"httpMethod": "$context.httpMethod",
66-
"ip": "$context.identity.sourceIp",
67-
"protocol": "$context.protocol",
68-
"requestId": "$context.requestId",
69-
"requestTime": "$context.requestTime",
70-
"resourcePath": "$context.resourcePath",
71-
"responseLength": "$context.responseLength",
72-
"stage": "$context.stage",
73-
"status": "$context.status",
74-
"user": "$context.identity.user"
75-
}
76-
EOF
59+
format = "{ \"requestId\":\"$context.requestId\", \"ip\": \"$context.identity.sourceIp\", \"caller\":\"$context.identity.caller\", \"user\":\"$context.identity.user\", \"requestTime\":\"$context.requestTime\", \"httpMethod\":\"$context.httpMethod\", \"resourcePath\":\"$context.resourcePath\", \"status\":\"$context.status\", \"protocol\":\"$context.protocol\", \"responseLength\":\"$context.responseLength\", \"accountId\":\"$context.accountId\", \"apiId\":\"$context.apiId\", \"stage\":\"$context.stage\", \"api_key\":\"$context.identity.apiKey\" }"
60+
7761
}
7862

7963
depends_on = [

0 commit comments

Comments
 (0)