{"id":19508865,"url":"https://github.com/rhythmictech/terraform-aws-vpcflowlogs","last_synced_at":"2025-04-26T03:31:47.362Z","repository":{"id":34992591,"uuid":"192140602","full_name":"rhythmictech/terraform-aws-vpcflowlogs","owner":"rhythmictech","description":"Configure VPC flow logs for one or more VPCs.","archived":false,"fork":false,"pushed_at":"2022-06-08T21:05:48.000Z","size":18,"stargazers_count":3,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T07:11:20.736Z","etag":null,"topics":["aws","terraform","terraform-module","terraform-modules","vpc","vpc-flow-logs"],"latest_commit_sha":null,"homepage":"https://registry.terraform.io/modules/rhythmictech/vpcflowlogs/aws","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rhythmictech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2019-06-16T02:04:47.000Z","updated_at":"2024-07-26T13:26:29.000Z","dependencies_parsed_at":"2022-08-24T06:10:12.268Z","dependency_job_id":null,"html_url":"https://github.com/rhythmictech/terraform-aws-vpcflowlogs","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhythmictech%2Fterraform-aws-vpcflowlogs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhythmictech%2Fterraform-aws-vpcflowlogs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhythmictech%2Fterraform-aws-vpcflowlogs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhythmictech%2Fterraform-aws-vpcflowlogs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhythmictech","download_url":"https://codeload.github.com/rhythmictech/terraform-aws-vpcflowlogs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250926815,"owners_count":21509041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","terraform","terraform-module","terraform-modules","vpc","vpc-flow-logs"],"created_at":"2024-11-10T23:10:08.424Z","updated_at":"2025-04-26T03:31:47.074Z","avatar_url":"https://github.com/rhythmictech.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terraform-aws-vpcflowlogs\n\n[![](https://github.com/rhythmictech/terraform-aws-vpcflowlogs/workflows/check/badge.svg)](https://github.com/rhythmictech/terraform-aws-vpcflowlogs/actions)\n\nConfigure VPC flow logs for one or more VPCs. Supports creating a KMS key and S3 bucket or using an existing bucket. Useful when shipping flow logs to a separate account. Note that the KMS key and S3 bucket will need to have the appropriate policies in place to accept logs from another account. See [terraform-aws-vpcflowlog-bucket](https://github.com/rhythmictech/terraform-aws-vpc-flowlog-bucket) for a suitable example.\n\nExample:\n\n```\nmodule \"vpcflowlogs\" {\n  #source         = \"git::https://github.com/rhythmictech/terraform-aws-vpcflowlogs.git\"\n  logging_bucket     = \"example-s3-access-logs-bucket\"\n  region             = \"us-east-1\"\n  tags               = local.tags\n  vpc_ids            = [\"vpc-1234567890\"]\n}\n```\n\nUsing an external key/bucket:\n\n```\nmodule \"vpcflowlogs\" {\n  #source         = \"git::https://github.com/rhythmictech/terraform-aws-vpcflowlogs.git\"\n  create_bucket      = false\n  create_kms_key     = false\n  region             = \"us-east-1\"\n  tags               = local.tags\n  vpc_ids            = [\"vpc-1234567890\"]\n  vpcflowlog_bucket  = \"example-s3-vpcflowlogs-bucket\"\n  vpcflowlog_kms_key = \"arn:aws:kms:us-east-1:123456789012:key/...\"\n}\n```\n\n\u003c!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n## Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_terraform\"\u003e\u003c/a\u003e [terraform](#requirement\\_terraform) | \u003e= 0.13.4 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_aws\"\u003e\u003c/a\u003e [aws](#provider\\_aws) | 4.17.1 |\n\n## Modules\n\nNo modules.\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [aws_cloudwatch_log_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource |\n| [aws_flow_log.cloudwatch](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/flow_log) | resource |\n| [aws_flow_log.s3](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/flow_log) | resource |\n| [aws_iam_policy.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |\n| [aws_iam_role.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |\n| [aws_iam_role_policy_attachment.vpcflowlog-attach-localconfig-policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |\n| [aws_kms_alias.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kms_alias) | resource |\n| [aws_kms_key.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kms_key) | resource |\n| [aws_s3_bucket.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource |\n| [aws_s3_bucket_policy.vpcflowlog_bucket_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_policy) | resource |\n| [aws_s3_bucket_public_access_block.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_public_access_block) | resource |\n| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |\n| [aws_iam_policy_document.assume](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |\n| [aws_iam_policy_document.key](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |\n| [aws_iam_policy_document.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |\n| [aws_partition.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/partition) | data source |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_create_bucket\"\u003e\u003c/a\u003e [create\\_bucket](#input\\_create\\_bucket) | Create S3 bucket to receive VPC flow logs? `vpcflowlog_bucket` must be specified if this is false. | `bool` | `true` | no |\n| \u003ca name=\"input_create_kms_key\"\u003e\u003c/a\u003e [create\\_kms\\_key](#input\\_create\\_kms\\_key) | Create KMS key to encrypt flow logs? `vpcflowlog_kms_key` must be specified if this is false. | `bool` | `true` | no |\n| \u003ca name=\"input_kms_alias\"\u003e\u003c/a\u003e [kms\\_alias](#input\\_kms\\_alias) | KMS Key Alias for VPC flow log KMS key | `string` | `\"vpcflowlog_key\"` | no |\n| \u003ca name=\"input_log_to_cloudwatch\"\u003e\u003c/a\u003e [log\\_to\\_cloudwatch](#input\\_log\\_to\\_cloudwatch) | Should VPC flow logs be written to CloudWatch Logs | `bool` | `true` | no |\n| \u003ca name=\"input_log_to_s3\"\u003e\u003c/a\u003e [log\\_to\\_s3](#input\\_log\\_to\\_s3) | Should VPC flow logs be written to S3 | `bool` | `true` | no |\n| \u003ca name=\"input_logging_bucket\"\u003e\u003c/a\u003e [logging\\_bucket](#input\\_logging\\_bucket) | S3 bucket to send request logs to the VPC flow log bucket to (required if `create_bucket` is true) | `string` | `\"\"` | no |\n| \u003ca name=\"input_region\"\u003e\u003c/a\u003e [region](#input\\_region) | Region VPC flow logs will be sent to | `string` | n/a | yes |\n| \u003ca name=\"input_tags\"\u003e\u003c/a\u003e [tags](#input\\_tags) | Tags to include on resources that support it | `map(string)` | `{}` | no |\n| \u003ca name=\"input_vpc_ids\"\u003e\u003c/a\u003e [vpc\\_ids](#input\\_vpc\\_ids) | List of VPCs to enable flow logging for | `list(string)` | n/a | yes |\n| \u003ca name=\"input_vpcflowlog_bucket\"\u003e\u003c/a\u003e [vpcflowlog\\_bucket](#input\\_vpcflowlog\\_bucket) | S3 bucket to receive VPC flow logs (required it `create_bucket` is false) | `string` | `\"\"` | no |\n| \u003ca name=\"input_vpcflowlog_kms_key\"\u003e\u003c/a\u003e [vpcflowlog\\_kms\\_key](#input\\_vpcflowlog\\_kms\\_key) | KMS key to use for VPC flow log encryption (required it `create_kms_key` is false) | `string` | `\"\"` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_kms_key_id\"\u003e\u003c/a\u003e [kms\\_key\\_id](#output\\_kms\\_key\\_id) | KMS key |\n| \u003ca name=\"output_s3_bucket_name\"\u003e\u003c/a\u003e [s3\\_bucket\\_name](#output\\_s3\\_bucket\\_name) | The name of the bucket flow logs are routing to |\n\u003c!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n\n## Related Projects\n* [VPC Flow Log Bucket](https://github.com/rhythmictech/terraform-aws-vpc-flowlog-bucket)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhythmictech%2Fterraform-aws-vpcflowlogs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhythmictech%2Fterraform-aws-vpcflowlogs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhythmictech%2Fterraform-aws-vpcflowlogs/lists"}