-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlambda_functions.tf
52 lines (45 loc) · 1.73 KB
/
lambda_functions.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
49
50
51
52
module "post_hooks_lambda" {
source = "./modules/lambda_function"
function_name = "post-hooks"
dynamodb_permission = "PutItem"
dynamodb_table_arn = aws_dynamodb_table.tf_webhooks.arn
api_gateway_execution_arn = aws_apigatewayv2_api.this.execution_arn
environment_variables = {
GITHUB_OWNER = var.github_owner
GITHUB_REPOSITORIES = jsonencode(var.github_repositories)
}
}
module "get_hooks_lambda" {
source = "./modules/lambda_function"
function_name = "get-hooks"
dynamodb_permission = "Query"
dynamodb_table_arn = aws_dynamodb_table.tf_webhooks.arn
api_gateway_execution_arn = aws_apigatewayv2_api.this.execution_arn
environment_variables = {
GITHUB_OWNER = var.github_owner
GITHUB_REPOSITORIES = jsonencode(var.github_repositories)
}
}
module "delete_hooks_lambda" {
source = "./modules/lambda_function"
function_name = "delete-hooks"
dynamodb_permission = "DeleteItem"
dynamodb_table_arn = aws_dynamodb_table.tf_webhooks.arn
api_gateway_execution_arn = aws_apigatewayv2_api.this.execution_arn
environment_variables = {
GITHUB_OWNER = var.github_owner
GITHUB_REPOSITORIES = jsonencode(var.github_repositories)
}
}
module "webhook_relay_lambda" {
source = "./modules/lambda_function"
function_name = "webhook-relay"
dynamodb_permission = "Query"
dynamodb_table_arn = aws_dynamodb_table.tf_webhooks.arn
api_gateway_execution_arn = aws_apigatewayv2_api.this.execution_arn
environment_variables = {
GITHUB_WEBHOOK_SECRET = local.webhook_secret
GITHUB_OWNER = var.github_owner
GITHUB_REPOSITORIES = jsonencode(var.github_repositories)
}
}