File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed
fai-lambda/fai-scribe/src Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -75,10 +75,12 @@ async def handle_editing_request(
7575 )
7676 LOGGER .info (f"Repository ready at: { repo_path } " )
7777
78- # Ensure queue_url is present
7978 queue_url = session .get ("queue_url" )
8079 if not queue_url :
81- raise RuntimeError (f"No queue_url found for editing session: { editing_id } " )
80+ raise RuntimeError (
81+ f"No queue_url found for editing session { editing_id } . "
82+ f"Session is in invalid state - queue should have been created during initialization."
83+ )
8284
8385 try :
8486 session_id , pr_url = await run_editing_session (
Original file line number Diff line number Diff line change @@ -159,6 +159,26 @@ export class FernAiDeployStack extends Stack {
159159 ) ;
160160 }
161161
162+ // Grant SQS permissions for creating and managing editing session queues
163+ fargateService . taskDefinition . taskRole . addToPrincipalPolicy (
164+ new iam . PolicyStatement ( {
165+ effect : iam . Effect . ALLOW ,
166+ actions : [
167+ "sqs:CreateQueue" ,
168+ "sqs:DeleteQueue" ,
169+ "sqs:SendMessage" ,
170+ "sqs:GetQueueUrl" ,
171+ "sqs:GetQueueAttributes" ,
172+ "sqs:SetQueueAttributes" ,
173+ "sqs:TagQueue"
174+ ] ,
175+ resources : [
176+ // Allow creating and managing editing-session queues
177+ `arn:aws:sqs:us-east-1:985111089818:editing-session-*.fifo`
178+ ]
179+ } )
180+ ) ;
181+
162182 const lbResponseTimeAlarm = new cloudwatch . Alarm (
163183 this ,
164184 `fai-${ environmentType . toLowerCase ( ) } -lb-target-response-time-alarm` ,
You can’t perform that action at this time.
0 commit comments