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

Bugfix issue with ALB bucket output name and name in general #247

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

gugaiz
Copy link
Contributor

@gugaiz gugaiz commented Sep 1, 2023

what

This fixes the issue with the output of the ALB bucket name, it also incorporates the option to manually set the bucket name to make it backward compatible with the previous deployment (what already has the bucket name assigned)

why

Because it is a bug that is on production code as commented on here

@gugaiz gugaiz requested review from a team as code owners September 1, 2023 16:58
main.tf Outdated
@@ -1103,7 +1103,7 @@ module "elb_logs" {
source = "cloudposse/lb-s3-bucket/aws"
version = "0.19.0"
enabled = var.enable_loadbalancer_logs && local.enabled && var.tier == "WebServer" && var.environment_type == "LoadBalanced" && var.loadbalancer_type != "network" && !var.loadbalancer_is_shared ? true : false
name = "${module.this.id}-alb-logs-${random_string.elb_logs_suffix.result}"
name = var.s3_bucket_access_log_bucket_name != "" ? var.s3_bucket_access_log_bucket_name : "${module.this.id}-alb-logs-${random_string.elb_logs_suffix.result}"
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the output and the resource name should use a local so they're reading from the same value.

outputs.tf Outdated
@@ -84,7 +84,7 @@ output "load_balancers" {
}

output "load_balancer_log_bucket" {
value = var.enable_loadbalancer_logs ? "${module.this.id}-eb-loadbalancer-logs-${random_string.elb_logs_suffix.result}" : null
value = var.s3_bucket_access_log_bucket_name != "" ? var.s3_bucket_access_log_bucket_name : "${module.this.id}-alb-logs-${random_string.elb_logs_suffix.result}"
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think the output should output the log bucket name event when logging is disabled?

@joe-niland
Copy link
Sponsor Member

/terratest

@joe-niland joe-niland added patch A minor, backward compatible change bugfix Change that restores intended behavior and removed bugfix Change that restores intended behavior labels Sep 5, 2023
@joe-niland joe-niland merged commit 79c464b into cloudposse:main Sep 7, 2023
30 of 38 checks passed
@joe-niland
Copy link
Sponsor Member

Thanks for your contribution @gugaiz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch A minor, backward compatible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants