ASP.NET AWS Serverless - amazon-web-services

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:

Related

How to have a static URL for serverless framework AWS deployments?

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.

how do i publish a serverless application publicly in aws Serverless Application Repository?

I am deploying a hello-world serverless app in AWS Serverless Application Repository. I want to publish the app publicly in the AWS repository. While I am referring AWS documentation, I am asked to provide LicenseUrl: in the metadata section of packaged yaml.
I am a bit confused about where do I get my LicenseUrl in order to publish the app publicly.
( refer aws doc: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-publishing-applications.html

How to deploy both frontend and backend with the serverless framework?

I am trying to deploy frontend and backends together via serverless framework.
I'm using a mono repository via lerna where the frontend and backend packages are separated into different directories.
So I use multiple serverless.yml s.
How can I deploy both via the same cloud formation name?
It has the following directories:
package.json
.. [packages]
.... [backend]
...... package.json
.... [frontend]
...... package.json
Where should I put serverless.yml? And how to write serverless.yml?
They will be under the same cloudformation stack because they will have the same service-name in the serverless yml.
It really depends on the type of application. for example if it is a static frontend, the frontend can be packaged into a bundle and then deployed to a public s3 bucket.
If the backend is mainly lambda (Just assuming because this is a common backend approach for the serverless framework). You can just define each lambda handler and then deploy them to AWS. This will create the lambda resources backed by an API gateway for your service. The frontend would just need to know the service URL to query the data from the api.

How to deploy a serverless code into a stage in AWS API Gateway

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

How to get the 'Endpoint' of a deployed 'Lambda' function in AWS?

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.