Skip to content

Commit

Permalink
Merge pull request #21 from transcend-io/dmattia/listener_arn_outputs
Browse files Browse the repository at this point in the history
Added outputs for ALB listener ARNs
  • Loading branch information
dmattia authored May 21, 2020
2 parents 5696ef2 + d7de69b commit c119798
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 19 deletions.
4 changes: 2 additions & 2 deletions modules/fargate_container_definition/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ module "definition" {
})

environment = [
for name in sort(keys(var.environment)):
for name in sort(keys(var.environment)) :
{
name = name
name = name
value = var.environment[name]
}
]
Expand Down
12 changes: 11 additions & 1 deletion modules/sombra_load_balancers/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ output security_group_ids {
}

output private_zone_id {
value = var.use_private_load_balancer ? aws_route53_zone.private[0].zone_id : ""
value = var.use_private_load_balancer ? aws_route53_zone.private[0].zone_id : ""
description = "The hosted zone id of the private zone for the internal load balancer, if a private zone exists"
}

output internal_listener_arn {
value = var.use_private_load_balancer ? module.internal_load_balancer.https_listener_arns[0] : module.load_balancer.https_listener_arns[0]
description = "ARN of the internal sombra load balancer listener"
}

output external_listener_arn {
value = var.use_private_load_balancer ? module.external_load_balancer.https_listener_arns[0] : module.load_balancer.https_listener_arns[1]
description = "ARN of the external sombra load balancer listener"
}
2 changes: 1 addition & 1 deletion modules/sombra_load_balancers/single_alb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

locals {
should_override_name = try(length(var.override_alb_name) > 0, false)
alb_name = local.should_override_name ? var.override_alb_name : "${var.project_id}-sombra-alb"
alb_name = local.should_override_name ? var.override_alb_name : "${var.project_id}-sombra-alb"
}

module load_balancer {
Expand Down
6 changes: 3 additions & 3 deletions modules/sombra_load_balancers/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ variable zone_id {
}

variable override_alb_name {
type = string
default = null
description ="If set as a string, this custom name will be used on the alb resources"
type = string
default = null
description = "If set as a string, this custom name will be used on the alb resources"
}

variable tags {
Expand Down
16 changes: 13 additions & 3 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
output internal_url {
value = "https://${var.subdomain}.${var.root_domain}:${var.internal_port}"
value = "https://${var.subdomain}.${var.root_domain}:${var.internal_port}"
description = "Url of the internal sombra service. Depending on settings, it may only be accessible inside the VPC"
}

output external_url {
value = "https://${var.subdomain}.${var.root_domain}:${var.external_port}"
value = "https://${var.subdomain}.${var.root_domain}:${var.external_port}"
description = "Url of the external sombra service. It is publically accessible"
}

output private_zone_id {
value = module.load_balancer.private_zone_id
value = module.load_balancer.private_zone_id
description = "The hosted zone id of the private zone for the internal load balancer, if a private zone exists"
}

output internal_listener_arn {
value = module.load_balancer.internal_listener_arn
description = "ARN of the internal sombra load balancer listener"
}

output external_listener_arn {
value = module.load_balancer.external_listener_arn
description = "ARN of the external sombra load balancer listener"
}
18 changes: 9 additions & 9 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ variable tls_config {
})
default = {
passphrase = null
cert = null
key = null
cert = null
key = null
}
description = <<EOF
Sombra TLS Support. These values are sensitive, and should be kept secret.
Expand Down Expand Up @@ -356,13 +356,13 @@ variable use_private_load_balancer {
}

variable override_alb_name {
type = string
default = null
description ="If set as a string, this custom name will be used on the alb resources"
type = string
default = null
description = "If set as a string, this custom name will be used on the alb resources"
}

variable extra_envs {
type = map(string)
type = map(string)
description = <<EOF
A map of custom environment variables to set on the Sombra container.
Expand All @@ -373,11 +373,11 @@ variable extra_envs {
SOME_LOGGING_LEVEL = "info"
}
EOF
default = {}
default = {}
}

variable extra_secret_envs {
type = map(string)
type = map(string)
description = <<EOF
A map of custom, secretive environment variables to set on the Sombra container.
Expand All @@ -387,7 +387,7 @@ variable extra_secret_envs {
SOME_SECRET_ENV = "some_cryptographically_signed_value"
}
EOF
default = {}
default = {}
}

variable tags {
Expand Down

0 comments on commit c119798

Please sign in to comment.