Skip to main content

Module: vpc-flow-logs-s3-bucket

Terraform module to create AWS VPC Flow logs backed by S3.

Introduction

The module will create:

  • S3 bucket with server side encryption
  • KMS key to encrypt flow logs files in the bucket
  • Optional VPC Flow Log backed by the S3 bucket (this can be disabled, e.g. in multi-account environments if you want to create an S3 bucket in one account and VPC Flow Logs in different accounts)

Usage

For a complete example, see examples/complete.

For automated tests of the complete example using bats and Terratest (which tests and deploys the example on Datadog), see test.

  module "vpc" {
source = "cloudposse/vpc/aws"
version = "0.18.0"

namespace = "eg"
stage = "test"
name = "flowlogs"
cidr_block = "172.16.0.0/16"
}

module "flow_logs" {
source = "cloudposse/vpc-flow-logs-s3-bucket/aws"
version = "0.8.0"

namespace = "eg"
stage = "test"
name = "flowlogs"

vpc_id = module.vpc.vpc_id
}