Skip to content

Commit ef9cfbf

Browse files
committed
lambda vpc subnets and security groups configuration added
1 parent 96e4121 commit ef9cfbf

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

main.tf

+7
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ module "ecr-scan-trigger-lambda" {
5656
handler = "lambda_function.lambda_handler"
5757
runtime = "python3.6"
5858

59+
subnet_ids = var.subnet_ids
60+
security_group_ids = var.security_group_ids
61+
62+
5963
tags = merge(
6064
var.tags,
6165
map("Name", var.global_name),
@@ -75,6 +79,9 @@ module "ecr-scan-notify-lambda" {
7579
handler = "lambda_function.lambda_handler"
7680
runtime = "python3.6"
7781

82+
subnet_ids = var.subnet_ids
83+
security_group_ids = var.security_group_ids
84+
7885
environment = {
7986
SLACK_CHANNEL = var.slack_channel
8087
SLACK_USERNAME = var.slack_username

variables.tf

+13
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,16 @@ variable "risk_levels" {
5555
type = string
5656
default = "HIGH, CRITICAL"
5757
}
58+
59+
variable "subnet_ids" {
60+
description = "VPC subnets for Lambda"
61+
type = list(string)
62+
default = []
63+
}
64+
65+
variable "security_group_ids" {
66+
description = "SG IDs for Lambda, should at least allow all outbound"
67+
type = list(string)
68+
default = []
69+
}
70+

0 commit comments

Comments
 (0)