Skip to content
IAM Policy Generator

IAM policy example: deploy code to one Lambda function, with a least privilege rewrite

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

  1. Allow 15 actions (lambda:Update*, lambda:PublishVersion, lambda:GetFunction) on arn:aws:lambda:us-east-1:111122223333:function:*.

    Action or patternActionsAccess levels
    lambda:Update*13Write 13
    lambda:PublishVersion1Write 1
    lambda:GetFunction1Read 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

  1. Allow 4 actions (lambda:UpdateFunctionCode, lambda:UpdateFunctionConfiguration, lambda:PublishVersion, lambda:GetFunction) on arn:aws:lambda:us-east-1:111122223333:function:my-function.

    Action or patternActionsAccess levels
    lambda:UpdateFunctionCode1Write 1
    lambda:UpdateFunctionConfiguration1Write 1
    lambda:PublishVersion1Write 1
    lambda:GetFunction1Read 1

Checks

No flags from the six checks.

Sources

  1. AWS Lambda Developer Guide: permissions, read 16 Nov 2026
  2. AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026), read 16 Nov 2026

Last reviewed 16 Nov 2026.