Skip to main content

Lambda

Example permissions policy

This policy grants access to create, update, delete and invoke Lambda functions. It only allows executing functions whose names begin with the "Deserted-Chateau-Test" prefix.

Note the iam:PassRole permission; when you attach this policy to a user, that user needs permission to assume the Lambda execution role that actually executes your function.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "lambda:CreateFunction",
                "lambda:UpdateFunctionCode",
                "iam:PassRole",
                "lambda:InvokeFunction",
                "lambda:GetLayerVersion",
                "lambda:UpdateFunctionConfiguration",
                "lambda:DeleteFunction"
            ],
            "Resource": [
                "arn:aws:iam::<AWS account number>:role/Deserted-Chateau-Test-Lambda-Execution-Role",
                "arn:aws:lambda:<AWS region>:<AWS account number>:function:Deserted-Chateau-Test*",
                "arn:aws:lambda:<AWS region>:<AWS account number>:layer:*:*"
            ]
        }
    ]
}