Skip to content

Commit 2f29c80

Browse files
authored
Update lambda.tf
1 parent 59f6d1f commit 2f29c80

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

terraform-unity/lambda.tf

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
1-
resource "aws_ssm_parameter" "test_parameter" {
2-
name = var.parameter_name
3-
type = "String"
4-
value = var.parameter_value
1+
resource "null_resource" "download_lambda_zip" {
2+
provisioner "local-exec" {
3+
command = "wget -O ${path.module}/unity-cs-monitoring-lambda.zip https://github.com/unity-sds/unity-cs-monitoring-lambda/releases/download/v1.0.7/unity-cs-monitoring-lambda.zip"
4+
}
5+
}
6+
7+
resource "aws_lambda_function" "unity_cs_monitoring_lambda" {
8+
function_name = "unity_cs_monitoring_lambda"
9+
role = "arn:aws:iam::429178552491:role/iam_for_lambda"
10+
handler = "lambda_function.lambda_handler"
11+
runtime = "python3.12"
12+
timeout = 300 # Timeout set to 5 minutes (300 seconds)
13+
14+
filename = "${path.module}/unity-cs-monitoring-lambda.zip"
15+
16+
environment {
17+
variables = {
18+
# Add any environment
19+
}
20+
}
21+
22+
depends_on = [null_resource.download_lambda_zip]
523
}

0 commit comments

Comments
 (0)