@@ -215,59 +215,6 @@ def bootstrap_account():
215215 return True
216216
217217
218- def generate_sam_template (* , skip_durable_config = False ):
219- """Generate SAM template for all examples."""
220- catalog = load_catalog ()
221-
222- template = {
223- "AWSTemplateFormatVersion" : "2010-09-09" ,
224- "Transform" : "AWS::Serverless-2016-10-31" ,
225- "Globals" : {
226- "Function" : {
227- "Runtime" : "python3.13" ,
228- "Timeout" : 60 ,
229- "MemorySize" : 128 ,
230- "Environment" : {
231- "Variables" : {"AWS_ENDPOINT_URL_LAMBDA" : {"Ref" : "LambdaEndpoint" }}
232- },
233- }
234- },
235- "Parameters" : {
236- "LambdaEndpoint" : {
237- "Type" : "String" ,
238- "Default" : "https://lambda.us-west-2.amazonaws.com" ,
239- }
240- },
241- "Resources" : {},
242- }
243-
244- for example in catalog ["examples" ]:
245- # Convert handler name to PascalCase (e.g., hello_world -> HelloWorld)
246- handler_base = example ["handler" ].replace (".handler" , "" )
247- function_name = "" .join (word .capitalize () for word in handler_base .split ("_" ))
248- template ["Resources" ][function_name ] = {
249- "Type" : "AWS::Serverless::Function" ,
250- "Properties" : {
251- "CodeUri" : "build/" ,
252- "Handler" : example ["handler" ],
253- "Description" : example ["description" ],
254- },
255- }
256-
257- if not skip_durable_config and "durableConfig" in example :
258- template ["Resources" ][function_name ]["Properties" ]["DurableConfig" ] = (
259- example ["durableConfig" ]
260- )
261-
262- import yaml
263-
264- template_path = Path (__file__ ).parent / "template.yaml"
265- with open (template_path , "w" ) as f :
266- yaml .dump (template , f , default_flow_style = False , sort_keys = False )
267-
268- return True
269-
270-
271218def create_deployment_package (example_name : str ) -> Path :
272219 """Create deployment package for example."""
273220
@@ -484,16 +431,6 @@ def main():
484431 # List command
485432 subparsers .add_parser ("list" , help = "List available examples" )
486433
487- # SAM template command
488- sam_parser = subparsers .add_parser (
489- "sam" , help = "Generate SAM template for all examples"
490- )
491- sam_parser .add_argument (
492- "--skip-durable-config" ,
493- action = "store_true" ,
494- help = "Skip adding DurableConfig properties to functions" ,
495- )
496-
497434 # Deploy command
498435 deploy_parser = subparsers .add_parser ("deploy" , help = "Deploy an example" )
499436 deploy_parser .add_argument ("example_name" , help = "Name of example to deploy" )
@@ -529,8 +466,6 @@ def main():
529466 build_examples ()
530467 elif args .command == "list" :
531468 list_examples ()
532- elif args .command == "sam" :
533- generate_sam_template (skip_durable_config = args .skip_durable_config )
534469 elif args .command == "deploy" :
535470 deploy_function (args .example_name , args .function_name )
536471 elif args .command == "invoke" :
0 commit comments