in internal/pkg/cli/env_delete.go [55:78]
func BuildDeleteEnvironmentCmd() *cobra.Command {
opts := NewDeleteEnvironmentOpts()
cmd := &cobra.Command{
Use: "delete",
Short: "Delete the oam-ecs environment",
Long: `Removes the shared infrastructure, including a VPC and ECS cluster, for oam-ecs applications. All deployed components must already be deleted.`,
Example: `
Delete the oam-ecs environment:
$ oam-ecs env delete`,
PreRunE: runCmdE(func(cmd *cobra.Command, args []string) error {
session, err := session.Default()
if err != nil {
return err
}
opts.envDeleter = cloudformation.New(session)
return nil
}),
RunE: runCmdE(func(cmd *cobra.Command, args []string) error {
return opts.Execute()
}),
}
return cmd
}