File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,6 +105,11 @@ Parameters:
105105 Description : The ARN of the policy used to set the permissions boundary for the role.
106106 Default : " "
107107
108+ ManagedPolicyARNs :
109+ Type : CommaDelimitedList
110+ Description : Optional - Comma separated list of managed IAM policy ARNs to attach to the Lambda execution role.
111+ Default : " "
112+
108113 LogRetentionDays :
109114 Type : Number
110115 Description : The number of days to retain the Cloudwatch Logs of the lambda.
@@ -138,8 +143,9 @@ Parameters:
138143 - " false"
139144 Default : " false"
140145
141-
142146Conditions :
147+ HasManagedPolicyARNs :
148+ !Not [ !Equals [ !Join [ "", !Ref ManagedPolicyARNs ], "" ] ]
143149 CreateRole :
144150 !Equals [ !Ref AutoscalingLambdaExecutionRole, '' ]
145151 UseKmsKeyForParameterStore :
@@ -202,8 +208,15 @@ Resources:
202208 - lambda.amazonaws.com
203209 Action :
204210 - sts:AssumeRole
205- ManagedPolicyArns :
206- - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
211+ ManagedPolicyArns : !If
212+ - HasManagedPolicyARNs
213+ - !Split
214+ - ' ,'
215+ - !Join
216+ - ' ,'
217+ - - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
218+ - !Join [ ',', !Ref ManagedPolicyARNs ]
219+ - - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
207220 Policies :
208221 - PolicyName : AutoScalingGroups
209222 PolicyDocument :
You can’t perform that action at this time.
0 commit comments