Skip to content

Commit d05207c

Browse files
committed
fix: Add comprehend:DetectDominantLanguage permission for Translate auto-detect
AWS Translate requires the comprehend:DetectDominantLanguage IAM permission when using SourceLanguageCode='auto' to auto-detect the source language. Without this permission, translation requests fail with AccessDeniedException.
1 parent 34be9fc commit d05207c

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • cloudformation/scenarios/localgov-drupal/cdk/lib/constructs

cloudformation/scenarios/localgov-drupal/cdk/lib/constructs/compute.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,15 @@ export class ComputeConstruct extends Construct {
181181
);
182182

183183
// Translate permissions for content translation
184+
// Note: comprehend:DetectDominantLanguage is required when using
185+
// SourceLanguageCode='auto' with TranslateText API
184186
taskRole.addToPolicy(
185187
new iam.PolicyStatement({
186-
actions: ['translate:TranslateText', 'translate:ListLanguages'],
188+
actions: [
189+
'translate:TranslateText',
190+
'translate:ListLanguages',
191+
'comprehend:DetectDominantLanguage',
192+
],
187193
resources: ['*'],
188194
}),
189195
);

0 commit comments

Comments
 (0)