# IAM policy example: invoke one Lambda function, with a least privilege rewrite

Facts read 16 Nov 2026. Page reviewed 16 Nov 2026.

Allows a principal to invoke a single Lambda function, my-function, in one Region and account. The original uses lambda:* on every function. The rewrite keeps one action and one function ARN. Resource names and account 111122223333 are placeholders used in AWS documentation.

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "InvokeAny",
      "Effect": "Allow",
      "Action": "lambda:*",
      "Resource": "*"
    }
  ]
}
```

## What it allows

- Allows every Lambda action on every function in every Region.

- Allows 135 actions (lambda:*) on every resource.

Checks:
- high: Allows 76 write or permissions-management actions (8 permissions management) on every resource ("Resource": "*"). (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html)

The action lambda:* covers 135 actions, including code updates and permission changes on all functions.

## Least privilege rewrite

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "InvokeOne",
      "Effect": "Allow",
      "Action": "lambda:InvokeFunction",
      "Resource": "arn:aws:lambda:us-east-1:111122223333:function:my-function"
    }
  ]
}
```

The rewrite grants InvokeFunction on one function ARN. Updating code and editing function permissions are removed.

- Allows 1 action (lambda:InvokeFunction) on arn:aws:lambda:us-east-1:111122223333:function:my-function.

Checks:
- No flags.

- [Paste it into the workbench](/)
- [Every Lambda action and its access level](/actions/lambda/)

## Related pages

- [IAM policy example: deploy code to one Lambda function](/examples/lambda-deploy-one-function/)
- [IAM policy example: let a Lambda function write logs](/examples/lambda-execution-role-write-logs/)
- [IAM policy example: let Lambda poll one SQS queue](/examples/lambda-sqs-event-source-permissions/)
- [All of them](/examples/)

## Sources

- AWS Lambda Developer Guide: permissions: https://docs.aws.amazon.com/lambda/latest/dg/lambda-permissions.html (read 16 Nov 2026)
- AWS Lambda Developer Guide: resource-based policies: https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html (read 16 Nov 2026)
- AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026): https://docs.aws.amazon.com/service-authorization/latest/reference/service-reference.html (read 16 Nov 2026)

Last reviewed 16 Nov 2026. Canonical: https://iampolicygenerator.com/examples/lambda-invoke-one-function/

This site is not affiliated with Amazon Web Services. AWS service and product names are used only to describe AWS services.
