1

I am looking for a App.deploy() function that can directly deploy/provision infra, just like we have App.synth(). Is it possible to directly deploy resources from code itself without having to deal with CLI for deployment?

Subha_26
  • 632
  • 3
  • 11
  • You can execute CLI commands with code, yes. https://stackoverflow.com/questions/89228/how-to-execute-a-program-or-call-a-system-command – gshpychka Mar 13 '22 at 21:00

1 Answers1

0

The short answer is: no. Even though, as @gshpychka mentioned, you can use code to execute shell commands, that still involves "dealing with the CLI".

The larger question is -- why do you want to avoid using the CLI? Generally speaking, deploying infra is either going to be a one-off task you perform locally, in which case it makes sense to use the CLI, or it is going to be a frequently repeated task performed by a pipeline...in which case it also makes sense for it to be triggered via CLI. What problem are you trying to solve by not interacting with shell commands?

Nate Norris
  • 583
  • 3
  • 12