Skip to content

Commit f50f42a

Browse files
committed
feat: Support pattern /aws/vendedlogs for API GATEWAY logs groups
1 parent c486681 commit f50f42a

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

aws/logs_monitoring/parsing.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,14 @@ def find_cloudwatch_source(log_group):
280280
"api-gateway", # e.g. Api-Gateway-Execution-Logs_xxxxxx/dev
281281
# default location set by serverless framework for rest api access logs
282282
"/aws/api-gateway", # e.g. /aws/api-gateway/my-project
283+
# Avoid touching the size limit of the log group resource policy
284+
# https://docs.aws.amazon.com/fr_fr/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html#AWS-logs-infrastructure-CWL
285+
"/aws/vendedlogs/api-gateway",
283286
# default location set by serverless framework for http api logs
284287
"/aws/http-api", # e.g. /aws/http-api/my-project
288+
# Avoid touching the size limit of the log group resource policy
289+
# https://docs.aws.amazon.com/fr_fr/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html#AWS-logs-infrastructure-CWL
290+
"/aws/vendedlogs/http-api",
285291
)
286292
):
287293
return "apigateway"

aws/logs_monitoring/tests/test_parsing.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,16 @@ def test_apigateway_event(self):
122122
parse_event_source({"awslogs": "logs"}, "/aws/http-api/my-project"),
123123
"apigateway",
124124
)
125+
self.assertEqual(
126+
parse_event_source({"awslogs": "logs"},
127+
"/aws/vendedlogs/http-api/my-project"),
128+
"apigateway",
129+
)
130+
self.assertEqual(
131+
parse_event_source({"awslogs": "logs"},
132+
"/aws/vendedlogs/http-api/my-project"),
133+
"apigateway",
134+
)
125135

126136
def test_dms_event(self):
127137
self.assertEqual(

0 commit comments

Comments
 (0)