From 7513083415dfe7bfa215c8453f97dabf23dba19e Mon Sep 17 00:00:00 2001 From: Johnny Che Date: Mon, 18 Nov 2024 11:44:24 +0000 Subject: [PATCH] CCL-859: add option to specify s3 bucket prefixes, update README.md --- modules/aws/networking/alb/README.md | 29 ++++++++++++++++--------- modules/aws/networking/alb/main.tf | 1 + modules/aws/networking/alb/variables.tf | 6 +++++ 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/modules/aws/networking/alb/README.md b/modules/aws/networking/alb/README.md index 0a31d98..37ae39c 100644 --- a/modules/aws/networking/alb/README.md +++ b/modules/aws/networking/alb/README.md @@ -1,9 +1,6 @@ - -# Terraform Module - ALB - -This module provisions resources for ... ALB +# Example usage: -Example usage: terragrunt.hcl +## terragrunt.hcl ```hcl inputs = { @@ -55,14 +52,22 @@ inputs = { ] } ``` + + +## Requirements + +No requirements. + ## Providers | Name | Version | |------|---------| | [aws](#provider\_aws) | n/a | -## Requirements -No requirements. +## Modules + +No modules. + ## Resources | Name | Type | @@ -72,14 +77,19 @@ No requirements. | [aws_lb_target_group.lb_target_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_target_group) | resource | | [aws_lb_target_group_attachment.lb_target_group_attachment](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_target_group_attachment) | resource | | [aws_security_group.sg](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | resource | + ## Inputs | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | [access\_logs\_bucket](#input\_access\_logs\_bucket) | S3 bucket for NLB access logs | `string` | n/a | yes | +| [access\_logs\_bucket\_prefix](#input\_access\_logs\_bucket\_prefix) | S3 bucket prefix if bucket is stored outside root account | `string` | `""` | no | +| [access\_logs\_enabled](#input\_access\_logs\_enabled) | access\_logs\_enabled - true or false | `string` | n/a | yes | | [certificate\_arn](#input\_certificate\_arn) | ARN of the SSL certificate for HTTPS listener | `string` | n/a | yes | | [egress\_rules](#input\_egress\_rules) | A list of egress rules |
list(object({
from_port = number
to_port = number
protocol = string
cidr_blocks = list(string)
description = string
}))
| n/a | yes | -| [enable\_deletion\_protection](#input\_enable\_deletion\_protection) | enable\_deletion\_protection true or false | `string` | n/a | yes | +| [enable\_cross\_zone\_load\_balancing](#input\_enable\_cross\_zone\_load\_balancing) | enable\_cross\_zone\_load\_balancing - true or false | `string` | n/a | yes | +| [enable\_deletion\_protection](#input\_enable\_deletion\_protection) | enable\_deletion\_protection - true or false | `string` | n/a | yes | +| [enable\_http2](#input\_enable\_http2) | enable\_http2 - true or false | `string` | n/a | yes | | [ingress\_rules](#input\_ingress\_rules) | A list of ingress rules |
list(object({
from_port = number
to_port = number
protocol = string
cidr_blocks = list(string)
description = string
}))
| n/a | yes | | [load\_balancer\_internal](#input\_load\_balancer\_internal) | load\_balancer\_internal - true or false | `string` | n/a | yes | | [load\_balancer\_type](#input\_load\_balancer\_type) | load\_balancer\_type - network or application | `string` | n/a | yes | @@ -91,12 +101,11 @@ No requirements. | [tg\_port](#input\_tg\_port) | target group port | `string` | n/a | yes | | [tg\_protocol](#input\_tg\_protocol) | target group protocol | `string` | n/a | yes | | [vpc\_id](#input\_vpc\_id) | VPC ID where NLB will be deployed | `string` | n/a | yes | + ## Outputs | Name | Description | |------|-------------| | [alb\_dns\_name](#output\_alb\_dns\_name) | The DNS name of the LB | | [alb\_security\_group\_id](#output\_alb\_security\_group\_id) | n/a | - - diff --git a/modules/aws/networking/alb/main.tf b/modules/aws/networking/alb/main.tf index 27be0c0..5939d74 100644 --- a/modules/aws/networking/alb/main.tf +++ b/modules/aws/networking/alb/main.tf @@ -10,6 +10,7 @@ resource "aws_lb" "lb" { access_logs { bucket = var.access_logs_bucket + prefix = var.access_logs_bucket_prefix enabled = var.access_logs_enabled } diff --git a/modules/aws/networking/alb/variables.tf b/modules/aws/networking/alb/variables.tf index 076689e..da71051 100644 --- a/modules/aws/networking/alb/variables.tf +++ b/modules/aws/networking/alb/variables.tf @@ -35,6 +35,12 @@ variable "access_logs_bucket" { description = "S3 bucket for NLB access logs" } +variable "access_logs_bucket_prefix" { + type = string + description = "S3 bucket prefix if bucket is stored outside root account" + default = "" +} + variable "access_logs_enabled" { type = string description = "access_logs_enabled - true or false"