File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
localstack-core/localstack/cli Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -472,6 +472,13 @@ def _print_service_table(services: Dict[str, str]) -> None:
472
472
is_flag = True ,
473
473
default = False ,
474
474
)
475
+ @click .option (
476
+ "--stack" ,
477
+ "-s" ,
478
+ type = str ,
479
+ help = "Use a specific stack with optional version. Examples: [localstack:4.5, snowflake]" ,
480
+ required = False ,
481
+ )
475
482
@publish_invocation
476
483
def cmd_start (
477
484
docker : bool ,
@@ -483,6 +490,7 @@ def cmd_start(
483
490
publish : Tuple = (),
484
491
volume : Tuple = (),
485
492
host_dns : bool = False ,
493
+ stack : str = None ,
486
494
) -> None :
487
495
"""
488
496
Start the LocalStack runtime.
@@ -496,6 +504,18 @@ def cmd_start(
496
504
if host and detached :
497
505
raise CLIError ("Cannot start detached in host mode" )
498
506
507
+ if stack :
508
+ # Validate allowed stacks
509
+ stack_name = stack .split (":" )[0 ]
510
+ allowed_stacks = ("localstack" , "localstack-pro" , "snowflake" )
511
+ if stack_name .lower () not in allowed_stacks :
512
+ raise CLIError (f"Invalid stack '{ stack_name } '. Allowed stacks: { allowed_stacks } ." )
513
+
514
+ # Set IMAGE_NAME, defaulting to :latest if no version specified
515
+ if ":" not in stack :
516
+ stack = f"{ stack } :latest"
517
+ os .environ ["IMAGE_NAME" ] = f"localstack/{ stack } "
518
+
499
519
if not no_banner :
500
520
print_banner ()
501
521
print_version ()
You can’t perform that action at this time.
0 commit comments