IAM policy example: deploy code to one Lambda function, with a least privilege rewrite
Facts read 16 Nov 2026. Page reviewed 16 Nov 2026.
Allows a deployment role to upload new code, change the configuration and publish a version of one function. It cannot create functions or change who may invoke them. The original allows the Update wildcard on every function in a Region.
Open the workbench ยท All examples
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Deploy",
"Effect": "Allow",
"Action": [
"lambda:Update*",
"lambda:PublishVersion",
"lambda:GetFunction"
],
"Resource": "arn:aws:lambda:us-east-1:111122223333:function:*"
}
]
}
What it allows
- Allows update actions, version publishing and function reads on every function in one Region.
What it allows
Allow 15 actions (lambda:Update*, lambda:PublishVersion, lambda:GetFunction) on arn:aws:lambda:us-east-1:111122223333:function:*.
Action or pattern Actions Access levels lambda:Update*13 Write 13 lambda:PublishVersion1 Write 1 lambda:GetFunction1 Read 1
Checks
No flags from the six checks.
The Update wildcard covers 13 actions and the resource covers every function, so the role can alter any function in the account.
Least privilege rewrite
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DeployOne",
"Effect": "Allow",
"Action": [
"lambda:UpdateFunctionCode",
"lambda:UpdateFunctionConfiguration",
"lambda:PublishVersion",
"lambda:GetFunction"
],
"Resource": "arn:aws:lambda:us-east-1:111122223333:function:my-function"
}
]
}
The rewrite names four actions and one function ARN. Updates to aliases, event source mappings and function URL settings are removed.
What it allows
Allow 4 actions (lambda:UpdateFunctionCode, lambda:UpdateFunctionConfiguration, lambda:PublishVersion, lambda:GetFunction) on arn:aws:lambda:us-east-1:111122223333:function:my-function.
Action or pattern Actions Access levels lambda:UpdateFunctionCode1 Write 1 lambda:UpdateFunctionConfiguration1 Write 1 lambda:PublishVersion1 Write 1 lambda:GetFunction1 Read 1
Checks
No flags from the six checks.
Related pages
Sources
- AWS Lambda Developer Guide: permissions, read 16 Nov 2026
- AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026), read 16 Nov 2026
Last reviewed 16 Nov 2026.