Skip to content

Commit

Permalink
Add support for max_aggregation_interval (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcincuber authored Apr 2, 2020
1 parent 0290434 commit c70e470
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 10 deletions.
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ Terraform module for enabling AWS VPC flow logs with CloudWatch sink.

## Terraform versions

Terraform 0.12. Pin module version to `~> v1.0`. Submit pull-requests to `master` branch.
Terraform 0.12. Pin module version to `~> v1.1.0`. Submit pull-requests to `master` branch.

## Usage

```hcl
module "vpc-flow-logs" {
source = "umotif-public/vpc-flow-logs/aws"
version = "~> 1.0"
version = "~> 1.1.0"
name_prefix = "test-example"
vpc_id = "vpc-1sadasdasd123"
Expand All @@ -37,16 +37,23 @@ Module is to be used with Terraform > 0.12.
Module managed by [Marcin Cuber](https://github.com/marcincuber) [LinkedIn](https://www.linkedin.com/in/marcincuber/).

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Providers

| Name | Version |
|------|---------|
| aws | ~> 2.55 |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| kms\_key\_id | The ARN of the KMS Key to use when encrypting log data. Please note, after the AWS KMS CMK is disassociated from the log group, AWS CloudWatch Logs stops encrypting newly ingested data for the log group. All previously ingested data remains encrypted, and AWS CloudWatch Logs requires permissions for the CMK whenever the encrypted data is requested. | string | `""` | no |
| name\_prefix | A prefix used for naming resources. | string | n/a | yes |
| retention\_in\_days | Specifies the number of days you want to retain log events in the specified log group. | string | `""` | no |
| tags | Default tags attached to all resources. | map(string) | `{}` | no |
| traffic\_type | The type of traffic to capture. Valid values: ACCEPT, REJECT, ALL. | string | `"ALL"` | no |
| vpc\_id | VPC ID where resources will be created and flow logs enabled. | string | n/a | yes |
|------|-------------|------|---------|:-----:|
| kms\_key\_id | The ARN of the KMS Key to use when encrypting log data. Please note, after the AWS KMS CMK is disassociated from the log group, AWS CloudWatch Logs stops encrypting newly ingested data for the log group. All previously ingested data remains encrypted, and AWS CloudWatch Logs requires permissions for the CMK whenever the encrypted data is requested. | `string` | `""` | no |
| 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 (1 minute) or 600 seconds (10 minutes) | `string` | `"600"` | no |
| name\_prefix | A prefix used for naming resources. | `string` | n/a | yes |
| retention\_in\_days | Specifies the number of days you want to retain log events in the specified log group. | `string` | `""` | no |
| tags | Default tags attached to all resources. | `map(string)` | `{}` | no |
| traffic\_type | The type of traffic to capture. Valid values: ACCEPT, REJECT, ALL. | `string` | `"ALL"` | no |
| vpc\_id | VPC ID where resources will be created and flow logs enabled. | `string` | n/a | yes |

## Outputs

Expand Down
1 change: 1 addition & 0 deletions examples/core/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ module "flow-logs" {

traffic_type = "ALL"
# retention_in_days = 30
# max_aggregation_interval = 60

tags = {
Environment = "test"
Expand Down
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ resource "aws_flow_log" "vpc_flow_logs" {
vpc_id = var.vpc_id
traffic_type = var.traffic_type

max_aggregation_interval = var.max_aggregation_interval

tags = var.tags
}

Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ variable "traffic_type" {
description = "The type of traffic to capture. Valid values: ACCEPT, REJECT, ALL."
default = "ALL"
}

variable "max_aggregation_interval" {
type = string
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 (1 minute) or 600 seconds (10 minutes)"
default = "600"
}
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_providers {
aws = "~> 2.53"
aws = "~> 2.55"
}
}

0 comments on commit c70e470

Please sign in to comment.