File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 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" {
2323 sid = " LambdaUpdateEvent"
2424
2525 actions = [
26- " lambda:AddPermission" ,
2726 " lambda:UpdateFunctionCode" ,
2827 " lambda:UpdateFunctionConfiguration" ,
2928 " lambda:UpdateAlias" ,
@@ -46,6 +45,17 @@ data "aws_iam_policy_document" "update_lambda" {
4645 resources = [" arn:aws:apigateway:${ data . aws_region . current . name } ::/restapis/${ var . apigw_id } /*" ]
4746 }
4847 }
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+ }
4959}
5060
5161data "aws_iam_policy_document" "update_lambda_combined" {
You can’t perform that action at this time.
0 commit comments