-
Notifications
You must be signed in to change notification settings - Fork 199
/
Copy pathmain.tf
48 lines (39 loc) · 1.16 KB
/
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
module "hello-lambda-function" {
source = "terraform-aws-modules/lambda/aws"
version = ">= 2.24.0"
architectures = compact([var.architecture])
function_name = var.name
handler = "io.opentelemetry.lambda.sampleapps.okhttp.OkHttpRequestHandler::handleRequest"
runtime = var.runtime
create_package = false
local_existing_package = "${path.module}/../../build/libs/okhttp-all.jar"
memory_size = 384
timeout = 20
layers = compact([
var.collector_layer_arn,
var.sdk_layer_arn
])
environment_variables = {
AWS_LAMBDA_EXEC_WRAPPER = "/opt/otel-proxy-handler"
}
tracing_mode = var.tracing_mode
attach_policy_statements = true
policy_statements = {
s3 = {
effect = "Allow"
actions = [
"s3:ListAllMyBuckets"
]
resources = [
"*"
]
}
}
}
module "api-gateway" {
source = "../../../../../utils/terraform/api-gateway-proxy"
name = var.name
function_name = module.hello-lambda-function.lambda_function_name
function_invoke_arn = module.hello-lambda-function.lambda_function_invoke_arn
enable_xray_tracing = var.tracing_mode == "Active"
}