-
Notifications
You must be signed in to change notification settings - Fork 2
/
lambda.tf
executable file
·148 lines (136 loc) · 4.58 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#
# initQuery Lambda Function
#
resource "aws_lambda_permission" "APIinitQuery" {
statement_id = "AllowinitQueryInvoke"
action = "lambda:InvokeFunction"
function_name = module.lambda-initQuery.function_name
principal = "apigateway.amazonaws.com"
source_arn = "${aws_api_gateway_rest_api.VPApi.execution_arn}/*/*/${aws_api_gateway_resource.submit.path_part}"
}
resource "aws_lambda_function_recursion_config" "APIinitQuery" {
function_name = module.lambda-initQuery.function_name
recursive_loop = "Allow"
}
#
# getResultsURL Lambda Function
#
resource "aws_lambda_permission" "APIgetResultsURL" {
statement_id = "AllowgetResultsURLInvoke"
action = "lambda:InvokeFunction"
function_name = module.lambda-getResultsURL.function_name
principal = "apigateway.amazonaws.com"
source_arn = "${aws_api_gateway_rest_api.VPApi.execution_arn}/*/*/${aws_api_gateway_resource.results-url.path_part}"
}
#
# queryVCF Lambda Function
#
resource "aws_lambda_permission" "SNSLambdaqueryVCF" {
statement_id = "SNSLambdaqueryVCF"
action = "lambda:InvokeFunction"
function_name = module.lambda-queryVCF.function_name
principal = "sns.amazonaws.com"
source_arn = aws_sns_topic.queryVCF.arn
}
resource "aws_lambda_function_recursion_config" "SNSLambdaqueryVCF" {
function_name = module.lambda-queryVCF.function_name
recursive_loop = "Allow"
}
#
# queryVCFsubmit Lambda Function
#
resource "aws_lambda_permission" "SNSLambdaqueryVCFsubmit" {
statement_id = "SNSLambdaqueryVCFsubmit"
action = "lambda:InvokeFunction"
function_name = module.lambda-queryVCFsubmit.function_name
principal = "sns.amazonaws.com"
source_arn = aws_sns_topic.queryVCFsubmit.arn
}
#
# queryGTF Lambda Function
#
resource "aws_lambda_permission" "SNSLambdaqueryGTF" {
statement_id = "SNSLambdaqueryGTF"
action = "lambda:InvokeFunction"
function_name = module.lambda-queryGTF.function_name
principal = "sns.amazonaws.com"
source_arn = aws_sns_topic.queryGTF.arn
}
resource "aws_lambda_function_recursion_config" "SNSLambdaqueryGTF" {
function_name = module.lambda-queryGTF.function_name
recursive_loop = "Allow"
}
#
# pluginConsequence Lambda Function
#
resource "aws_lambda_permission" "SNSLambdapluginConsequence" {
statement_id = "SNSLambdapluginConsequence"
action = "lambda:InvokeFunction"
# TODO: Update to reference function_name once terraform-aws-lambda is updated
function_name = module.lambda-pluginConsequence.lambda_function_name
principal = "sns.amazonaws.com"
source_arn = aws_sns_topic.pluginConsequence.arn
}
resource "aws_lambda_function_recursion_config" "SNSLambdapluginConsequence" {
# TODO: Update to reference function_name once terraform-aws-lambda is updated
function_name = module.lambda-pluginConsequence.lambda_function_name
recursive_loop = "Allow"
}
#
# pluginUpdownstream Lambda Function
#
resource "aws_lambda_permission" "SNSLambdapluginUpdownstream" {
statement_id = "SNSLambdapluginUpdownstream"
action = "lambda:InvokeFunction"
function_name = module.lambda-pluginUpdownstream.function_name
principal = "sns.amazonaws.com"
source_arn = aws_sns_topic.pluginUpdownstream.arn
}
#
# concat Lambda Function
#
resource "aws_lambda_permission" "SNSLambdaconcat" {
statement_id = "SNSLambdaconcat"
action = "lambda:InvokeFunction"
function_name = module.lambda-concat.function_name
principal = "sns.amazonaws.com"
source_arn = aws_sns_topic.concat.arn
}
#
# concatStarter Lambda Function
#
resource "aws_lambda_permission" "SNSLambdaconcatStarter" {
statement_id = "SNSLambdaconcatStarter"
action = "lambda:InvokeFunction"
function_name = module.lambda-concatStarter.function_name
principal = "sns.amazonaws.com"
source_arn = aws_sns_topic.concatStarter.arn
}
resource "aws_lambda_function_recursion_config" "SNSLambdaconcatStarter" {
function_name = module.lambda-concatStarter.function_name
recursive_loop = "Allow"
}
#
# createPages Lambda Function
#
resource "aws_lambda_permission" "SNSLambdacreatePages" {
statement_id = "SNSLambdacreatePages"
action = "lambda:InvokeFunction"
function_name = module.lambda-createPages.function_name
principal = "sns.amazonaws.com"
source_arn = aws_sns_topic.createPages.arn
}
resource "aws_lambda_function_recursion_config" "SNSLambdacreatePages" {
function_name = module.lambda-createPages.function_name
recursive_loop = "Allow"
}
#
# concatPages Lambda Function
#
resource "aws_lambda_permission" "SNSLambdaconcatPages" {
statement_id = "SNSLambdaconcatPages"
action = "lambda:InvokeFunction"
function_name = module.lambda-concatPages.function_name
principal = "sns.amazonaws.com"
source_arn = aws_sns_topic.concatPages.arn
}