Sigma automatically generates the execution permissions for your serverless function based on the API operations used in the code. However in some cases you may need to customize or add to these auto-generated permissions:
params
block and then invoking s3.putObject(params)
,
instead of s3.putObject({Bucket: ... /* inline parameter block */})
You can access the permissions customization dialog via the Permissions button (containing the key icon) on the right side pane of the editor:
The dialog contains three panes;
You can edit the permission definitions under Custom Permissions in order to associate additional permissions with your function.
On AWS, a permission generation UI is also available for your convenience, via the Statement Generator button on the top right:
Allow
).Resource
of the IAM permission).
The generator will provide a list of fields, which you can fill in order to auto-generate the ARN.
Alternatively if you already have the ARN, simply turn off the Guided switch and enter the ARN into the input field.For example, if your Lambda function invokes
AWS.Textract.DetectDocumentText
upon objects stored in a S3 bucket,
which requires the textract:DetectDocumentText
permission on Textract service
and an additional s3:GetObject
permission for retrieving the source S3 object from the relevant bucket (say acme.data.ocr
),
the final custom permissions block would look like this:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Resource": "*",
"Action": [
"textract:DetectDocumentText"
]
},
{
"Effect": "Allow",
"Resource": "arn:aws:s3:::acme.data.ocr/*",
"Action": [
"s3:GetObject"
]
}
]
}
NOTE: If you wish to customize the complete IAM role of your function (e.g. assign a managed policy), you can use the deployment template editor instead; to override the autogenerated IAM role definition.