standard-vpc.tf 663 B

12345678910111213141516171819
  1. # For now, we've left the standard VPC, but we still need it compliant.
  2. # If we change our minds, this would be a good place to delete the standard vpc.
  3. data "aws_vpcs" "foo" {
  4. filter {
  5. name = "isDefault"
  6. values = [ true ]
  7. }
  8. }
  9. resource "aws_flow_log" "flowlogs" {
  10. # Note: Flow log configuration is "special" here. For a generic version you can copy to your own module,
  11. # see the example in standard_vpc
  12. for_each = data.aws_vpcs.foo.ids
  13. iam_role_arn = aws_iam_role.flowlogs.arn
  14. log_destination = aws_cloudwatch_log_group.vpc_flow_logs.arn
  15. traffic_type = "REJECT" # CIS only requires reject, and "ALL" is expensive
  16. vpc_id = each.value
  17. }