Skip to content

Commit bcddde4

Browse files
fix(iam): add bedrock application-inference-profile to lambda execution roles
**What changed:** Added the `application-inference-profile/*` ARN pattern to the `bedrock:InvokeModel` and `bedrock:InvokeModelWithResponseStream` IAM policy statements across the document processing Lambda functions (Classification, Extraction, Assessment, and Summarization). **Why it matters:** Previously, the IAM policies in the SAM templates only permitted invocation of standard Foundation Models (`foundation-model/*`) and cross-region inference profiles (`inference-profile/*`). This strict string matching blocked the use of custom Application Inference Profiles (`application-inference-profile/*`). By adding this ARN pattern, users can now successfully map custom inference profiles (like Nova 2 Lite) to the IDP pipeline. This unlocks the ability to: * Tag Bedrock invocations for granular cost allocation. * Track custom model throughput and performance metrics. * Avoid `AccessDeniedException` errors when substituting default models with application-specific profiles. **Related Issue(s):** #235
1 parent 9eb94be commit bcddde4

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

patterns/unified/template.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2441,6 +2441,7 @@ Resources:
24412441
Resource:
24422442
- !Sub "arn:${AWS::Partition}:bedrock:*::foundation-model/*"
24432443
- !Sub "arn:${AWS::Partition}:bedrock:${AWS::Region}:${AWS::AccountId}:inference-profile/*"
2444+
- !Sub "arn:${AWS::Partition}:bedrock:${AWS::Region}:${AWS::AccountId}:application-inference-profile/*"
24442445
- Effect: Allow
24452446
Action:
24462447
- aws-marketplace:Subscribe
@@ -2566,6 +2567,7 @@ Resources:
25662567
Resource:
25672568
- !Sub "arn:${AWS::Partition}:bedrock:*::foundation-model/*"
25682569
- !Sub "arn:${AWS::Partition}:bedrock:${AWS::Region}:${AWS::AccountId}:inference-profile/*"
2570+
- !Sub "arn:${AWS::Partition}:bedrock:${AWS::Region}:${AWS::AccountId}:application-inference-profile/*"
25692571
- !If
25702572
- HasCustomClassificationModelARN
25712573
- !Ref CustomClassificationModelARN
@@ -2695,6 +2697,7 @@ Resources:
26952697
Resource:
26962698
- !Sub "arn:${AWS::Partition}:bedrock:*::foundation-model/*"
26972699
- !Sub "arn:${AWS::Partition}:bedrock:${AWS::Region}:${AWS::AccountId}:inference-profile/*"
2700+
- !Sub "arn:${AWS::Partition}:bedrock:${AWS::Region}:${AWS::AccountId}:application-inference-profile/*"
26982701
- !If
26992702
- HasCustomExtractionModelARN
27002703
- !Ref CustomExtractionModelARN
@@ -2815,6 +2818,7 @@ Resources:
28152818
Resource:
28162819
- !Sub "arn:${AWS::Partition}:bedrock:*::foundation-model/*"
28172820
- !Sub "arn:${AWS::Partition}:bedrock:${AWS::Region}:${AWS::AccountId}:inference-profile/*"
2821+
- !Sub "arn:${AWS::Partition}:bedrock:${AWS::Region}:${AWS::AccountId}:application-inference-profile/*"
28182822
- Effect: Allow
28192823
Action:
28202824
- aws-marketplace:Subscribe
@@ -3021,6 +3025,7 @@ Resources:
30213025
Resource:
30223026
- !Sub "arn:${AWS::Partition}:bedrock:*::foundation-model/*"
30233027
- !Sub "arn:${AWS::Partition}:bedrock:${AWS::Region}:${AWS::AccountId}:inference-profile/*"
3028+
- !Sub "arn:${AWS::Partition}:bedrock:${AWS::Region}:${AWS::AccountId}:application-inference-profile/*"
30243029
- Effect: Allow
30253030
Action:
30263031
- aws-marketplace:Subscribe
@@ -3140,6 +3145,7 @@ Resources:
31403145
Resource:
31413146
- !Sub "arn:${AWS::Partition}:bedrock:*::foundation-model/*"
31423147
- !Sub "arn:${AWS::Partition}:bedrock:${AWS::Region}:${AWS::AccountId}:inference-profile/*"
3148+
- !Sub "arn:${AWS::Partition}:bedrock:${AWS::Region}:${AWS::AccountId}:application-inference-profile/*"
31433149
# Lambda invoke permission for SaveReportingFunction (in main template)
31443150
- Effect: Allow
31453151
Action:
@@ -3250,6 +3256,7 @@ Resources:
32503256
Resource:
32513257
- !Sub "arn:${AWS::Partition}:bedrock:*::foundation-model/*"
32523258
- !Sub "arn:${AWS::Partition}:bedrock:${AWS::Region}:${AWS::AccountId}:inference-profile/*"
3259+
- !Sub "arn:${AWS::Partition}:bedrock:${AWS::Region}:${AWS::AccountId}:application-inference-profile/*"
32533260
- !If
32543261
- HasGuardrailConfig
32553262
- Effect: Allow
@@ -3361,6 +3368,7 @@ Resources:
33613368
Resource:
33623369
- !Sub "arn:${AWS::Partition}:bedrock:*::foundation-model/*"
33633370
- !Sub "arn:${AWS::Partition}:bedrock:${AWS::Region}:${AWS::AccountId}:inference-profile/*"
3371+
- !Sub "arn:${AWS::Partition}:bedrock:${AWS::Region}:${AWS::AccountId}:application-inference-profile/*"
33643372
- Effect: Allow
33653373
Action:
33663374
- aws-marketplace:Subscribe

0 commit comments

Comments
 (0)