Skip to content

Commit

Permalink
Merge pull request #7 from rhythmictech/access_logs
Browse files Browse the repository at this point in the history
adding access logs to lb
  • Loading branch information
jjduverge authored Dec 5, 2024
2 parents e168bd9 + 0fac185 commit 939aba2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
6 changes: 6 additions & 0 deletions elb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ resource "aws_lb" "this" {
security_groups = [aws_security_group.elb.id]
subnets = var.elb_subnets
tags = var.tags

access_logs {
bucket = var.access_logs_bucket
enabled = var.access_logs_enabled
prefix = var.access_logs_prefix
}
}

resource "aws_lb_listener" "this" {
Expand Down
19 changes: 19 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,24 @@ variable "root_volume_type" {
# Networking Vars
########################################

variable "access_logs_bucket" {
default = null
description = "The name of the bucket to store LB access logs in. Required if `access_logs_enabled` is `true`"
type = string
}

variable "access_logs_enabled" {
default = false
description = "Whether to enable LB access logging"
type = bool
}

variable "access_logs_prefix" {
default = null
description = "The path prefix to apply to the LB access logs."
type = string
}

variable "elb_additional_sg_tags" {
default = {}
description = "Additional tags to apply to the ELB security group. Useful if you use an external process to manage ingress rules."
Expand Down Expand Up @@ -176,3 +194,4 @@ variable "enable_efs_backups" {
description = "Enable EFS backups using AWS Backup (recommended if you aren't going to back up EFS some other way)"
type = bool
}

0 comments on commit 939aba2

Please sign in to comment.