I want to deploy my ASP.Net Core Web Application project through a c# console application. It means I am trying to create a serverless lambda application on AWS without AWS Toolkit or CLI command. I want to do this with AWS SDK.
For this purpose I added below Nugets :
- AWSSDK.ServerlessApplicationRepository
- AWSSDK.Core
- AWSSDK.Lambda
at first step I am making a package with msbuild command. Then Zipped and upload on S3 bucket and in final step I am running below code. It does not show me any error but it is not in my function list.
AmazonServerlessApplicationRepositoryClient clie = new AmazonServerlessApplicationRepositoryClient("AKIAJQVBDUUDGLXOEKYA", "HdoCIeKqtnKYVXB6y/HHnK6mTD2G556jqAp+bk3e", RegionEndpoint.EUWest1);
CreateApplicationRequest createApplicationRequestObject = new CreateApplicationRequest()
{
Name = "ApplicationTest",
Author = "Mike",
Description = "Mike Desc",
SourceCodeUrl = "https://region/bucketname/publishfolder/" + packageFileName,
};
CreateApplicationResponse createApplicationResponseObject = clie.CreateApplication(createApplicationRequestObject);
I can't find any any error in the CreateApplicationResponse object. Also status proeprty of the CreateApplicationResponse object is Created but I can not find any new Lambda application in Lambda->Application of console.
I had to use cloudFormation request and responses for deploying this kind of project. AWS SDK has many nice classes and functions that do it.
So I developed some methods that do it for me :
for creating CloudFormation object, I created a class like this that do it for me :