Access S3 using AIO runtime | Community
Skip to main content
August 27, 2021
Question

Access S3 using AIO runtime

  • August 27, 2021
  • 2 replies
  • 1302 views

I am trying to access a file on S3.

This is a POC - the idea is to build the code in JavaScipt, deploy it on AIO and run it.

The code uses aws-sdk module and works just fine when running it on my local terminal (using command node <filename>.js). I can even deploy the code onto AIO, by creating an action.

 

However, the issue is I am unable to run the code. I am met with this error while trying invoke the action: 

 

I have created a templated Firefly project on developer console, configured CLI, workspace etc. as mentioned in the documentation; even installed aws-sdk package in the project directory and added the dependencies in package.json file as well. I continue to face the same error.

 

If anyone has figured out how to get this to work, please do provide a code sample or let me know where I might be going wrong.

 

Thanks!

P.S. I am picking up JavaScript on the go and can possibly ask tons of silly doubts - so TIA!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

August 30, 2021

Hi @aditya82ram 

You need to follow same procedure has followed in this example.

https://www.adobe.io/project-firefly/docs/resources/barcode-reader/bootstrap/

 

Those node_modules won't be there by default so you need to create headless app and do npm install aws-sdk in those app project folder. Do some changes in index.js which will be in action folder and do app deploy. After that you will get web-based action url and use it accordingly.

 

Thanks

Naveen

 

 

 

Adobe Employee
March 17, 2022

In case you find the answer of Naveen TLDR here is a short version:

add `aws-sdk` in your `package.json` as dependency and do a `npm install`. Should solve the problem