Skip to content

Commit 5cadd05

Browse files
Enable APIG logging and include dependencies in build
1 parent 653dcdc commit 5cadd05

File tree

4 files changed

+419
-0
lines changed

4 files changed

+419
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
resource "aws_api_gateway_method_settings" "main" {
2+
rest_api_id = aws_api_gateway_rest_api.main.id
3+
stage_name = aws_api_gateway_stage.main.stage_name
4+
method_path = "*/*"
5+
6+
settings {
7+
metrics_enabled = true
8+
logging_level = "INFO"
9+
data_trace_enabled = true
10+
}
11+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
resource "aws_cloudwatch_log_group" "api_gateway_execution" {
2+
name = format("API-Gateway-Execution-Logs_%s/%s",
3+
aws_api_gateway_rest_api.main.id,
4+
var.environment,
5+
)
6+
retention_in_days = var.log_retention_in_days
7+
}

0 commit comments

Comments
 (0)