There's a command from Amazon Web Services called
eb init that allows you to initiate the current working directory as a elasticbeanstalk app.
This command is interactive, meaning
eb init will respond with a list of options.
$ eb init Select a default region 1) us-east-1 : US East (N. Virginia) 2) us-west-1 : US West (N. California) 3) us-west-2 : US West (Oregon) 4) eu-west-1 : EU (Ireland) 5) eu-central-1 : EU (Frankfurt) 6) ap-south-1 : Asia Pacific (Mumbai) 7) ap-southeast-1 : Asia Pacific (Singapore) 8) ap-southeast-2 : Asia Pacific (Sydney) 9) ap-northeast-1 : Asia Pacific (Tokyo) 10) ap-northeast-2 : Asia Pacific (Seoul) 11) sa-east-1 : South America (Sao Paulo) 12) cn-north-1 : China (Beijing) (default is 3):
This above is the
region option, the second is the
app option, and the third is a list of possible
What I'm looking for is to wrap the
eb init command and be able to pass in strings that can bypass the interactivity of the script.
ebInit --region=eu-central-1 --app=my-app --env=my-app-live
I'd need to parse the
stdout here and split the lines and get the number corresponding to the passed in argument option, which is pretty easy, because the options can shift numbers.
As a proof-of-concept I'd even be fine with something like this.
ebInit --region=5 --app=1 --env=1
I find it hard to believe that these kind of interactive commands are black boxes and cannot be programmatically interacted with. I've tried to do this with node.js and could not get it to respond, here's my old stackoverflow post "Responding to a interactive command via child process", which has received no attention.
I'm posting this here in unix / linux to ask if this is even possible, and if so how and in what language?