@@ -871,11 +871,11 @@ Resources:
871871 Statement :
872872 - Effect : Allow
873873 Principal :
874- Service : lambda.amazonaws.com
874+ Service : !Sub " lambda.${AWS::URLSuffix}"
875875 Action : sts:AssumeRole
876876 PermissionsBoundary : !If [ HasPermissionsBoundary, !Ref PermissionsBoundaryArn, !Ref "AWS::NoValue" ]
877877 ManagedPolicyArns :
878- - arn:aws: iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
878+ - !Sub " arn:${AWS::Partition}: iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
879879 Policies :
880880 - PolicyName : AthenaQueryPolicy
881881 PolicyDocument :
@@ -887,7 +887,7 @@ Resources:
887887 - athena:GetQueryExecution
888888 - athena:GetQueryResults
889889 - athena:StopQueryExecution
890- Resource : !Sub "arn:aws :athena:${AWS::Region}:${AWS::AccountId}:workgroup/primary"
890+ Resource : !Sub "arn:${AWS::Partition} :athena:${AWS::Region}:${AWS::AccountId}:workgroup/primary"
891891 - PolicyName : S3AccessPolicy
892892 PolicyDocument :
893893 Version : ' 2012-10-17'
@@ -925,9 +925,9 @@ Resources:
925925 - glue:GetTables
926926 - glue:GetPartitions
927927 Resource :
928- - !Sub " arn:aws :glue:${AWS::Region}:${AWS::AccountId}:catalog"
929- - !Sub " arn:aws :glue:${AWS::Region}:${AWS::AccountId}:database/${ReportingDatabase}"
930- - !Sub " arn:aws :glue:${AWS::Region}:${AWS::AccountId}:table/${ReportingDatabase}/*"
928+ - !Sub " arn:${AWS::Partition} :glue:${AWS::Region}:${AWS::AccountId}:catalog"
929+ - !Sub " arn:${AWS::Partition} :glue:${AWS::Region}:${AWS::AccountId}:database/${ReportingDatabase}"
930+ - !Sub " arn:${AWS::Partition} :glue:${AWS::Region}:${AWS::AccountId}:table/${ReportingDatabase}/*"
931931 - PolicyName : KMSDecryptPolicy
932932 PolicyDocument :
933933 Version : ' 2012-10-17'
@@ -993,7 +993,6 @@ Resources:
993993 Runtime : python3.12
994994 MemorySize : 1024
995995 Timeout : 900
996- Role : !GetAtt AgentCoreAnalyticsLambdaRole.Arn
997996 Environment :
998997 Variables :
999998 LOG_LEVEL : !Ref LogLevel
@@ -1064,9 +1063,26 @@ Resources:
10641063 - athena:StartQueryExecution
10651064 - athena:GetQueryExecution
10661065 - athena:GetQueryResults
1066+ - athena:StopQueryExecution
10671067 Resource :
10681068 - !Sub " arn:${AWS::Partition}:athena:${AWS::Region}:${AWS::AccountId}:workgroup/primary"
10691069 - !Sub " arn:${AWS::Partition}:athena:${AWS::Region}:${AWS::AccountId}:datacatalog/*"
1070+ - Effect : Allow
1071+ Action :
1072+ - s3:ListBucket
1073+ - s3:GetBucketLocation
1074+ - s3:GetBucketVersioning
1075+ - s3:GetObject
1076+ - s3:PutObject
1077+ - s3:DeleteObject
1078+ - s3:AbortMultipartUpload
1079+ - s3:ListMultipartUploadParts
1080+ Resource : !Sub
1081+ - " ${BucketArn}/*"
1082+ - BucketArn : !If
1083+ - ShouldCreateReportingBucket
1084+ - !GetAtt ReportingBucket.Arn
1085+ - !Sub " arn:${AWS::Partition}:s3:::${ReportingBucketName}"
10701086 - Effect : Allow
10711087 Action :
10721088 - glue:GetTable
@@ -1154,6 +1170,8 @@ Resources:
11541170 - dynamodb:Query
11551171 Resource :
11561172 - !GetAtt TrackingTable.Arn
1173+ - !GetAtt ConfigurationTable.Arn
1174+ - !GetAtt AgentTable.Arn
11571175 - Effect : Allow
11581176 Action :
11591177 - cloudformation:DescribeStackResources
@@ -1171,12 +1189,6 @@ Resources:
11711189 - states:GetExecutionHistory
11721190 Resource :
11731191 - !Sub " arn:${AWS::Partition}:states:${AWS::Region}:${AWS::AccountId}:execution:${AWS::StackName}*"
1174- - Effect : Allow
1175- Action :
1176- - xray:GetTraceSummaries
1177- - xray:BatchGetTraces
1178- - xray:GetServiceGraph
1179- Resource : " *"
11801192
11811193 # #########################################################################
11821194 # AgentCore Gateway Manager Lambda Function
@@ -1260,6 +1272,7 @@ Resources:
12601272 UserPoolId : !Ref UserPool
12611273 ClientId : !Ref ExternalAppClient
12621274 ClientSecret : !GetAtt ExternalAppClient.ClientSecret
1275+ SourceCodeHash : <HASH_TOKEN>
12631276
12641277 # #########################################################################
12651278 # Nested stack for selected pattern
0 commit comments