Skip to content

Commit

Permalink
Fix sg issue when not deploying to vpc. (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-pkommini authored May 17, 2022
1 parent 0513b58 commit 2fc906a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lambda.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
locals {
source_code_repo_dir_path = "geff"
runtime = "python3.8"
lambda_sg_ids = length(var.lambda_security_group_ids) == 0 ? [aws_security_group.geff_lambda_sg.0.id] : var.lambda_security_group_ids
lambda_sg_ids = var.deploy_lambda_in_vpc && length(var.lambda_security_group_ids) == 0 ? [aws_security_group.geff_lambda_sg.0.id] : var.lambda_security_group_ids
}

resource "aws_lambda_function" "geff_lambda" {
Expand Down
2 changes: 1 addition & 1 deletion output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ output "sns_topic_arn" {

output "geff_lambda_sg_ids" {
description = "Lambda SG IDs."
value = length(var.lambda_security_group_ids) == 0 ? [aws_security_group.geff_lambda_sg.0.id] : var.lambda_security_group_ids
value = var.deploy_lambda_in_vpc && length(var.lambda_security_group_ids) == 0 ? [aws_security_group.geff_lambda_sg.0.id] : var.lambda_security_group_ids
}

0 comments on commit 2fc906a

Please sign in to comment.