Is it possible to use AWS Javascript SDK with Suit...
# suitescript
m
Is it possible to use AWS Javascript SDK with SuiteScript to Upload objects to S3 bucket? If so are there any good walk throughs on how to get this setup? I'd like to design a simple Suitelet that lets our users upload a file to a designated directory in the file cabinet and send that file out to an S3 bucket.
c
You can just do direct HTTP POSTs to s3 buckets
💯 1
m
I was really hoping it would be that simple thank you I'll check out these documents.
s
wow. This opened my mind, I went with a rest endpoint to be called by a lamda function to get into S3. This really opened my mind, will test this too. ^^I'm certain above works in aws-sdk because i've done that already, but otherwise that seems great
m
I'm still navigating the rabbit hole lol, lots to learn here
s
I can share the high level process, currently to get to S3, we have a restlet that transforms a saved search into a csv, an aws events bridge which calls a lambda function that calls the restlet, to retrieve a csv and either dumps it to s3, or loads it to mysql. But tbh, once you're in s3, all the data lake shenanigans will flow naturally
I mean I wanted to skip trying to figure out the aws signature, which is why I came up with this methodology, but if if this works, it could be better I suppose?
m
yeah I'm reading through the sig parts right now and going back through what I know about the crypto and encrypt modules, I think I can make it work but I haven't implemented anything just yet
s
not to discourage you, but when I saw postman has a specific encryption for aws-tokens, I said nope. but it is the right course of action especially when md5 and sha1 will require shim and external libraries to work, i think that's my other half cent haha
it might not have direct relationship, but it's saying we have to consider the integrations outside netsuite library.
n
I've developed a suitescript module to submit a message to an AWS SQS endpoint. I'm happy to share if you'd like to adapt it for S3
m
@Nicholas Penree thanks, I'll check this out and see if it'll suit my needs
or at least help me along my way to generating the connection
n
@Mark Robinson the signature generation code should be pretty much the same so I think that bit will be relevant
m
I really appreciate it, this shim looks like it's an integral piece that I hadn't quite gotten to yet
151 Views