-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlambda.tf
More file actions
26 lines (24 loc) · 784 Bytes
/
lambda.tf
File metadata and controls
26 lines (24 loc) · 784 Bytes
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
locals {
lambdaImage = "${aws_ecr_repository.ecr.repository_url}@${data.aws_ecr_image.lambda_image.image_digest}"
}
data "aws_ecr_image" "lambda_image" {
depends_on = [
aws_ecr_repository.ecr,
null_resource.docker_push
]
repository_name = aws_ecr_repository.ecr.name
image_tag = var.image_tag
}
resource "aws_lambda_function" "bun_lambda" {
depends_on = [
aws_ecr_repository.ecr,
null_resource.docker_push
]
function_name = var.lambda_name
architectures = var.lambda_architectures
package_type = "Image"
image_uri = local.lambdaImage
memory_size = var.lambda_memory_size
role = var.lambda_execution_role_arn != null ? var.lambda_execution_role_arn : aws_iam_role.lambda-role.arn
timeout = var.lambda_timeout
}