Skip to content

Commit

Permalink
Fixes deprecation of log_group_name -> log_destination (#13)
Browse files Browse the repository at this point in the history
* Fixes several warnings around wildcarding

* Fixes outputs which return as lists

* Removes current = “true” from aws_region

* Removes current = “true” from aws_region

* Fixes deprecation of log_group_name -> log_destination

* Run fmt + make cmds

* Fixes linting issue
  • Loading branch information
slmingol committed Feb 28, 2020
1 parent 455e702 commit c57e824
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 38 deletions.
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}"
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}"
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}"
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"
}

0 comments on commit c57e824

Please sign in to comment.