Skip to content

Commit 515ef6f

Browse files
Log format (#4)
* Add custom log format * Add custom log format * update docs
1 parent 1f430fe commit 515ef6f

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ repos:
1818
args: ['--allow-missing-credentials']
1919
- id: trailing-whitespace
2020
- repo: https://github.com/antonbabenko/pre-commit-terraform
21-
rev: v1.96.2
21+
rev: v1.99.5
2222
hooks:
2323
- id: terraform_fmt
2424
- id: terraform_docs

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ No modules.
5959
|------|-------------|------|---------|:--------:|
6060
| <a name="input_cloudwatch_log_group_name"></a> [cloudwatch\_log\_group\_name](#input\_cloudwatch\_log\_group\_name) | Custom name used for cloudwatch log group | `string` | `null` | no |
6161
| <a name="input_kms_key_id"></a> [kms\_key\_id](#input\_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` | `null` | no |
62+
| <a name="input_log_format"></a> [log\_format](#input\_log\_format) | Custom format for flow log records | `string` | `null` | no |
6263
| <a name="input_max_aggregation_interval"></a> [max\_aggregation\_interval](#input\_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 |
6364
| <a name="input_name_prefix"></a> [name\_prefix](#input\_name\_prefix) | A prefix used for naming resources. | `string` | n/a | yes |
6465
| <a name="input_retention_in_days"></a> [retention\_in\_days](#input\_retention\_in\_days) | Specifies the number of days you want to retain log events in the specified log group. | `string` | `null` | no |

examples/core/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module "flow-logs" {
2222
traffic_type = "ALL"
2323
# retention_in_days = 30
2424
# max_aggregation_interval = 60
25+
# log_format = "$${interface-id} $${account-id} $${srcaddr} $${dstaddr} $${srcport} $${dstport} $${action} $${log-status}"
2526

2627
tags = {
2728
Environment = "test"

main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,7 @@ resource "aws_flow_log" "flow_logs" {
4848

4949
max_aggregation_interval = var.max_aggregation_interval
5050

51+
log_format = var.log_format
52+
5153
tags = var.tags
5254
}

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,9 @@ variable "cloudwatch_log_group_name" {
6262
type = string
6363
default = null
6464
}
65+
66+
variable "log_format" {
67+
description = "Custom format for flow log records"
68+
type = string
69+
default = null
70+
}

0 commit comments

Comments
 (0)