- Newest
- Most votes
- Most comments
Based on the error message you're encountering when trying to create the $LATEST.PUBLISHED version of your Lambda function, it appears to be a permissions issue with the execution role.
The $LATEST.PUBLISHED version is a feature specific to Lambda Managed Instances that allows you to create or republish a latest published version without managing numbered versions. When you try to publish this version, Lambda needs appropriate permissions.
Looking at your IAM policy, I notice a potential issue with the Resource section. The second resource ARN appears to be incorrectly formatted:
"arn:aws:iam::206779301971:role/arn:aws:lambda:eu-west-1:123456789012:function:my-function"
This doesn't look like a valid IAM role ARN format. It seems to be combining a role ARN with a function ARN.
Additionally, when working with Lambda Managed Instances and the $LATEST.PUBLISHED version, you need to ensure:
- The execution role has the necessary permissions to publish versions
- The IAM policy attached to the role is correctly formatted
- The account numbers in your ARNs are consistent
To troubleshoot further, you could:
- Check the actual execution role attached to your Lambda function (not just the policies you've added)
- Use the
get-policycommand to view the resource-based policy of your function - Ensure the account number in your ARNs matches your actual AWS account
- Fix the malformed role ARN in your policy
The error message is unfortunately not very descriptive, but it's indicating that the execution role Lambda is using doesn't have the permissions needed for this specific operation.
Sources
$LATEST.PUBLISHED version in Lambda Managed Instances - AWS Lambda
Viewing resource-based IAM policies in Lambda - AWS Lambda
answered 10 months ago
In your IAM role, where you have listed the resources. Can you change
from
"arn:aws:lambda:eu-west-1:123456789012:function:my-function"
to
"arn:aws:lambda:eu-west-1:123456789012:function:my-function*"
When you publish multiple versions the arn will contain the version number and the arn will be like below.
"arn:aws:lambda:eu-west-1:123456789012:function:my-function:1"
Good catch and I wish that was it! I tried adding the wildcard to both resource ARNs but it's still failing.

I think you'll find from my policy document that it indeed has
"lambda:PublishVersion". Furthermore, all of your steps (bar one) I already went through since how else would I have published the policy document. I fixed my typo in the role ARN you spotted, but still getting the error:Couldn't create version 4 of function my-function: The function's execution role doesn't have permission to perform this operation..Can you post your latest policy along with role you mentioned, must be a problem in resource section.