Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes deprecation of log_group_name -> log_destination #13

Merged
merged 14 commits into from
Feb 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,13 @@ Available targets:
| Name | Description |
|------|-------------|
| eni_flow_ids | Flow Log IDs of ENIs |
| kinesis_arn | ARN of Stream |
| kinesis_id | Stream ID |
| kinesis_name | Stream name |
| kinesis_shard_count | Count of Shards for Stream |
| kinesis_arn | Kinesis Stream ARN |
| kinesis_id | Kinesis Stream ID |
| kinesis_name | Kinesis Stream name |
| kinesis_shard_count | Kinesis Stream Shard count |
| log_group_arn | ARN of the log group |
| subnet_flow_ids | Flow Log IDs of subnets |
| vpc_flow_id | Flow Log IDs of VPCs |
| vpc_flow_id | VPC Flow Log ID |



Expand Down
10 changes: 5 additions & 5 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
| Name | Description |
|------|-------------|
| eni_flow_ids | Flow Log IDs of ENIs |
| kinesis_arn | ARN of Stream |
| kinesis_id | Stream ID |
| kinesis_name | Stream name |
| kinesis_shard_count | Count of Shards for Stream |
| kinesis_arn | Kinesis Stream ARN |
| kinesis_id | Kinesis Stream ID |
| kinesis_name | Kinesis Stream name |
| kinesis_shard_count | Kinesis Stream Shard count |
| log_group_arn | ARN of the log group |
| subnet_flow_ids | Flow Log IDs of subnets |
| vpc_flow_id | Flow Log IDs of VPCs |
| vpc_flow_id | VPC Flow Log ID |

30 changes: 15 additions & 15 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,25 @@ resource "aws_cloudwatch_log_group" "default" {
}

resource "aws_flow_log" "vpc" {
count = "${var.enabled == "true" ? 1 : 0}"
log_group_name = "${aws_cloudwatch_log_group.default.name}"
iam_role_arn = "${aws_iam_role.log.arn}"
vpc_id = "${var.vpc_id}"
traffic_type = "${var.traffic_type}"
count = "${var.enabled == "true" ? 1 : 0}"
log_destination = "${aws_cloudwatch_log_group.default.arn}"
slmingol marked this conversation as resolved.
Show resolved Hide resolved
iam_role_arn = "${aws_iam_role.log.arn}"
vpc_id = "${var.vpc_id}"
traffic_type = "${var.traffic_type}"
}

resource "aws_flow_log" "subnets" {
count = "${var.enabled == "true" ? length(compact(var.subnet_ids)) : 0}"
log_group_name = "${aws_cloudwatch_log_group.default.name}"
iam_role_arn = "${aws_iam_role.log.arn}"
subnet_id = "${element(compact(var.subnet_ids), count.index)}"
traffic_type = "${var.traffic_type}"
count = "${var.enabled == "true" ? length(compact(var.subnet_ids)) : 0}"
log_destination = "${aws_cloudwatch_log_group.default.arn}"
slmingol marked this conversation as resolved.
Show resolved Hide resolved
iam_role_arn = "${aws_iam_role.log.arn}"
subnet_id = "${element(compact(var.subnet_ids), count.index)}"
traffic_type = "${var.traffic_type}"
}

resource "aws_flow_log" "eni" {
count = "${var.enabled == "true" ? length(compact(var.eni_ids)) : 0}"
log_group_name = "${aws_cloudwatch_log_group.default.name}"
iam_role_arn = "${aws_iam_role.log.arn}"
eni_id = "${element(compact(var.eni_ids), count.index)}"
traffic_type = "${var.traffic_type}"
count = "${var.enabled == "true" ? length(compact(var.eni_ids)) : 0}"
log_destination = "${aws_cloudwatch_log_group.default.arn}"
slmingol marked this conversation as resolved.
Show resolved Hide resolved
iam_role_arn = "${aws_iam_role.log.arn}"
subnet_id = "${element(compact(var.eni_ids), count.index)}"
traffic_type = "${var.traffic_type}"
}
26 changes: 13 additions & 13 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
output "log_group_arn" {
value = "${aws_cloudwatch_log_group.default.arn}"
value = "${join("", aws_cloudwatch_log_group.default.*.arn)}"
description = "ARN of the log group"
}

output "vpc_flow_id" {
value = "${aws_flow_log.vpc.id}"
description = "Flow Log IDs of VPCs"
value = "${join("", aws_flow_log.vpc.*.id)}"
description = "VPC Flow Log ID"
}

output "subnet_flow_ids" {
value = "${aws_flow_log.subnets.*.id}"
value = "${join("", aws_flow_log.subnets.*.id)}"
description = "Flow Log IDs of subnets"
}

output "eni_flow_ids" {
value = "${aws_flow_log.eni.*.id}"
value = "${join("", aws_flow_log.eni.*.id)}"
description = "Flow Log IDs of ENIs"
}

output "kinesis_id" {
value = "${aws_kinesis_stream.default.id}"
description = "Stream ID"
value = "${join("", aws_kinesis_stream.default.*.id)}"
description = "Kinesis Stream ID"
}

output "kinesis_name" {
value = "${aws_kinesis_stream.default.name}"
description = "Stream name"
value = "${join("", aws_kinesis_stream.default.*.name)}"
description = "Kinesis Stream name"
}

output "kinesis_shard_count" {
value = "${aws_kinesis_stream.default.shard_count}"
description = "Count of Shards for Stream"
value = "${join("", aws_kinesis_stream.default.*.shard_count)}"
description = "Kinesis Stream Shard count"
}

output "kinesis_arn" {
value = "${aws_kinesis_stream.default.arn}"
description = "ARN of Stream"
value = "${join("", aws_kinesis_stream.default.*.arn)}"
description = "Kinesis Stream ARN"
}