@@ -127,6 +127,7 @@ Resources:
127127 - id : W11
128128 reason : " Some IAM List/Get operations and service-linked roles require wildcard resources"
129129 Properties :
130+ MaxSessionDuration : 14400 # 4 hours - allows tests to run beyond default 60-minute token expiration
130131 AssumeRolePolicyDocument :
131132 Version : ' 2012-10-17'
132133 Statement :
@@ -215,6 +216,12 @@ Resources:
215216 Action :
216217 - lambda:*
217218 Resource : !Sub 'arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:idp-*'
219+ # Lambda ListFunctions - required for Test Studio to discover TestRunnerFunction
220+ # Note: AWS does not support resource-level permissions for ListFunctions
221+ - Effect : Allow
222+ Action :
223+ - lambda:ListFunctions
224+ Resource : ' *'
218225 # DynamoDB
219226 - Effect : Allow
220227 Action :
@@ -226,9 +233,28 @@ Resources:
226233 - Effect : Allow
227234 Action :
228235 - states:*
229- Resource :
236+ Resource :
230237 - !Sub ' arn:aws:states:${AWS::Region}:${AWS::AccountId}:stateMachine:idp-*'
231238 - !Sub ' arn:aws:states:${AWS::Region}:${AWS::AccountId}:execution:idp-*:*'
239+ # AppSync - required for cleanup
240+ - Effect : Allow
241+ Action :
242+ - appsync:ListGraphqlApis
243+ - appsync:GetGraphqlApi
244+ - appsync:DeleteGraphqlApi
245+ Resource : ' *'
246+ # CloudFront - required for cleanup
247+ - Effect : Allow
248+ Action :
249+ - cloudfront:ListDistributions
250+ - cloudfront:GetDistribution
251+ - cloudfront:DeleteDistribution
252+ - cloudfront:GetDistributionConfig
253+ - cloudfront:UpdateDistribution
254+ - cloudfront:ListResponseHeadersPolicies
255+ - cloudfront:GetResponseHeadersPolicy
256+ - cloudfront:DeleteResponseHeadersPolicy
257+ Resource : ' *'
232258 - PolicyName : STSAccess
233259 PolicyDocument :
234260 Version : ' 2012-10-17'
@@ -245,6 +271,17 @@ Resources:
245271 Action :
246272 - logs:*
247273 Resource : !Sub 'arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/codebuild/*'
274+ - PolicyName : CloudWatchMetricsAccess
275+ PolicyDocument :
276+ Version : ' 2012-10-17'
277+ Statement :
278+ - Effect : Allow
279+ Action :
280+ - cloudwatch:PutMetricData
281+ Resource : ' *'
282+ Condition :
283+ StringEquals :
284+ cloudwatch:namespace : GENAIDP
248285
249286 ArtifactBucket :
250287 Type : ' AWS::S3::Bucket'
@@ -320,6 +357,7 @@ Resources:
320357 Properties :
321358 Name : app-sdlc
322359 ServiceRole : !If [CreateCodeBuildRole, !GetAtt CodeBuildRole.Arn, !Ref CodeBuildRoleArn]
360+ TimeoutInMinutes : 120
323361 Artifacts :
324362 Type : CODEPIPELINE
325363 Environment :
@@ -343,7 +381,7 @@ Resources:
343381 - pip install uv || { echo "uv installation failed"; exit 1; }
344382 - export IDP_ADMIN_EMAIL=$(aws s3api head-object --bucket ${SOURCE_BUCKET} --key deploy/code.zip --query 'Metadata."gitlab-user-email"' --output text 2>/dev/null || echo "")
345383 - make setup || { echo "IDP Common and IDP CLI installation failed"; exit 1; }
346- - pip install rich || echo "Rich installation failed, using fallback formatting "
384+ - pip install rich scikit-learn || echo "Additional package installation failed, using fallbacks "
347385 - export PATH="$PWD/.venv/bin:$PATH"
348386 - which idp-cli || { echo "idp-cli not found in PATH"; exit 1; }
349387 build:
@@ -455,8 +493,10 @@ Resources:
455493 - Effect : Allow
456494 Action :
457495 - ' bedrock:InvokeModel'
458- Resource :
459- - !Sub ' arn:aws:bedrock:*::foundation-model/anthropic.claude-3-5-sonnet-20240620-v1:0'
496+ - ' bedrock:InvokeModelWithResponseStream'
497+ Resource :
498+ - !Sub ' arn:${AWS::Partition}:bedrock:*::foundation-model/*'
499+ - !Sub ' arn:${AWS::Partition}:bedrock:*:${AWS::AccountId}:inference-profile/*'
460500 - Effect : Allow
461501 Action :
462502 - ' bedrock:ListBlueprints'
@@ -476,6 +516,11 @@ Resources:
476516 Resource :
477517 - !Sub ' arn:aws:bedrock:${AWS::Region}:${AWS::AccountId}:blueprint/*'
478518 - !Sub ' arn:aws:bedrock:${AWS::Region}:${AWS::AccountId}:data-automation-project/*'
519+ - Effect : Allow
520+ Action :
521+ - ' bedrock:ListIngestionJobs'
522+ - ' bedrock:StopIngestionJob'
523+ Resource : ' *'
479524
480525 CodeBuildKMSPolicy :
481526 Type : ' AWS::IAM::Policy'
0 commit comments