in internal/pkg/cli/app_delete.go [100:126]
func BuildDeleteAppCmd() *cobra.Command {
opts := NewDeleteAppOpts()
cmd := &cobra.Command{
Use: "delete",
Short: "Delete the application's deployed components",
Long: `Removes the infrastructure for the application defined in an Open Application Model application configuration file.`,
Example: `
Delete the deployed application components, using an application configuration file:
$ oam-ecs app delete -f config.yml`,
PreRunE: runCmdE(func(cmd *cobra.Command, args []string) error {
session, err := session.Default()
if err != nil {
return err
}
opts.ComponentDeleter = cloudformation.New(session)
return nil
}),
RunE: runCmdE(func(cmd *cobra.Command, args []string) error {
return opts.Execute()
}),
}
cmd.Flags().StringVarP(&opts.OamFile, oamFileFlag, oamFileFlagShort, "", appConfigFileFlagDescription)
cmd.MarkFlagRequired(oamFileFlag)
return cmd
}