Skip to content

Commit 26d0d0c

Browse files
Add outputs for flow logs
1 parent 99f4b9b commit 26d0d0c

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

flow-logs.tf

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ locals {
99
flow_log_cloudwatch_destination = local.create_flow_log_cloudwatch_log_group ? join("", aws_cloudwatch_log_group.flow_log.*.arn) : var.flow_log_destination_arn
1010
flow_log_s3_destination = local.create_flow_log_s3_bucket ? join("", aws_s3_bucket.flow_log.*.arn) : var.flow_log_destination_arn
1111

12-
flow_log_iam_role_arn = local.create_flow_log_cloudwatch_iam_role ? join("", aws_iam_role.vpc_flow_log_cloudwatch.*.arn) : var.flow_log_cloudwatch_iam_role_arn
13-
14-
flow_log_destination = var.push_flow_log_to_s3 ? local.flow_log_s3_destination : local.flow_log_cloudwatch_destination
15-
12+
flow_log_iam_role_arn = local.create_flow_log_cloudwatch_iam_role ? join("", aws_iam_role.vpc_flow_log_cloudwatch.*.arn) : var.flow_log_cloudwatch_iam_role_arn
13+
flow_log_destination = var.push_flow_log_to_s3 ? local.flow_log_s3_destination : local.flow_log_cloudwatch_destination
1614
flow_log_destination_type = var.push_flow_log_to_s3 ? "s3" : "cloud-watch-logs"
1715
}
1816

outputs.tf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,26 @@ output "vpc_endpoint_cloudtrail_dns_entry" {
618618
value = flatten(aws_vpc_endpoint.cloudtrail.*.dns_entry)
619619
}
620620

621+
output "vpc_flow_log_id" {
622+
description = "The ID of the Flow Log reosurce"
623+
value = join("", aws_flow_log.this.id)
624+
}
625+
626+
output "vpc_flow_log_destination_arn" {
627+
description = "The ARN of the destination for VPC FLow Logs"
628+
value = local.flow_log_destination
629+
}
630+
631+
output "vpc_flow_log_destination_type" {
632+
description = "The type of the destination for VPC FLow Logs"
633+
value = local.flow_log_destination_type
634+
}
635+
636+
output "vop_flow_log_cloudwatch_iam_role_arn" {
637+
description = "The ARN of the IAM role used when pushing logs to CLoudWatch log group"
638+
value = local.flow_log_iam_role_arn
639+
}
640+
621641
# Static values (arguments)
622642
output "azs" {
623643
description = "A list of availability zones specified as argument to this module"

0 commit comments

Comments
 (0)