Skip to content

Commit 36832ff

Browse files
authored
feat: Add support for VPC flow log max_aggregation_interval (#431)
1 parent fd98462 commit 36832ff

File tree

5 files changed

+19
-9
lines changed

5 files changed

+19
-9
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,14 @@ It is possible to integrate this VPC module with [terraform-aws-transit-gateway
224224

225225
| Name | Version |
226226
|------|---------|
227-
| terraform | ~> 0.12.6 |
228-
| aws | ~> 2.53 |
227+
| terraform | >= 0.12.6, < 0.14 |
228+
| aws | ~> 2.57 |
229229

230230
## Providers
231231

232232
| Name | Version |
233233
|------|---------|
234-
| aws | ~> 2.53 |
234+
| aws | ~> 2.57 |
235235

236236
## Inputs
237237

@@ -460,6 +460,7 @@ It is possible to integrate this VPC module with [terraform-aws-transit-gateway
460460
| flow\_log\_destination\_arn | The ARN of the CloudWatch log group or S3 bucket where VPC Flow Logs will be pushed. If this ARN is a S3 bucket the appropriate permissions need to be set on that bucket's policy. When create\_flow\_log\_cloudwatch\_log\_group is set to false this argument must be provided. | `string` | `""` | no |
461461
| flow\_log\_destination\_type | Type of flow log destination. Can be s3 or cloud-watch-logs. | `string` | `"cloud-watch-logs"` | no |
462462
| flow\_log\_log\_format | The fields to include in the flow log record, in the order in which they should appear. | `string` | `null` | no |
463+
| flow\_log\_max\_aggregation\_interval | The maximum interval of time during which a flow of packets is captured and aggregated into a flow log record. Valid Values: `60` seconds or `600` seconds. | `number` | `600` | no |
463464
| flow\_log\_traffic\_type | The type of traffic to capture. Valid values: ACCEPT, REJECT, ALL. | `string` | `"ALL"` | no |
464465
| git\_codecommit\_endpoint\_private\_dns\_enabled | Whether or not to associate a private hosted zone with the specified VPC for Git Codecommit endpoint | `bool` | `false` | no |
465466
| git\_codecommit\_endpoint\_security\_group\_ids | The ID of one or more security groups to associate with the network interface for Git Codecommit endpoint | `list` | `[]` | no |

examples/complete-vpc/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ module "vpc" {
110110
enable_flow_log = true
111111
create_flow_log_cloudwatch_log_group = true
112112
create_flow_log_cloudwatch_iam_role = true
113+
flow_log_max_aggregation_interval = 60
113114

114115
tags = {
115116
Owner = "user"

examples/vpc-flow-logs/cloud-watch-logs.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module "vpc_with_flow_logs_cloudwatch_logs_default" {
1515
enable_flow_log = true
1616
create_flow_log_cloudwatch_log_group = true
1717
create_flow_log_cloudwatch_iam_role = true
18+
flow_log_max_aggregation_interval = 60
1819

1920
vpc_flow_log_tags = {
2021
Name = "vpc-flow-logs-cloudwatch-logs-default"

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2318,3 +2318,9 @@ variable "flow_log_cloudwatch_log_group_kms_key_id" {
23182318
type = string
23192319
default = null
23202320
}
2321+
2322+
variable "flow_log_max_aggregation_interval" {
2323+
description = "The maximum interval of time during which a flow of packets is captured and aggregated into a flow log record. Valid Values: `60` seconds or `600` seconds."
2324+
type = number
2325+
default = 600
2326+
}

vpc-flow-logs.tf

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ locals {
1515
resource "aws_flow_log" "this" {
1616
count = local.enable_flow_log ? 1 : 0
1717

18-
log_destination_type = var.flow_log_destination_type
19-
log_destination = local.flow_log_destination_arn
20-
log_format = var.flow_log_log_format
21-
iam_role_arn = local.flow_log_iam_role_arn
22-
traffic_type = var.flow_log_traffic_type
23-
vpc_id = local.vpc_id
18+
log_destination_type = var.flow_log_destination_type
19+
log_destination = local.flow_log_destination_arn
20+
log_format = var.flow_log_log_format
21+
iam_role_arn = local.flow_log_iam_role_arn
22+
traffic_type = var.flow_log_traffic_type
23+
vpc_id = local.vpc_id
24+
max_aggregation_interval = var.flow_log_max_aggregation_interval
2425

2526
tags = merge(var.tags, var.vpc_flow_log_tags)
2627
}

0 commit comments

Comments
 (0)