I need to invoke AWS Command Line Interface from a apex class. Can someone please help me in that?


| improve this question | | | | |
  • That's not possible. A Salesforce org is very different from an AWS EC2 instance. – martin Mar 2 '18 at 10:11
  • 4
    You can invoke the AWS API directly though through HTTP callouts with Apex. – martin Mar 2 '18 at 10:12
  • You cannot invoke any local CLI application from a browser-based app like Apex. The security reasons are obvious. – David Cheng Mar 3 '18 at 20:33
  • As others mentioned - you definitely cannot invoke it directly, but you can leverage quite a rich ecosystem of AWS libraries. The correct way would be doing it via client-side JS utilising official SDK (aws.amazon.com/documentation/sdk-for-javascript). Note that implementing this securely will require fairly serious IAM understanding. A bit lower hanging fruit would be using node.js wrapper (npmjs.com/package/aws-cli), potentially on something like Heroku and securely exposing your selected API calls using a shared secret and calling it from Apex. – dzh Mar 5 '18 at 6:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.