AWS Services and IAM Role Requirements for GenAI IDP Accelerator
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: MIT-0
AWS Services and IAM Role Requirements for GenAI IDP Accelerator
Section titled “AWS Services and IAM Role Requirements for GenAI IDP Accelerator”This document outlines the AWS services used by the GenAI Intelligent Document Processing (IDP) Accelerator solution, along with the IAM role scopes needed for deployment and operation.
Architecture note: The solution now uses a unified pattern stack (
patterns/unified/) controlled by theuse_bdaconfiguration flag, rather than the historical separate Pattern 1/2/3 stacks. “BDA mode” (use_bda: true) uses Bedrock Data Automation; “Pipeline mode” (use_bda: false) uses Textract OCR + Bedrock classification/extraction. References to “Pattern 1/2/3” below are retained only where they aid historical understanding.
AWS Services Used
Section titled “AWS Services Used”Core Infrastructure Services
Section titled “Core Infrastructure Services”| Service | Usage | Deployment | Runtime |
|---|---|---|---|
| Amazon S3 | Stores input documents, processed outputs, and web UI assets | ✓ | ✓ |
| Amazon DynamoDB | Tracks document processing, manages configurations and concurrency | ✓ | ✓ |
| AWS Lambda | Executes document processing functions and business logic | ✓ | ✓ |
| AWS Step Functions | Orchestrates document processing workflows | ✓ | ✓ |
| Amazon SQS | Queues documents for processing and handles throttling | ✓ | ✓ |
| Amazon EventBridge | Triggers document processing workflows when files are uploaded | ✓ | ✓ |
| Amazon CloudFront | Delivers the web UI with global distribution (default hosting mode) | ✓ | ✓ |
| Amazon API Gateway | Backs the web UI’s data API, and can alternatively serve the web UI itself (S3 proxy) for VPC-based deployments (see API Gateway Hosting) | ✓ | ✓ |
| Amazon ECR | Stores container images for the pattern processing Lambda functions (OCR, classification, extraction, etc., which are deployed as container images) | ✓ | ✓ |
| AWS CloudFormation | Deploys and manages the solution infrastructure | ✓ | |
| AWS SAM | Simplifies serverless application deployment | ✓ | |
| AWS CodeBuild | Builds and packages the web UI assets and pattern container images | ✓ | |
| AWS Systems Manager (Parameter Store) | Stores and retrieves runtime configuration/settings parameters | ✓ | ✓ |
AI/ML Services
Section titled “AI/ML Services”| Service | Usage | Deployment | Runtime |
|---|---|---|---|
| Amazon Bedrock | Provides foundation models for document understanding | ✓ | ✓ |
| Amazon Bedrock Guardrails | Enforces content safety, information security, model usage policies, and Automated Reasoning Checks | ✓ | ✓ |
| Amazon Textract | Extracts text and data from documents (OCR) in Pipeline mode | ✓ | |
| Amazon SageMaker (MLflow) | Optional managed MLflow tracking server for logging processing metrics/experiments (enabled via MlflowTrackingServerArn) | ✓ | |
| Amazon Bedrock Knowledge Base | Enables semantic document querying (optional) — backed by S3 Vectors (default) or OpenSearch Serverless | ✓ | ✓ |
| Bedrock Data Automation (BDA) | Automates document processing workflows (BDA mode, use_bda: true) | ✓ | ✓ |
| Amazon Bedrock AgentCore | Optional MCP gateway for external application access (enabled via EnableMCP) | ✓ | ✓ |
Auth & API Services
Section titled “Auth & API Services”| Service | Usage | Deployment | Runtime |
|---|---|---|---|
| Amazon Cognito | Manages user authentication and authorization | ✓ | ✓ |
| AWS AppSync | Provides GraphQL API for the web UI | ✓ | ✓ |
| AWS WAF | Protects web applications from web exploits (optional) | ✓ | ✓ |
| AWS Marketplace (Agreement / Catalog / Entitlement) | Subscription checks for paid Feature Platform extensions. In the host stack, buyer-side SearchAgreements. In the optional Seller Entitlement Service (deployed separately, into a seller account), seller-side SearchAgreements + ListEntities | — | ✓ |
Monitoring & Operations
Section titled “Monitoring & Operations”| Service | Usage | Deployment | Runtime |
|---|---|---|---|
| Amazon CloudWatch | Provides monitoring, logging, and alerting | ✓ | ✓ |
| AWS SNS | Delivers operational alerts and notifications | ✓ | ✓ |
| AWS KMS | Manages encryption keys for secure data storage | ✓ | ✓ |
Analytics & Reporting
Section titled “Analytics & Reporting”| Service | Usage | Deployment | Runtime |
|---|---|---|---|
| AWS Glue | Data Catalog (database + tables) and crawler for evaluation/reporting metrics, including the metering_hourly, metering_daily, metering_docs_hourly, metering_docs_daily, control_plane_hourly, and data_plane_lambda_hourly rollup tables added by the Reporting SQL Layer | ✓ | ✓ |
| Amazon Athena | Queries evaluation/metering/rollup tables for analytics; scheduled DataMartRollupFunction writes INSERT INTO the rollup tables hourly + daily | ✓ | ✓ |
| AWS Resource Groups Tagging API | The DataMartRollupFunction uses tag:GetResources to discover Lambdas in this stack’s tree (root + nested) for control-plane cost attribution | ✓ | |
| Amazon OpenSearch Serverless | Optional vector store for the Bedrock Knowledge Base (the default vector store is S3 Vectors; KnowledgeBaseVectorStore: OPENSEARCH_SERVERLESS selects this instead) | ✓ | ✓ |
IAM Role Requirements
Section titled “IAM Role Requirements”Enterprise Deployment Considerations
Section titled “Enterprise Deployment Considerations”For organizations with Service Control Policies (SCPs) that mandate permissions boundaries on all IAM roles, the solution provides comprehensive support through the PermissionsBoundaryArn parameter. This optional parameter can be specified during deployment to attach a permissions boundary to all IAM roles (both explicit roles and implicit roles created by AWS SAM functions).
Usage:
aws cloudformation deploy \ --template-file template.yaml \ --parameter-overrides PermissionsBoundaryArn=arn:aws:iam::123456789012:policy/MyPermissionsBoundary \ --capabilities CAPABILITY_IAMWhen no permissions boundary is specified, roles deploy normally, ensuring backward compatibility.
Deployment Roles
Section titled “Deployment Roles”Deploying this solution requires an IAM role/user with the following permissions.
Ready-to-use CloudFormation service role: Rather than granting these permissions directly to deploying users, administrators can provision the example CloudFormation service role in iam-roles/cloudformation-management/. It bundles the deployment permissions below into a single role that CloudFormation assumes on a user’s behalf, so developers/DevOps can deploy and manage IDP stacks with only
iam:PassRoleinstead of broad administrator access. See also Deployment → Administrator Access Requirements.
Essential Permissions
Section titled “Essential Permissions”cloudformation:*- Create and manage CloudFormation stacksiam:*- Create and manage IAM roles and policieslambda:*- Create and configure Lambda functionsstates:*- Create and manage Step Functions state machiness3:*- Create buckets and manage S3 resourcesdynamodb:*- Create and configure DynamoDB tablessqs:*- Create and configure SQS queuesevents:*- Create and configure EventBridge rulescloudfront:*- Create and configure CloudFront distributionscognito-idp:*- Create and configure Cognito user poolscognito-identity:*- Create and configure Cognito identity pools for AWS service accessappsync:*- Create and configure AppSync APIslogs:*- Create and configure CloudWatch log groupscloudwatch:*- Create and configure CloudWatch dashboards and alarmssns:*- Create and configure SNS topics
Feature-Specific Permissions
Section titled “Feature-Specific Permissions”bedrock:*- Create and invoke Bedrock resources (all modes)textract:*- OCR via Amazon Textract (Pipeline mode)ecr:*- Create ECR repositories and push pattern container imagesglue:*,athena:*- Create the reporting database/tables and run analytics queries (evaluation reporting)aoss:*/opensearch-serverless:*- Create OpenSearch Serverless collections (Knowledge Base feature, only whenKnowledgeBaseVectorStore: OPENSEARCH_SERVERLESS; the default S3 Vectors store does not need this)sagemaker:*- Optional MLflow tracking server integration (only when MLflow is enabled)kms:*- Create KMS keys for encryptionwafv2:*- Configure WAF rules (optional)glue:*/codebuild:*/ssm:*- Supporting build, configuration, and reporting infrastructure
Note: Earlier releases used Amazon SageMaker to host a UDOP classification endpoint (the former “Pattern 3”). The unified architecture no longer deploys a SageMaker inference endpoint; document classification is performed by Bedrock foundation models (with optional custom/fine-tuned model ARNs). SageMaker now appears only in the optional MLflow tracking integration.
Runtime Roles
Section titled “Runtime Roles”The solution creates various IAM roles to run different components of the system. Key role scopes include:
Document Processing Roles
Section titled “Document Processing Roles”-
Queue Processing Role:
sqs:ReceiveMessage,sqs:DeleteMessage,sqs:GetQueueAttributesdynamodb:GetItem,dynamodb:PutItem,dynamodb:UpdateItemstates:StartExecutionstates:ListExecutions(read-only, scoped to this stack’s state machine — used to reconcile the workflow-concurrency counter against the executions that are really running, so a leaked counter cannot permanently stop the stack admitting documents)cloudwatch:PutMetricData(restricted by anIAMcondition to the stack’s own metric namespace — publishes the concurrency-counter drift theConcurrencyCounterDriftAlarmwatches)logs:CreateLogGroup,logs:CreateLogStream,logs:PutLogEvents
-
Step Functions Execution Role:
lambda:InvokeFunctionstates:*events:PutEvents
-
OCR Processing Role:
textract:AnalyzeDocument,textract:DetectDocumentTexts3:GetObject,s3:PutObjectlogs:*
-
Classification Role:
bedrock:InvokeModel,bedrock:InvokeModelWithResponseStream,bedrock:GetInferenceProfilebedrock:ApplyGuardrail(when Guardrails configured)s3:GetObject,s3:PutObjectdynamodb:GetItem,dynamodb:PutItem,dynamodb:UpdateItem(tracking & configuration tables)cloudwatch:PutMetricDatalogs:*- (Optional custom classification model invoked via Lambda hook / custom model ARN; no SageMaker endpoint is used.)
-
Extraction Role:
bedrock:InvokeModelbedrock:ApplyGuardrail(when Guardrails configured)s3:GetObject,s3:PutObjectlogs:*
-
BDA Integration Role (BDA mode,
use_bda: true):bedrock:InvokeDataAutomationAsyncbedrock:GetDataAutomationProject,bedrock:ListDataAutomationProjects,bedrock:GetBlueprint,bedrock:GetBlueprintRecommendations3:GetObject,s3:PutObjectdynamodb:GetItem,dynamodb:PutItem,dynamodb:UpdateItemssm:GetParameter,ssm:PutParametercloudwatch:PutMetricDatalogs:*
Web UI & API Roles
Section titled “Web UI & API Roles”-
AppSync Service Role:
dynamodb:GetItem,dynamodb:Query,dynamodb:Scans3:GetObject,s3:PutObject,s3:ListBucketlambda:InvokeFunction
-
API Gateway CloudWatch Logging Role (created when
LogLevelisINFOorDEBUG):- Managed policy
AmazonAPIGatewayPushToCloudWatchLogs(assumed byapigateway.amazonaws.com) - Registered as the account-level API Gateway CloudWatch role (
AWS::ApiGateway::Account) to enable REST API stage access logging. This setting is per account per region and is retained on stack deletion so other stacks’ logging keeps working.
- Managed policy
-
Configuration Resolver Role (API resolver Lambda for configuration CRUD + Z3 RuleJSON generation):
dynamodb:GetItem,dynamodb:PutItem,dynamodb:UpdateItem,dynamodb:DeleteItem,dynamodb:Querys3:GetObject(configuration bucket)kms:Encrypt,kms:Decrypt,kms:GenerateDataKey*bedrock:InvokeModel(foundation models + inference profiles, for Z3 RuleJSON translation viagenerateRuleJsonmutation)bedrock:DeleteDataAutomationProject,bedrock:GetDataAutomationProject,bedrock:DeleteBlueprint,bedrock:ListBlueprints
-
Cognito Authentication Role:
appsync:GraphQLs3:GetObject(for UI assets and buckets)ssm:GetParameter(for settings)
-
Knowledge Base Query Role:
bedrock:InvokeModelbedrock:Retrievebedrock:RetrieveAndGeneratebedrock:ApplyGuardrail(when Guardrails configured)aoss:APIAccessAll(when using the OpenSearch Serverless vector store) ors3vectors:*(when using the default S3 Vectors store)logs:*
-
Knowledge Base Service Role:
bedrock:InvokeModelaoss:APIAccessAll(OpenSearch Serverless) or S3 Vectors access (default)s3:ListBucket,s3:GetObject(when using S3 data source)
Monitoring & Evaluation Roles
Section titled “Monitoring & Evaluation Roles”-
CloudWatch Dashboard Role:
cloudwatch:GetDashboard,cloudwatch:PutDashboardlogs:DescribeLogGroups
-
Workflow Tracking Role:
dynamodb:GetItem,dynamodb:PutItem,dynamodb:UpdateItemcloudwatch:PutMetricDatalogs:*
-
Evaluation Function Role:
s3:GetObject(from baseline bucket)s3:PutObject,s3:GetObject(for output bucket)dynamodb:GetItem,dynamodb:PutItem,dynamodb:UpdateItembedrock:InvokeModel(for LLM-based evaluations)appsync:GraphQL(for updating evaluation results)cloudwatch:PutMetricDatalogs:*
-
Reporting / Analytics Roles (evaluation reporting & analytics UI):
glue:GetDatabase,glue:GetTable,glue:GetPartitions(reporting database/tables)athena:StartQueryExecution,athena:GetQueryExecution,athena:GetQueryResults,athena:StopQueryExecutions3:GetObject,s3:PutObject,s3:ListBucket(reporting/Athena results buckets)logs:*
-
Data-Mart Rollup Lambda Role (
DataMartRollupFunction, scheduled hourly + daily):athena:StartQueryExecution,athena:GetQueryExecution,athena:GetQueryResults,athena:StopQueryExecution(writes rollup tables viaINSERT INTO)glue:GetDatabase,glue:GetTable,glue:GetPartitions,glue:CreatePartition,glue:BatchCreatePartition(partition management on rollup tables)cloudwatch:GetMetricData,cloudwatch:ListMetrics(*— API doesn’t support resource-level scoping) for readingAWS/Lambda/Duration,AWS/Lambda/Invocations,IDPControlPlane/AthenaBytesScanned,IDPControlPlane/BedrockInputTokens,IDPControlPlane/BedrockOutputTokenstag:GetResources(*— account-scoped API) for tag-based Lambda discoverycloudformation:ListStackResources(scoped to this stack + its nested stacks) to walk the stack treelambda:GetFunctionConfiguration(scoped to functions in this account/region) for accurate per-Lambda memory + architecture in the cost estimates3:GetObject,s3:PutObject,s3:ListBucket,s3:GetBucketLocation(reporting bucket only;GetBucketLocationis also needed by Athena’sStartQueryExecutionon the OutputLocation bucket).HeadObjectcalls are authorized bys3:GetObject— there is nos3:HeadObjectIAM actions3:AbortMultipartUpload,s3:ListBucketMultipartUploads,s3:ListMultipartUploadParts(reporting bucket only) — part of AWS’s reference policy for AthenaINSERT INTO, which switches to a multipart upload once a result part exceeds its buffersqs:SendMessageon its DLQ (async-failure destination)- KMS on the stack CMK
-
Metering Hour Migration Lambda Role (
MeteringHourMigrationFunction, one-shot CFN custom resource):s3:ListBucket(reporting bucket) for listing pre-migration parquet filess3:GetObject,s3:PutObject,s3:DeleteObject(scoped tometering/*under the reporting bucket) for the copy-then-delete relocation- KMS on the stack CMK
- See Reporting SQL Layer §2.3 for the migration’s purpose (backwards-compat upgrade to the
hour-partitioned metering layout)
-
Control-Plane Lambda cost-telemetry (in-band, all control-plane Lambdas that hit Athena or Bedrock):
cloudwatch:PutMetricDatascoped to namespaceIDPControlPlane(already granted via the existing app-metrics grant)- The
idp_common.metrics.emit_control_plane_cost_metrichelper emitsIDPControlPlane/{AthenaBytesScanned,BedrockInputTokens,BedrockOutputTokens}with dims[Component, FunctionName, Model?]for the rollup Lambda to aggregate.
-
Glue Crawler Service Role:
glue:*(managedAWSGlueServiceRole) for crawling reporting datas3:GetObject,s3:ListBucketkms:Decrypt,kms:DescribeKey
Build & Optional Feature Roles
Section titled “Build & Optional Feature Roles”-
CodeBuild Roles (UI build and pattern container-image build):
s3:GetObject,s3:PutObject,s3:ListBucket(artifacts)ecr:*(push/scan container images),cloudfront:CreateInvalidation(UI)logs:CreateLogGroup,logs:CreateLogStream,logs:PutLogEventsec2:*networking actions (when deploying into a VPC)
-
AgentCore Gateway Execution Role (optional MCP integration,
EnableMCP: true):lambda:InvokeFunction(MCP handler)bedrock-agentcore:InvokeAgentRuntimelogs:*
-
Seller Entitlement Service — Activation Role (
feature-platform/seller-entitlement-service/, deployed standalone into an AWS Marketplace seller account, not part of the main stack):aws-marketplace:SearchAgreements,DescribeAgreement,GetAgreementTerms,GetEntitlements,ResolveCustomer— seller-side entitlement reads.Resource: "*": these actions do not support resource-level permissions. Read-only by design (noBatchMeterUsage/catalog writes), asserted by a static test.kms:Signon the stack’s own asymmetricTokenSigningKeyonly — notGetPublicKey,PutKeyPolicy, orScheduleKeyDeletion, so a compromised function cannot re-point trust.dynamodb:UpdateItemon the stack’sActivationsTableonly — write-only, so the function cannot read or delete the seller’s customer roster.logs:CreateLogStream,logs:PutLogEvents(viaAWSLambdaBasicExecutionRole).- Accepts
PermissionsBoundaryArnand attaches it when set. - Deploying operator additionally needs
marketplace-catalog:ListEntitiesfor the ownership preflight, plus the usual CloudFormation/IAM/KMS/DynamoDB create permissions.
Container-image Lambdas: The pattern processing functions (OCR, classification, extraction, assessment, summarization, BDA, evaluation, rule validation, etc.) are deployed as container images from Amazon ECR. Each function’s execution role therefore also includes
ecr:GetDownloadUrlForLayer,ecr:BatchGetImage, andecr:BatchCheckLayerAvailability(via a shared managed policy).
Service Quotas Considerations
Section titled “Service Quotas Considerations”For high-volume document processing, consider requesting quota increases for:
| Service | Quota to Increase | Typical Default |
|---|---|---|
| Amazon Bedrock | On-demand InvokeModel tokens per minute | Varies by model |
| Amazon Bedrock | On-demand InvokeModel requests per minute | Varies by model |
| Amazon Bedrock | ApplyGuardrail requests per minute | Varies by region |
| Amazon Textract | DetectDocumentText / AnalyzeDocument transactions per second | 10-25 TPS |
| AWS Lambda | Concurrent executions | 1,000 executions |
| AWS Step Functions | State transitions per second | 2,000 transitions |
| Amazon SQS | API requests per queue | Very high by default |
| Amazon CloudWatch | PutMetricData API requests per second | 150 requests/second |
| Amazon Athena | Active DML/DDL queries | 20-25 queries |
| Bedrock Data Automation | Concurrent jobs (BDA mode) | Varies by region |
Security Recommendations
Section titled “Security Recommendations”When deploying this solution, consider the following security best practices:
-
Encryption:
- Enable SSE-KMS encryption for all S3 buckets
- Use customer-managed CMKs for sensitive data
- Enable encryption for DynamoDB tables
-
Network Security:
- Use CloudFront security features (geo-restrictions, HTTPS, etc.) or a private API Gateway endpoint for VPC-based hosting
- Configure AWS WAF to protect web interfaces
-
Authentication:
- Enforce MFA for admin users in Cognito
- Set strong password policies
- Limit admin access to necessary personnel
-
IAM Best Practices:
- Use least privilege principles for all roles
- Regularly audit and rotate credentials
- Enable CloudTrail logging for all API actions
-
Content Safety & Control:
- Configure Bedrock Guardrails with appropriate topic filters
- Set up content blocking for sensitive information
- Implement trace logging for guardrail activations
- Use different guardrail configurations for different environments (dev/test/prod)
-
Data Protection:
- Implement lifecycle policies for S3 objects
- Configure appropriate retention policies for logs and data
- Consider data residency requirements when selecting regions