-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlambda.tf
More file actions
45 lines (39 loc) · 1.01 KB
/
Copy pathlambda.tf
File metadata and controls
45 lines (39 loc) · 1.01 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
44
45
data "archive_file" "example-lambda-zip" {
type = "zip"
source_dir = "${path.module}/serverless"
output_path = "${path.module}/lambda_dist/lambda.zip"
}
resource "aws_lambda_function" "example-lambda" {
function_name = "index"
role = aws_iam_role.example-lambda-role.arn
timeout = 60
source_code_hash = data.archive_file.example-lambda-zip.output_base64sha256
package_type = "Image"
image_uri = "${aws_ecr_repository.example-ecr.repository_url}:latest"
memory_size = 256
environment {
variables = {
HOST = "127.0.0.1"
}
}
file_system_config {
arn = aws_efs_access_point.example-efs-access-point.arn
local_mount_path = "/mnt/efs"
}
depends_on = [
null_resource.example-ecr-container
]
lifecycle {
ignore_changes = [
image_uri
]
}
vpc_config {
security_group_ids = [
aws_security_group.example-lambda-vpc.id
]
subnet_ids = [
aws_subnet.example-subnet-a.id
]
}
}