func BuildDeployEnvironmentCmd()

in internal/pkg/cli/env_deploy.go [84:109]


func BuildDeployEnvironmentCmd() *cobra.Command {
	opts := NewDeployEnvironmentOpts()
	cmd := &cobra.Command{
		Use:   "deploy",
		Short: "Deploy the oam-ecs environment",
		Long:  `Creates (or updates) the shared infrastructure, including a VPC and ECS cluster, for oam-ecs applications`,
		Example: `
  Create the oam-ecs environment:
	$ oam-ecs env deploy`,
		PreRunE: runCmdE(func(cmd *cobra.Command, args []string) error {
			session, err := session.Default()
			if err != nil {
				return err
			}
			opts.envDeployer = cloudformation.New(session)
			return nil
		}),
		RunE: runCmdE(func(cmd *cobra.Command, args []string) error {
			return opts.Execute()
		}),
	}

	cmd.Flags().BoolVarP(&opts.DryRun, dryRunFlag, "", false, dryRunFlagDescription)

	return cmd
}