@@ -516,35 +516,7 @@ def clean_template_for_headless_deployment(self, template: Dict[str, Any]) -> Di
516516 if 'CorsConfiguration' in properties :
517517 del properties ['CorsConfiguration' ]
518518 self .logger .debug (f"Removed CORS configuration from { resource_name } " )
519-
520- # Clean Lambda functions that have AppSync references in environment variables or policies
521- functions_to_clean = ['EvaluationFunction' ] # QueueProcessor moved to conversion list
522- for func_name in functions_to_clean :
523- if func_name in resources :
524- func_def = resources [func_name ]
525-
526- # Clean environment variables
527- env_vars = func_def .get ('Properties' , {}).get ('Environment' , {}).get ('Variables' , {})
528- if 'APPSYNC_API_URL' in env_vars :
529- del env_vars ['APPSYNC_API_URL' ]
530- self .logger .debug (f"Removed APPSYNC_API_URL from { func_name } " )
531-
532- # Clean policies that reference AppSync
533- policies = func_def .get ('Properties' , {}).get ('Policies' , [])
534- for policy in policies :
535- if isinstance (policy , dict ) and 'Statement' in policy :
536- statements = policy ['Statement' ]
537- if isinstance (statements , list ):
538- # Remove statements that reference GraphQLApi
539- policy ['Statement' ] = [
540- stmt for stmt in statements
541- if not (isinstance (stmt , dict ) and
542- isinstance (stmt .get ('Resource' ), list ) and
543- any ('GraphQLApi.Arn' in str (res ) for res in stmt .get ('Resource' , [])))
544- ]
545- if len (policy ['Statement' ]) != len (statements ):
546- self .logger .debug (f"Removed AppSync policy statements from { func_name } " )
547-
519+
548520 # Convert all backend functions from AppSync to DynamoDB tracking mode
549521 functions_to_convert = ['QueueSender' , 'QueueProcessor' , 'WorkflowTracker' , 'EvaluationFunction' ]
550522 for func_name in functions_to_convert :
0 commit comments