Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Access S3 using AIO runtime

Avatar

Level 1

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: 

Aditya82Ram_0-1630039016400.png

 

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!

2 Replies

Avatar

Level 2

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

 

 

 

Avatar

Level 2

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