Skip to content

Commit

Permalink
Fixes the CHECK_URLs list (#39)
Browse files Browse the repository at this point in the history
* Fixes the CHECK_URLs list

* fix syntax
  • Loading branch information
bwhaley authored Nov 28, 2022
1 parent fa346ab commit 670e251
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion functions/replace-route/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def connectivity_test_handler(event, context):
logger.info("Starting NAT instance connectivity test")

check_interval = int(os.getenv("CONNECTIVITY_CHECK_INTERVAL", DEFAULT_CONNECTIVITY_CHECK_INTERVAL))
check_urls = os.getenv("CHECK_URLS", DEFAULT_CHECK_URLS)
check_urls = "CHECK_URLS" in os.environ and os.getenv("CHECK_URLS").split(",") or DEFAULT_CHECK_URLS

# Run connectivity checks for approximately 1 minute
run = 0
Expand Down
7 changes: 6 additions & 1 deletion modules/terraform-aws-alternat/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ resource "aws_lambda_function" "alternat_autoscaling_hook" {
environment {
variables = {
PRIVATE_SUBNET_SUFFIX = var.subnet_suffix
CHECK_URLS = var.connectivity_test_check_urls
}
}
tags = merge({
Expand Down Expand Up @@ -119,6 +118,12 @@ resource "aws_lambda_function" "alternat_connectivity_tester" {

role = aws_iam_role.nat_lambda_role.arn

environment {
variables = {
CHECK_URLS = join(",", var.connectivity_test_check_urls)
}
}

vpc_config {
subnet_ids = [var.vpc_private_subnet_ids[count.index]]
security_group_ids = [aws_security_group.nat_lambda.id]
Expand Down

0 comments on commit 670e251

Please sign in to comment.