Make sure you have given CloudWatch Logs permission to execute your function
To give CloudWatch Logs permission to execute your function, you can follow these steps:
- Open the AWS Management Console and navigate to the Lambda service.
- Select your function from the list.
- In the "Designer" section, click on the name of the function's execution role under "Permissions".
- This will take you to the IAM console, where you can manage the function's role.
- Click on "Attach policies" to add a new policy to the role.
- Search for "CloudWatchLogsFullAccess" in the policy search bar and select it.
- Click on "Attach policy" to attach the policy to the role.
- Go back to the Lambda function configuration.
- Under the "Designer" section, click on the "Add trigger" button.
- Select "CloudWatch Logs" as the trigger type.
- Configure the trigger settings according to your requirements (e.g., log group, filter pattern).
- Click on "Add" to add the trigger to your function.
- Save the changes to your Lambda function configuration.
By following these steps, you have given CloudWatch Logs permission to execute your function and can now monitor its logs through CloudWatch
原文地址: https://www.cveoy.top/t/topic/hLvj 著作权归作者所有。请勿转载和采集!