-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlambda.tf
More file actions
43 lines (36 loc) · 1.4 KB
/
lambda.tf
File metadata and controls
43 lines (36 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
locals {
bootstrap_image_uri = "${aws_ecr_repository.this.repository_url}:bootstrap"
effective_image_uri = local.app_version == "" ? dockerless_remote_image.bootstrap.target : "${aws_ecr_repository.this.repository_url}:${local.app_version}"
command = length(var.command) > 0 ? var.command : null
}
resource "aws_lambda_function" "this" {
#bridgecrew:skip=CKV_AWS_272: Skipping "Ensure AWS Lambda function is configured to validate code-signing". This module uses a docker image that cannot be code-signed.
function_name = local.resource_name
role = aws_iam_role.executor.arn
memory_size = var.memory
timeout = var.timeout
tags = local.tags
package_type = "Image"
image_uri = local.effective_image_uri
reserved_concurrent_executions = var.reserved_concurrency
kms_key_arn = aws_kms_key.this.arn
image_config {
command = local.command
}
vpc_config {
security_group_ids = [aws_security_group.this.id]
subnet_ids = local.private_subnet_ids
}
environment {
variables = local.all_env_vars
}
tracing_config {
mode = "Active"
}
dynamic "dead_letter_config" {
for_each = local.dead_letter_queues
content {
target_arn = dead_letter_config.value.queue_arn
}
}
}