In this section, we’ll ensure that our AWS Lambda function has the necessary permissions to access both the S3 bucket and the OpenSearch Service cluster. This involves modifying the policies associated with both resources.