Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed May 14, 2021
1 parent e21e5db commit 567a813
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 17 deletions.
31 changes: 22 additions & 9 deletions flowlogs/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
# About aws-vpc-setup :: flowlogs

This submodule creates VPC flow logs. It creates one for private and one for public subnets. Run this once
per VPC. You will need to run the flow logs role once before (aws-vpc-setup/flowlogs-role)
per VPC. You will need to run the flow logs role once before (aws-vpc-setup/flowlogs-role).

This also creates cloudwatch logs and cloudwatch streams (Kinesis), and drops a configuration file in `setup/`
to be used in Splunk. Distribute this configuration to the splunk team for flowlog ingestion.

```
# setup/aws_kinesis_tasks.lgs-vpc2-dice-dev.conf
[ma6-gov-flowlogs-us-gov-east-1_lg-vpc2-dice-dev]
account = ma6-gov
format = CloudWatchLogs
index = aws_vpc_flow_logs
region = us-gov-east-1
sourcetype = aws:cloudwatchlogs:vpcflow
init_stream_position = LATEST
stream_names = lgs-vpc2-dice-dev
```

# Usage

Expand All @@ -13,14 +28,12 @@ module "flowlogs" {
account_alias = "ma6-gov"
public_subnets_ids = module.subnets.public_subnets_ids
private_subnets_ids = module.subnets.private_subnets_ids
flowlog_bucket_arn = {flowlog-s3-bucket-arn}
flowlog_role_arn = {flowlog-role-arn}
# optional
public_subnet_ids = [ for s in module.subnets.public_subnets_ids : s.id ]
private_subnet_ids = [ for s in module.subnets.private_subnets_ids : s.id ]
vpc_name = var.vpc_name
vpc_short_name = var.vpc_short_name
flowlog_bucket_arn = data.terraform_remote_state.common.infrastructure_east.flowlogs_arn
flowlog_role_arn = data.terraform_remote_state.common.outputs.role_flowlogs_arn
## optional
# public_subnet_ids = [ for s in module.subnets.public_subnets_ids : s.id ]
# private_subnet_ids = [ for s in module.subnets.private_subnets_ids : s.id ]
tags = {}
}
Expand Down
29 changes: 21 additions & 8 deletions flowlogs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,22 @@
* # About aws-vpc-setup :: flowlogs
*
* This submodule creates VPC flow logs. It creates one for private and one for public subnets. Run this once
* per VPC. You will need to run the flow logs role once before (aws-vpc-setup/flowlogs-role)
* per VPC. You will need to run the flow logs role once before (aws-vpc-setup/flowlogs-role).
*
* This also creates cloudwatch logs and cloudwatch streams (Kinesis), and drops a configuration file in `setup/`
* to be used in Splunk. Distribute this configuration to the splunk team for flowlog ingestion.
*
* ```
* # setup/aws_kinesis_tasks.lgs-vpc2-dice-dev.conf
* [ma6-gov-flowlogs-us-gov-east-1_lg-vpc2-dice-dev]
* account = ma6-gov
* format = CloudWatchLogs
* index = aws_vpc_flow_logs
* region = us-gov-east-1
* sourcetype = aws:cloudwatchlogs:vpcflow
* init_stream_position = LATEST
* stream_names = lgs-vpc2-dice-dev
* ```
*
* # Usage
*
Expand All @@ -14,14 +29,12 @@
* account_alias = "ma6-gov"
* public_subnets_ids = module.subnets.public_subnets_ids
* private_subnets_ids = module.subnets.private_subnets_ids
* flowlog_bucket_arn = {flowlog-s3-bucket-arn}
* flowlog_role_arn = {flowlog-role-arn}
* flowlog_bucket_arn = data.terraform_remote_state.common.infrastructure_east.flowlogs_arn
* flowlog_role_arn = data.terraform_remote_state.common.outputs.role_flowlogs_arn
*
* # optional
* public_subnet_ids = [ for s in module.subnets.public_subnets_ids : s.id ]
* private_subnet_ids = [ for s in module.subnets.private_subnets_ids : s.id ]
* vpc_name = var.vpc_name
* vpc_short_name = var.vpc_short_name
* ## optional
* # public_subnet_ids = [ for s in module.subnets.public_subnets_ids : s.id ]
* # private_subnet_ids = [ for s in module.subnets.private_subnets_ids : s.id ]
*
* tags = {}
* }
Expand Down

0 comments on commit 567a813

Please sign in to comment.