Hi I have a lot of lambda functions that needs lambda:UpdateFunctionCode
permission. Its too troublesome to input all the functions' ARNs in the resource field. All my functions has a prefix, when I try to use prefix*
in the resource field it does not allow me.
This is what I tried but didn't work.
"arn:aws:lambda:ap-southeast-1:xxxxxxxx:function:prefix*"
Is there a way I can use a wildcard for this?
Edit: added a fake account number.
Open the Functions page of the Lambda console. Choose a function. Choose Configuration and then choose Permissions. Scroll down to Resource-based policy and then choose View policy document.
You can further restrict access using lambda:AddPermission and lambda:RemovePermission to a principal that is included in a passed policy. You can also limit lambda:UpdateEventSourceMapping and lambda:DeleteEventSourceMapping to a particular event source mapping.
Lambda execution role permissions are given in the form of specific API action identifiers (for example, s3:GetObject). These action identifiers are listed in the Action element of an IAM policy statement.
Wildcard permissions grant broad permissions, often for many permissions or resources. Many AWS managed policies, such as AdministratorAccess , provide broad access intended only for user roles. These should never be applied to Lambda functions.
Although this is a good feature to have but I have verified with AWS support
(1) Function name format cannot include "*" (https://docs.aws.amazon.com/lambda/latest/dg/API_AddPermission.html#SSS-AddPermission-request-FunctionName)
(2) they have submit a feature request internally. The support also suggest you could also raise the concerns on the Github[3][4] page so that the Quickstart team can directly address them.
[3] https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#resource-types
[4] https://github.com/awslabs/serverless-application-model/issues
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With