-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsigner.tf
33 lines (29 loc) · 846 Bytes
/
signer.tf
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
data "archive_file" "signer" {
type = "zip"
output_path = "${path.module}/signer.zip"
source {
filename = "lambda_function.py"
content = file("${path.module}/signer.py")
}
source {
filename = "config.ini"
content = <<-EOT
[default]
s3_bucket_region = ${var.region}
s3_bucket = ${aws_s3_bucket.private.bucket}
s3_object = ${aws_s3_object.test.key}
cf_domain = ${var.domain_name}
pepper = ${random_password.pepper.result}
EOT
}
}
resource "aws_lambda_function" "signer" {
provider = aws.acm
filename = data.archive_file.signer.output_path
function_name = "signer"
handler = "lambda_function.lambda_handler"
publish = true
role = aws_iam_role.reader.arn
runtime = "python3.9"
source_code_hash = data.archive_file.signer.output_base64sha256
}