Amazon Q Business will no longer be open to new customers starting on July 31, 2026. If you would like to use the service, please sign up prior to July 30. For capabilities similar to Q Business, explore Amazon Quick. Learn more.
IAM roles for custom document enrichment in Amazon Q Business
Custom document enrichment (CDE) is an Amazon Q Business feature that you can use to manipulate your document content and document attributes. When you use the Lambda functions for CDE, you need an IAM role for the following:
-
A role for
PreExtractionHookConfigurationwith permissions to runPreExtractionHookConfigurationand to access the Amazon S3 bucket when you usePreExtractionHookConfiguration. -
A role for
PostExtractionHookConfigurationwith permissions to runPreExtractionHookConfigurationand to access the Amazon S3 bucket when you usePostExtractionHookConfiguration.
Important
IAM roles for Custom Document Enrichmmnt (CDE) Lambda functions should belong to the same account as the account using BatchPutDocument API operation or the CreateDataSource operation to configure CDE.
Both AWS Identity and Access Management (IAM) roles must have the permissions to:
-
Run
PreExtractionHookConfigurationand/orPostExtractionHookConfiguration. To apply advanced alterations of your document metadata and content during the ingestion process, configure a Lambda function forPreExtractionHookConfigurationand/orPostExtractionHookConfiguration. -
(Optional) If you choose to activate Server Side Encryption for your Amazon S3 bucket, you must provide permissions to use the AWS KMS key customer to encrypt and decrypt the objects stored in your Amazon S3 bucket.
A role policy to allow Amazon Q to run
PreExtractionHookConfiguration with encryption for your Amazon S3 bucket.
An role policy to allow Amazon Q to run
PreExtractionHookConfiguration without encryption.
A role policy to allow Amazon Q to run
PostExtractionHookConfiguration with encryption for your Amazon S3 bucket.
An role policy to allow Amazon Q to run
PostExtractionHookConfiguration without encryption.
We recommend that you include aws:sourceAccount and
aws:sourceArn in the trust policy. Their inclusion limits permissions and
securely checks if aws:sourceAccount and aws:sourceArn are the
same values as provided in the IAM role policy for the
sts:AssumeRole action. This approach prevents unauthorized entities from
accessing your IAM roles and their permissions. For more information, see
confused
deputy problem in the IAM User Guide.