File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ data "aws_iam_policy_document" "update_lambda" {
23
23
sid = " LambdaUpdateEvent"
24
24
25
25
actions = [
26
- " lambda:AddPermission" ,
27
26
" lambda:UpdateFunctionCode" ,
28
27
" lambda:UpdateFunctionConfiguration" ,
29
28
" lambda:UpdateAlias" ,
@@ -46,6 +45,17 @@ data "aws_iam_policy_document" "update_lambda" {
46
45
resources = [" arn:aws:apigateway:${ data . aws_region . current . name } ::/restapis/${ var . apigw_id } /*" ]
47
46
}
48
47
}
48
+
49
+ dynamic "statement" {
50
+ for_each = var. enable_version_identifier ? [1 ] : []
51
+ content {
52
+ sid = " AllowLambdaAddPermissions"
53
+ actions = [
54
+ " lambda:AddPermission" ,
55
+ ]
56
+ resources = [" arn:aws:lambda:${ data . aws_region . current . name } :${ data . aws_caller_identity . current . account_id } :function:${ var . function_prefix } *" ]
57
+ }
58
+ }
49
59
}
50
60
51
61
data "aws_iam_policy_document" "update_lambda_combined" {
You can’t perform that action at this time.
0 commit comments