Skip to content

Commit 2423e4f

Browse files
authored
feat: Added support for VPC Flow Logs in Parquet format (terraform-aws-modules#700)
1 parent 96d22b8 commit 2423e4f

File tree

28 files changed

+150
-50
lines changed

28 files changed

+150
-50
lines changed

.github/contributing.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Contributing
2+
3+
When contributing to this repository, please first discuss the change you wish to make via issue,
4+
email, or any other method with the owners of this repository before making a change.
5+
6+
Please note we have a code of conduct, please follow it in all your interactions with the project.
7+
8+
## Pull Request Process
9+
10+
1. Update the README.md with details of changes including example hcl blocks and [example files](./examples) if appropriate.
11+
2. Run pre-commit hooks `pre-commit run -a`.
12+
3. Once all outstanding comments and checklist items have been addressed, your contribution will be merged! Merged PRs will be included in the next release. The terraform-aws-vpc maintainers take care of updating the CHANGELOG as they merge.
13+
14+
## Checklists for contributions
15+
16+
- [ ] Add [semantics prefix](#semantic-pull-requests) to your PR or Commits (at least one of your commit groups)
17+
- [ ] CI tests are passing
18+
- [ ] README.md has been updated after any changes to variables and outputs. See https://github.com/terraform-aws-modules/terraform-aws-vpc/#doc-generation
19+
- [ ] Run pre-commit hooks `pre-commit run -a`
20+
21+
## Semantic Pull Requests
22+
23+
To generate changelog, Pull Requests or Commits must have semantic and must follow conventional specs below:
24+
25+
- `feat:` for new features
26+
- `fix:` for bug fixes
27+
- `improvement:` for enhancements
28+
- `docs:` for documentation and examples
29+
- `refactor:` for code refactoring
30+
- `test:` for tests
31+
- `ci:` for CI purpose
32+
- `chore:` for chores stuff
33+
34+
The `chore` prefix skipped during changelog generation. It can be used for `chore: update changelog` commit message by example.

README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,14 @@ You can add additional tags with `intra_subnet_tags` as with other subnet types.
120120

121121
VPC Flow Log allows to capture IP traffic for a specific network interface (ENI), subnet, or entire VPC. This module supports enabling or disabling VPC Flow Logs for entire VPC. If you need to have VPC Flow Logs for subnet or ENI, you have to manage it outside of this module with [aws_flow_log resource](https://www.terraform.io/docs/providers/aws/r/flow_log.html).
122122

123+
### VPC Flow Log Examples
124+
125+
By default `file_format` is `plain-text`. You can also specify `parquet` to have logs written in Apache Parquet format.
126+
127+
```
128+
flow_log_file_format = "parquet"
129+
```
130+
123131
### Permissions Boundary
124132

125133
If your organization requires a permissions boundary to be attached to the VPC Flow Log role, make sure that you specify an ARN of the permissions boundary policy as `vpc_flow_log_permissions_boundary` argument. Read more about required [IAM policy for publishing flow logs](https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs-cwl.html#flow-logs-iam).
@@ -183,19 +191,25 @@ It is possible to integrate this VPC module with [terraform-aws-transit-gateway
183191
- [Manage Default VPC](https://github.com/terraform-aws-modules/terraform-aws-vpc/tree/master/examples/manage-default-vpc)
184192
- [Few tests and edge case examples](https://github.com/terraform-aws-modules/terraform-aws-vpc/tree/master/examples/issues)
185193

194+
## Contributing
195+
196+
Report issues/questions/feature requests on in the [issues](https://github.com/terraform-aws-modules/terraform-aws-vpc/issues/new) section.
197+
198+
Full contributing [guidelines are covered here](.github/contributing.md).
199+
186200
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
187201
## Requirements
188202

189203
| Name | Version |
190204
|------|---------|
191-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
192-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.38 |
205+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
206+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.63 |
193207

194208
## Providers
195209

196210
| Name | Version |
197211
|------|---------|
198-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.38 |
212+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.63 |
199213

200214
## Modules
201215

@@ -370,8 +384,11 @@ No modules.
370384
| <a name="input_flow_log_cloudwatch_log_group_retention_in_days"></a> [flow\_log\_cloudwatch\_log\_group\_retention\_in\_days](#input\_flow\_log\_cloudwatch\_log\_group\_retention\_in\_days) | Specifies the number of days you want to retain log events in the specified log group for VPC flow logs. | `number` | `null` | no |
371385
| <a name="input_flow_log_destination_arn"></a> [flow\_log\_destination\_arn](#input\_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 |
372386
| <a name="input_flow_log_destination_type"></a> [flow\_log\_destination\_type](#input\_flow\_log\_destination\_type) | Type of flow log destination. Can be s3 or cloud-watch-logs. | `string` | `"cloud-watch-logs"` | no |
387+
| <a name="input_flow_log_file_format"></a> [flow\_log\_file\_format](#input\_flow\_log\_file\_format) | (Optional) The format for the flow log. Valid values: `plain-text`, `parquet`. | `string` | `"plain-text"` | no |
388+
| <a name="input_flow_log_hive_compatible_partitions"></a> [flow\_log\_hive\_compatible\_partitions](#input\_flow\_log\_hive\_compatible\_partitions) | (Optional) Indicates whether to use Hive-compatible prefixes for flow logs stored in Amazon S3. | `bool` | `false` | no |
373389
| <a name="input_flow_log_log_format"></a> [flow\_log\_log\_format](#input\_flow\_log\_log\_format) | The fields to include in the flow log record, in the order in which they should appear. | `string` | `null` | no |
374390
| <a name="input_flow_log_max_aggregation_interval"></a> [flow\_log\_max\_aggregation\_interval](#input\_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 |
391+
| <a name="input_flow_log_per_hour_partition"></a> [flow\_log\_per\_hour\_partition](#input\_flow\_log\_per\_hour\_partition) | (Optional) Indicates whether to partition the flow log per hour. This reduces the cost and response time for queries. | `bool` | `false` | no |
375392
| <a name="input_flow_log_traffic_type"></a> [flow\_log\_traffic\_type](#input\_flow\_log\_traffic\_type) | The type of traffic to capture. Valid values: ACCEPT, REJECT, ALL. | `string` | `"ALL"` | no |
376393
| <a name="input_igw_tags"></a> [igw\_tags](#input\_igw\_tags) | Additional tags for the internet gateway | `map(string)` | `{}` | no |
377394
| <a name="input_instance_tenancy"></a> [instance\_tenancy](#input\_instance\_tenancy) | A tenancy option for instances launched into the VPC | `string` | `"default"` | no |

examples/complete-vpc/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ Note that this example may create resources which can cost money (AWS Elastic IP
2121

2222
| Name | Version |
2323
|------|---------|
24-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
25-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.28 |
24+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
25+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.63 |
2626

2727
## Providers
2828

2929
| Name | Version |
3030
|------|---------|
31-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.28 |
31+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.63 |
3232

3333
## Modules
3434

examples/complete-vpc/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
terraform {
2-
required_version = ">= 0.12.31"
2+
required_version = ">= 0.13.1"
33

44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 3.28"
7+
version = ">= 3.63"
88
}
99
}
1010
}

examples/ipv6/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ Note that this example may create resources which can cost money (AWS Elastic IP
1919

2020
| Name | Version |
2121
|------|---------|
22-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
23-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.28 |
22+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
23+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.63 |
2424

2525
## Providers
2626

examples/ipv6/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
terraform {
2-
required_version = ">= 0.12.31"
2+
required_version = ">= 0.13.1"
33

44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 3.28"
7+
version = ">= 3.63"
88
}
99
}
1010
}

examples/issues/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ Note that this example may create resources which can cost money (AWS Elastic IP
2424

2525
| Name | Version |
2626
|------|---------|
27-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
28-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.28 |
27+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
28+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.63 |
2929

3030
## Providers
3131

examples/issues/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
terraform {
2-
required_version = ">= 0.12.31"
2+
required_version = ">= 0.13.1"
33

44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 3.28"
7+
version = ">= 3.63"
88
}
99
}
1010
}

examples/manage-default-vpc/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ Run `terraform destroy` when you don't need these resources.
2121

2222
| Name | Version |
2323
|------|---------|
24-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
25-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.28 |
24+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
25+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.63 |
2626

2727
## Providers
2828

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
terraform {
2-
required_version = ">= 0.12.31"
2+
required_version = ">= 0.13.1"
33

44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 3.28"
7+
version = ">= 3.63"
88
}
99
}
1010
}

examples/network-acls/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ Note that this example may create resources which can cost money (AWS Elastic IP
2323

2424
| Name | Version |
2525
|------|---------|
26-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
27-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.28 |
26+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
27+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.63 |
2828

2929
## Providers
3030

examples/network-acls/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
terraform {
2-
required_version = ">= 0.12.31"
2+
required_version = ">= 0.13.1"
33

44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 3.28"
7+
version = ">= 3.63"
88
}
99
}
1010
}

examples/outpost/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ Note that this example may create resources which can cost money (AWS Elastic IP
2323

2424
| Name | Version |
2525
|------|---------|
26-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
27-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.28 |
26+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
27+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.63 |
2828

2929
## Providers
3030

3131
| Name | Version |
3232
|------|---------|
33-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.28 |
33+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.63 |
3434

3535
## Modules
3636

examples/outpost/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
terraform {
2-
required_version = ">= 0.12.31"
2+
required_version = ">= 0.13.1"
33

44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 3.28"
7+
version = ">= 3.63"
88
}
99
}
1010
}

examples/secondary-cidr-blocks/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ Note that this example may create resources which can cost money (AWS Elastic IP
2121

2222
| Name | Version |
2323
|------|---------|
24-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
25-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.28 |
24+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
25+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.63 |
2626

2727
## Providers
2828

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
terraform {
2-
required_version = ">= 0.12.31"
2+
required_version = ">= 0.13.1"
33

44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 3.28"
7+
version = ">= 3.63"
88
}
99
}
1010
}

examples/simple-vpc/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ Note that this example may create resources which can cost money (AWS Elastic IP
2525

2626
| Name | Version |
2727
|------|---------|
28-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
29-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.28 |
28+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
29+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.63 |
3030

3131
## Providers
3232

examples/simple-vpc/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
terraform {
2-
required_version = ">= 0.12.31"
2+
required_version = ">= 0.13.1"
33

44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 3.28"
7+
version = ">= 3.63"
88
}
99
}
1010
}

examples/vpc-flow-logs/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ Note that this example may create resources which can cost money (AWS Elastic IP
2323

2424
| Name | Version |
2525
|------|---------|
26-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
27-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.28 |
26+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
27+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.63 |
2828
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2 |
2929

3030
## Providers
3131

3232
| Name | Version |
3333
|------|---------|
34-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.28 |
34+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.63 |
3535
| <a name="provider_random"></a> [random](#provider\_random) | >= 2 |
3636

3737
## Modules
@@ -42,6 +42,7 @@ Note that this example may create resources which can cost money (AWS Elastic IP
4242
| <a name="module_vpc_with_flow_logs_cloudwatch_logs"></a> [vpc\_with\_flow\_logs\_cloudwatch\_logs](#module\_vpc\_with\_flow\_logs\_cloudwatch\_logs) | ../../ | |
4343
| <a name="module_vpc_with_flow_logs_cloudwatch_logs_default"></a> [vpc\_with\_flow\_logs\_cloudwatch\_logs\_default](#module\_vpc\_with\_flow\_logs\_cloudwatch\_logs\_default) | ../../ | |
4444
| <a name="module_vpc_with_flow_logs_s3_bucket"></a> [vpc\_with\_flow\_logs\_s3\_bucket](#module\_vpc\_with\_flow\_logs\_s3\_bucket) | ../../ | |
45+
| <a name="module_vpc_with_flow_logs_s3_bucket_parquet"></a> [vpc\_with\_flow\_logs\_s3\_bucket\_parquet](#module\_vpc\_with\_flow\_logs\_s3\_bucket\_parquet) | ../../ | |
4546

4647
## Resources
4748

examples/vpc-flow-logs/main.tf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,25 @@ module "vpc_with_flow_logs_s3_bucket" {
3131
}
3232
}
3333

34+
module "vpc_with_flow_logs_s3_bucket_parquet" {
35+
source = "../../"
36+
37+
name = "vpc-flow-logs-s3-bucket"
38+
cidr = "10.30.0.0/16"
39+
40+
azs = ["${local.region}a"]
41+
public_subnets = ["10.30.101.0/24"]
42+
43+
enable_flow_log = true
44+
flow_log_destination_type = "s3"
45+
flow_log_destination_arn = module.s3_bucket.this_s3_bucket_arn
46+
flow_log_file_format = "parquet"
47+
48+
vpc_flow_log_tags = {
49+
Name = "vpc-flow-logs-s3-bucket"
50+
}
51+
}
52+
3453
# CloudWatch Log Group and IAM role created automatically
3554
module "vpc_with_flow_logs_cloudwatch_logs_default" {
3655
source = "../../"

examples/vpc-flow-logs/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
terraform {
2-
required_version = ">= 0.12.31"
2+
required_version = ">= 0.13.1"
33

44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 3.28"
7+
version = ">= 3.63"
88
}
99

1010
random = {

examples/vpc-separate-private-route-tables/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ Note that this example may create resources which can cost money (AWS Elastic IP
2121

2222
| Name | Version |
2323
|------|---------|
24-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
25-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.28 |
24+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
25+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.63 |
2626

2727
## Providers
2828

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
terraform {
2-
required_version = ">= 0.12.31"
2+
required_version = ">= 0.13.1"
33

44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 3.28"
7+
version = ">= 3.63"
88
}
99
}
1010
}

modules/vpc-endpoints/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ module "endpoints" {
5555

5656
| Name | Version |
5757
|------|---------|
58-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
58+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
5959
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.28 |
6060

6161
## Providers

0 commit comments

Comments
 (0)