@@ -91,14 +91,6 @@ Parameters:
9191 - " false"
9292 Description : " Enable Human In The Loop (A2I) for document review"
9393
94- IsPattern2HITLEnabled :
95- Type : String
96- Default : " false"
97- AllowedValues :
98- - " true"
99- - " false"
100- Description : " Pattern-2 specific HITL enablement flag"
101-
10294 SageMakerA2IReviewPortalURL :
10395 Type : String
10496 Default : " "
@@ -130,8 +122,6 @@ Conditions:
130122 HasPermissionsBoundary : !Not [!Equals [!Ref PermissionsBoundaryArn, ""]]
131123 IsHITLEnabled : !Equals [!Ref EnableHITL, "true"]
132124 HasAppSyncApi : !Not [!Equals [!Ref AppSyncApiArn, ""]]
133- IsPattern2HITLEnabled : !Equals [!Ref IsPattern2HITLEnabled, "true"]
134-
135125
136126Resources :
137127
@@ -1371,12 +1361,15 @@ Resources:
13711361 - kms:GenerateDataKey*
13721362 - kms:DescribeKey
13731363 Resource : !Ref CustomerManagedEncryptionKeyArn
1374- # AppSync permissions for updating document status
1375- - Effect : Allow
1376- Action :
1377- - appsync:GraphQL
1378- Resource :
1379- - !Sub " ${AppSyncApiArn}/types/Mutation/*"
1364+ # AppSync permissions for updating document status (only if AppSync API is available)
1365+ - !If
1366+ - HasAppSyncApi
1367+ - Effect : Allow
1368+ Action :
1369+ - appsync:GraphQL
1370+ Resource :
1371+ - !Sub " ${AppSyncApiArn}/types/Mutation/*"
1372+ - !Ref AWS::NoValue
13801373
13811374 HITLWaitFunctionLogGroup :
13821375 Type : AWS::Logs::LogGroup
@@ -1486,7 +1479,7 @@ Resources:
14861479 Statement :
14871480 - Effect : Allow
14881481 Principal :
1489- Service : lambda.amazonaws.com
1482+ Service : !Sub " lambda.${AWS::URLSuffix}"
14901483 Action : sts:AssumeRole
14911484 ManagedPolicyArns :
14921485 - !Sub " arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
@@ -1546,7 +1539,7 @@ Resources:
15461539 Properties :
15471540 FunctionName : !Ref HITLProcessLambdaFunction
15481541 Action : ' lambda:InvokeFunction'
1549- Principal : ' events.amazonaws.com '
1542+ Principal : !Sub " events.${AWS::URLSuffix}"
15501543 SourceArn : !GetAtt HITLEventRule.Arn
15511544
15521545 SummarizationFunction :
0 commit comments