Skip to content

Commit e47a287

Browse files
committed
feat: Add Amazon Textract permissions for document analysis in task role
1 parent 81fb980 commit e47a287

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

backend/src/iac/backend-stack.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,22 @@ export class BackendStack extends cdk.Stack {
176176
}),
177177
);
178178

179+
// Add Amazon Textract permissions for document analysis
180+
taskRole.addToPolicy(
181+
new iam.PolicyStatement({
182+
effect: iam.Effect.ALLOW,
183+
actions: [
184+
'textract:AnalyzeDocument',
185+
'textract:DetectDocumentText',
186+
'textract:GetDocumentAnalysis',
187+
'textract:StartDocumentAnalysis',
188+
'textract:StartDocumentTextDetection',
189+
'textract:GetDocumentTextDetection',
190+
],
191+
resources: ['*'], // You may want to restrict this to specific resources in production
192+
}),
193+
);
194+
179195
// Task Definition with explicit roles
180196
const taskDefinition = new ecs.FargateTaskDefinition(
181197
this,

0 commit comments

Comments
 (0)