Skip to content

Commit

Permalink
Pass module.this.context to cloudposse/lb-s3-bucket/aws (#86)
Browse files Browse the repository at this point in the history
* Pass module.this.context to cloudposse/lb-s3-bucket/aws

* Remove the existing values name, namespace, stage, environment, delimiter, and tags that are part of the given context

* Add skips to new bridgecrew checks

Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
  • Loading branch information
jwstric2 and jamengual committed Apr 23, 2021
1 parent a1364b7 commit af9ea1c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions main.tf
Expand Up @@ -42,13 +42,7 @@ module "access_logs" {
source = "cloudposse/lb-s3-bucket/aws"
version = "0.12.0"
enabled = module.this.enabled && var.access_logs_enabled && var.access_logs_s3_bucket_id == null
name = module.this.name
namespace = module.this.namespace
stage = module.this.stage
environment = module.this.environment
attributes = compact(concat(module.this.attributes, ["alb", "access", "logs"]))
delimiter = module.this.delimiter
tags = module.this.tags
lifecycle_rule_enabled = var.lifecycle_rule_enabled
enable_glacier_transition = var.enable_glacier_transition
expiration_days = var.expiration_days
Expand All @@ -57,9 +51,12 @@ module "access_logs" {
noncurrent_version_transition_days = var.noncurrent_version_transition_days
standard_transition_days = var.standard_transition_days
force_destroy = var.alb_access_logs_s3_bucket_force_destroy
context = module.this.context
}

resource "aws_lb" "default" {
#bridgecrew:skip=BC_AWS_NETWORKING_41 - Skipping Ensure that ALB Drops HTTP Headers
#bridgecrew:skip=BC_AWS_LOGGING_22 - Skipping Ensure ELBv2 has Access Logging Enabled
count = module.this.enabled ? 1 : 0
name = module.this.id
tags = module.this.tags
Expand Down Expand Up @@ -132,6 +129,8 @@ resource "aws_lb_target_group" "default" {
}

resource "aws_lb_listener" "http_forward" {
#bridgecrew:skip=BC_AWS_GENERAL_43 - Skipping Ensure that load balancer is using TLS 1.2.
#bridgecrew:skip=BC_AWS_NETWORKING_29 - Skipping Ensure ALB Protocol is HTTPS
count = var.http_enabled && var.http_redirect != true ? 1 : 0
load_balancer_arn = join("", aws_lb.default.*.arn)
port = var.http_port
Expand Down Expand Up @@ -171,6 +170,7 @@ resource "aws_lb_listener" "http_redirect" {
}

resource "aws_lb_listener" "https" {
#bridgecrew:skip=BC_AWS_GENERAL_43 - Skipping Ensure that load balancer is using TLS 1.2.
count = module.this.enabled && var.https_enabled ? 1 : 0
load_balancer_arn = join("", aws_lb.default.*.arn)

Expand Down

0 comments on commit af9ea1c

Please sign in to comment.