In this step we make some additions to the LazyStack.yaml file to support the use of DynamoDB and configure the Lambda and WebApi projects to reference the new PetStoreRepo project. Before we look at the LazyStack.yaml configuration directives in detail, here is a high-level summary of what we need to do:
When you execute "lazystack projects", the following projects are regenerated:
These generated projects should not be edited as your changes would be lost.
In addition to the generated projects, portions of the WebApi project "PetStore" are updated with each execution of "lazystack projects".
Executing "lazystack projects" does not update or modify any other projects in your solution.
lazystack projects
Projects and generated files are updated.
dotnet build
All projects in the solution are compiled successfully.
Note: You may see some CS8034 warnings : "Assembly with same name already loaded" - these can be ignored.
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:62817",
"sslPort": 44399
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"PetStore": {
"commandName": "Project",
"launchBrowser": true,
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"TABLE_NAME": "PetStoreDev-DB"
}
}
}
}
In this step we updated the LazyStack.yaml file to create a DynamoDB resource and configure the WebApi (PetStore) project and Lambdas projects to reference the PetStoreRepo project. We also added service registrations configuring the Controller projects to use the PetStoreRepo library. Finally, we inserted an environment variable "TABLE_NAME" in the WebApi project's launchSettings.json file to reference a table called "PetStoreDev-DB" in the DynamoDb resource.