I am developing a serverless application using the Serverless Framework. I deployed my application using
$ serverless deploy
After deploying, I got the endpoints for my functions which look like this
https://ly5webovq4.execute-api.us-east-1.amazonaws.com/prod/notes
which I did not note down. Now I need it, but could not find it. Where can I find the Endpoints?
Just run
$ sls info
And you'll get all the information on the deployed endpoints and functions.
Related
My workplace gave me a task to configure servers myself for the upcoming project, which I am glad to carry out... if I knew how to do so! A minimal deployment would do the job alright, since there won't be too much web traffic.
So far I found that .. according to references like these..
https://aws.plainenglish.io/how-to-deploy-a-spring-boot-and-vue-application-on-aws-ec2-using-docker-dde22ca15063
For frontend (Nuxt Vue.js)
get the dist folder and upload it to AWS S3 as a static website
Or deploy the frontend by preparing NginX on AWS EC2.
Currently, I am not so sure what are the differences betweeen the two and which approach I should take.
Equally unsure part is how the static website can be connected to the deployed backend
(just by using axios?)
For backend (Java SpringBoot),
take the compiled jar file and deploy it on AWS EC2 where the backend service would be Docker imagefied.
Here, I am very fuzzy about using Docker. All I know is how a web service can be imagefied and published on DockerHub.
It seems there are multiple ways to deploy your web services on AWS.
If someone could provide a proven way or a detailed reference of deploying a Nuxt Vue.js + Java SpringBoot on AWS that actually works, that would be awesome!
But actually I would greatly appreciate any input that suggests a direction.. :)
When I use serverless framework to deploy with sls deploy to an AWS endpoint with lambdas and dynamodb, the host of the endpoint changes every time with a different prefix. This is a problem because if I release a client, I won't be able to deploy with serverless again.
For example, a host might look like this: 9svhw8numd.execute-api.us-east-1.amazonaws.com
That 9svhw8numd part changes each time there is a new deployment.
I've checked the serverless documentation and I can't seem to find anything that tells me how to configure it to have a static URL. How do I keep the host static for each serverless deployment?
What you're seeing is a URL for an AWS API Gateway instance. If you delete and re-create your serverless stack, a new endpoint will be generated. If you don't remove the stack, it'll stay the same throughout multiple serverless deploy commands.
If you'd like a custom domain instead of one generated by API Gateway, you'll need to configure a domain name via AWS Route 53. If you're using the Serverless Framework, here's a good guide to do that.
After publishing the serverless API project to the AWS Lambda, the serverless Url not working. Running the project in local is still working, but the serverless Url just wont work. What can possibly be the reason?
Looks like your API is not deployed.
To deploy your API go to the AWS console and try to deploy your API resource:
Use the following options:
Actions > Deploy API:
I have an application using Nest.js, and I'd like to deploy it using API Gateway + Lambda functions.
I have some experience with AWS, but it's my first time with a serverless application.
I searched for some things but almost everything that I found uses the Serverless framework, and I would like to do it using the AWS SDK.
I have an API with 4 endpoints, I want to use API Gateway and a single Lambda function to run the application.
Any tips on how I could do that?
Thanks in advance.
To deploy a serverless project into a stage of a service, following command can be used
serverless deploy --stage dev
Extracted from the docs
https://serverless.com/framework/docs/providers/aws/guide/deploying/
However when above command is used to deploy a service, it creates a new service with name dev-aws-nodejs in API Gateway.
Is it possible to create a service with name aws-nodejs and have different stages like dev, stag, prod etc.. Therefore, when you run the following command
serverless deploy --stage stag
A new stage called stag will be created under service aws-nodejs.
By design the current version of serverless framework doesn't support this feature. But the version 0.5.6 had been designed to deploy multiple stages into api single api gateway project. Following open issues are related to this. Some have suggested few workarounds.
AWS API Gateway stages and names are separated
Issue below, mainly highlight different services into same api gateway. But it also has some comments related to your query as well.
Deploy many micro/nano services to one API Gateway
Update:
In the recent release of serverless (v1.19), they have mentioned that they have started working on a solution for this.
Serverless v1.19 Changelog