Netlify & AWS Lambda with other AWS services

Hi Netlify community,

I hope this is the right section :worried:

I am looking for making a tiny app for myself (handling invoices since I am a freelancer), I do not want to use existing services, I just want to try building my simple app.

I want to have SPA hosted via Netlify and on AWS I want to deploy API with Serverless Aurora (MySQL), for invoice storage I am going to use S3 and SQS for async handling of sending emails via SES.

It sound like total overkill, and indeed it is, but I want to try these technologies.

So my question is how can I connect all of that together? In Netlify Functions docs I found out that if I want to use other AWS services, I shall contact the sales team, but before that I want to do some research, so here I am asking you for advice.

Do you have experience with this kind of infrastructure, what drawbacks shall I expect etc…

Yes, I have to manage API Gateway, etc… I hope that Serverless (serverless.com) will help me with that. I was also looking at ZEIT and their tools (like now) but I haven’t found a good guide for Serverless Aurora.

Thank you for your answers

Sorry it was hard to guess the correct section! I moved this over to “Support” since this seems to be a tech support needed kind of situation :slight_smile:

I think the short answer is you probably don’t want to use our functions implementation. Since we deploy our functions to our AWS account, in the region we choose (usually somewhere in us-west or us-east), it may not be a good fit for contacting your service. Further, we reserve all the $AWS_* variables that this requires (this listing would be good ones to avoid trying to set yourself) , which makes it a bit of a challenge to set your own $AWS_SECRET_KEY and the other things you might need, plus we might be connecting to your database in Frankfurt from us-west which would be pretty suboptimal for visitor experiences.

The “contact sales” was about deploying to your own AWS account, where you could control these things, and that does require a custom contract. What doesn’t require that is deploying your own functions to your own account independent of the netlify site, and accessing them from the netlify site - this pattern should work well, since we don’t have built-in interfaces to Aurora/SQS/S3/SES for you to use anyway.

Let me know if that doesn’t seem like a functional (sorry, pun intended) solution and why not and we can see if we can come up with better advice :slight_smile:

Thank you for your answer :slight_smile:

I though this even writing my original post, I just wanted to be sure and see if someone found a useful way to do something like this. But you just confirmed what I thought.

Which to me is completely fine and I will give it a try. Only thing I am left wondering is getting the data from my API at Lambda to Netlify site, as far as I know CORS (Cross-Origin resource sharing) should do the trick.

I hoped there would be something from Netlify to help me with function itself, but as you said if I tend to use other AWS products, the best choice will be my own AWS account.

Thank you

You could use our (reverse) proxying feature to connect us to it; that’s a pretty common pattern and avoids CORS problems too:

https://docs.netlify.com/routing/redirects/rewrites-proxies/#proxy-to-another-service

(and, it’s how our own functions implementation routes to AWS under the hood without setting pesky custom hostnames or worrying about SSL certificates ourselves - AWS has one that covers THEIR hostnames already!)

1 Like