File tree Expand file tree Collapse file tree 2 files changed +27
-4
lines changed Expand file tree Collapse file tree 2 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ resource "aws_apigatewayv2_stage" "main" {
10
10
auto_deploy = true
11
11
12
12
access_log_settings {
13
- destination_arn = aws_cloudwatch_log_group. api_gateway_access_logs . arn
13
+ destination_arn = aws_cloudwatch_log_group. api_gateway_access_log . arn
14
14
format = " $context.identity.sourceIp - [$context.requestTime] \" $context.routeKey $context.protocol\" $context.status $context.responseLength $context.requestId"
15
15
}
16
16
Original file line number Diff line number Diff line change @@ -4,11 +4,34 @@ resource "aws_api_gateway_account" "main" {
4
4
}
5
5
6
6
# tfsec:ignore:aws-cloudwatch-log-group-customer-key
7
- resource "aws_cloudwatch_log_group" "api_gateway_access_logs " {
8
- name = " /aws/apigateway/SOAT-TC_API_Gateway_Access_Logs "
7
+ resource "aws_cloudwatch_log_group" "api_gateway_access_log " {
8
+ name = " /aws/apigateway/SOAT-TC_API_Gateway_Access_Log "
9
9
retention_in_days = 30
10
10
11
11
tags = {
12
- Name : " SOAT-TC API Gateway Default Stage Access Logs"
12
+ Name : " SOAT-TC API Gateway Default Stage Access Log Cloudwatch Log Group"
13
+ }
14
+ }
15
+
16
+ resource "aws_flow_log" "vpc" {
17
+ iam_role_arn = data. aws_iam_role . lab_role . arn
18
+ log_destination = aws_cloudwatch_log_group. vpc_flow_log . arn
19
+ traffic_type = " ALL"
20
+ vpc_id = aws_vpc. main . id
21
+
22
+ max_aggregation_interval = 60
23
+
24
+ tags = {
25
+ Name : " SOAT-TC VPC Flow Log"
26
+ }
27
+ }
28
+
29
+ # tfsec:ignore:aws-cloudwatch-log-group-customer-key
30
+ resource "aws_cloudwatch_log_group" "vpc_flow_log" {
31
+ name = " /aws/apigateway/SOAT-TC_VPC_Flow_Logs"
32
+ retention_in_days = 30
33
+
34
+ tags = {
35
+ Name : " SOAT-TC VPC Flow Log Cloudwatch Log Group"
13
36
}
14
37
}
You can’t perform that action at this time.
0 commit comments