-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
25 lines (22 loc) · 989 Bytes
/
main.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
data "aws_caller_identity" "current" {}
data "aws_region" "current" {}
locals {
function_name = "event-to-slack-lambda-function"
function_python_version = "3.7"
}
module "function_package" {
source = "github.com/doi-t/terraform-lambda-python-package?ref=v0.2.0"
package_name = "${local.function_name}"
python_version = "${local.function_python_version}"
source_dir = "src/event_to_slack"
}
resource "aws_lambda_function" "event_to_slack" {
filename = "${module.function_package.package_file_path}"
source_code_hash = "${module.function_package.zip_package_sha256}"
function_name = "${local.function_name}"
layers = ["${aws_lambda_layer_version.event_to_slack_lambda_layer.layer_arn}"]
role = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:role/lambda_basic_execution"
handler = "main.handler"
runtime = "python${local.function_python_version}"
timeout = 300
}