-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlambda.tf
28 lines (23 loc) · 1.05 KB
/
lambda.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
resource "aws_lambda_function" "controller" {
s3_bucket = var.lambda_s3_bucket
s3_key = "${var.lambda_s3_prefix}/schism-lambda-${var.lambda_function.controller.version}.zip"
function_name = "${var.prefix}-${var.lambda_function.controller.name}"
handler = "schism-lambda-${var.lambda_function.controller.version}"
role = aws_iam_role.lambda_controller.arn
runtime = var.lambda_function.controller.runtime
timeout = var.lambda_function.controller.timeout
depends_on = [
aws_iam_role_policy_attachment.controller_ca_certificate_mgmt,
aws_iam_role_policy_attachment.controller_signed_certificate_mgmt,
aws_iam_role_policy_attachment.controller_cloudwatch_mgmt
]
environment {
variables = {
SCHISM_CA_KMS_KEY_ID = var.kms_key.ca_certs.key_id
SCHISM_CA_PARAM_PREFIX = "${var.prefix}-${var.ssm.ca_param_prefix}"
SCHISM_CERTS_S3_BUCKET = aws_s3_bucket.certificate_storage.bucket
SCHISM_CERTS_S3_PREFIX = "${var.prefix}/"
SCHISM_HOST_CA_AUTH_DOMAIN = var.host_ca_auth_domain
}
}
}