@@ -18,6 +18,7 @@ import (
1818 "github.com/DefangLabs/defang/src/pkg/cli"
1919 cliClient "github.com/DefangLabs/defang/src/pkg/cli/client"
2020 "github.com/DefangLabs/defang/src/pkg/cli/client/byoc"
21+ byocAws "github.com/DefangLabs/defang/src/pkg/cli/client/byoc/aws"
2122 "github.com/DefangLabs/defang/src/pkg/cli/client/byoc/gcp"
2223 "github.com/DefangLabs/defang/src/pkg/cli/compose"
2324 "github.com/DefangLabs/defang/src/pkg/clouds/aws"
@@ -141,6 +142,17 @@ func Execute(ctx context.Context) error {
141142 return nil
142143}
143144
145+ var cloudformationCmd = & cobra.Command {
146+ Use : "cloudformation" ,
147+ Short : "CloudFormation template related commands" ,
148+ Hidden : true ,
149+ RunE : func (cmd * cobra.Command , args []string ) error {
150+ template , err := byocAws .PrintCloudFormationTemplate ()
151+ term .Println (string (template ))
152+ return err
153+ },
154+ }
155+
144156func SetupCommands (ctx context.Context , version string ) {
145157 cobra .EnableTraverseRunHooks = true // we always need to run the RootCmd's pre-run hook
146158
@@ -222,8 +234,10 @@ func SetupCommands(ctx context.Context, version string) {
222234 lsCommand .Aliases = []string {"getServices" , "ps" , "ls" , "list" }
223235 RootCmd .AddCommand (lsCommand )
224236
225- // Get Status Command
226- RootCmd .AddCommand (getVersionCmd )
237+ // Version Command
238+ RootCmd .AddCommand (versionCmd )
239+
240+ RootCmd .AddCommand (cloudformationCmd )
227241
228242 // Config Command (was: secrets)
229243 configSetCmd .Flags ().BoolP ("name" , "n" , false , "name of the config (backwards compat)" )
@@ -614,7 +628,7 @@ func collectUnsetEnvVars(project *composeTypes.Project) []string {
614628 return nil
615629}
616630
617- var getVersionCmd = & cobra.Command {
631+ var versionCmd = & cobra.Command {
618632 Use : "version" ,
619633 Args : cobra .NoArgs ,
620634 Aliases : []string {"ver" , "stat" , "status" }, // for backwards compatibility
0 commit comments