Lambda Deployment Prompts for CloudFormation Template

0

I'm working through the tutorial : https://aws.amazon.com/developer/language/net/badges-and-training/aws-lambda/module-one.

I have completed the exercises up to Demo 2 (A .NET API running in a Lambda Function) Step 3. This is very similar to the project that I need to create. I run the code within Visual Studio and the Minimal API deploys and in the Chrome Browser. However, when executing the

dotnet lambda deploy-serverless...

command line I get prompted to "Enter CloudFormation Template". This is not documented in the tutorial. What do I need to do?

I have attempted to create CloudFormation templates. All of my attempts have failed, seemingly due to some permissions role issues.

Is there a default template that should be used here?

DavidM
已提问 1 个月前395 查看次数
1 回答
0
已接受的回答

Hello.

If you look at the directory structure below, there is a file called "serverless.template" in "src/AspNetCoreWebAPI", so I think this is the CloudFormation template.

├───src
│   └───AspNetCoreWebAPI
│       │   appsettings.Development.json
│       │   appsettings.json
│       │   AspNetCoreWebAPI.csproj
│       │   aws-lambda-tools-defaults.json // basic Lambda function config, and points to serverless.template file for deployment
│       │   LambdaEntryPoint.cs // Contains the function handler method, this handles the incoming JSON payload
│       │   LocalEntryPoint.cs // Equivalent to Program.cs when running locally, starts Kestrel (only locally)
│       │   Readme.md  
│       │   serverless.template // CloudFormation template for deployment
│       │   Startup.cs // Familiar Startup.cs, can use dependency injection, read config, etc.
│       │
│       └───Controllers
│               ValuesController.cs // Familiar API controller
│
└───test
    └───AspNetCoreWebAPI.Tests
        │   appsettings.json
        │   AspNetCoreWebAPI.Tests.csproj
        │   ValuesControllerTests.cs // Unit test for ValuesController
        │
        └───SampleRequests
                ValuesController-Get.json // JSON representing an APIGatewayProxyRequest, used by the unit test
profile picture
专家
已回答 1 个月前
profile picture
专家
已审核 1 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则