Local dynamodb console
(Or possibly if you need to add specific “using” statements at the top of your Function.cs or DynamoDbAppStack.cs classes.ħ. If not, the error should indicate the package you should install. Now when you rebuild the Solution, it should build successfully. Right click in Solution Explorer, Rebuild Solution Right click in the Solution Explorer and select “Manage Nuget Packages for Solution…”. The Errors will provide hints to which packages need to be installed in the solution. In this step we will ensure that the right packages are referenced for a successful build.
Go to the Solution Explorer and right click to “Build Solution” you will probably notice that there will be some Errors when you build your solution.
Local dynamodb console code#
The actual code for Function.cs can be retrieved from or found in the Appendix of this article. The next class is our Lambda Handler and will contain code for our 3 lambdas to interact with our 2 DynamoDbTables.
Local dynamodb console update#
This will determine the infrastructure for our DynamoDbApp project including the generation of an 2 DynamoDB Tables, and API Gateway API and 3 Lambdas.ĭo not worry about any missing references for now, we will deal with them once we update the next file. The actual code for DynamoDbAppStack.cs can be retrieved from or found in the Appendix of this article. To save time, we will copy the following code into our DynamoDbAppStack.cs file in the DynamoDbApp project. We can now rebuild the solution and we will have both the DynamoDBApp project and the Lambdas project successfully building. In my case it is located at C:\projects\DynamoDBApp\Lambdas\src\Lambdas\Lambdas.csproj Navigate to the newly created Lambdas project file Open Visual Studio, go to the Solution Explorer, right click, select Add, Existing Project… You can now add this to your DynamoDBApp Solution in Visual Studio. Ou should now see a Lambdas project that has been created for your Lambdas. cd c:\projects\DynamoDBAppĭotnet new lambda.EmptyFunction -name Lambdas Go to your current solution folder and create a Lambda template project. If this runs without error, then it looks like you have a good setup to continue with.Ī Lambda project will allow us to interact with the DynamoDB tables interactively. Go to the command line and execute the following commands to verify that the cdk project is working fine. Go to the Solution Explorer and right click to “Build Solution” you should get a successful build. Program.cs: The entry point for your DynamoDBApp applicationĭynamoDBCdkAppStack.cs: This class will define your DynamoDBApp stack to determine which AWS Infrastructure resources get generated. You should then be able to open the solution file located in C:\projects\DynamoDBApp\src\DynamoDbApp.sln with Visual Studio Open a new command prompt and do the following cd c:\projects Go to your projects folder, I am using C:\projects on my machine If you are unsure, verify that you have everything that was required for the previous tutorial Creating an AWS Serverless C# DotNet Application Prerequisites: It is assumed that you have all that is required to develop your AWS infrastructure with C# and your AWS Account. Objective: Create 2 DynamoDB tables and illustrate the use of a Global Secondary Index and a Local Secondary Index. This article builds on the previous article DynamoDB Introduction Our Lambdas will be written in C# DotNet to test out the usage of the Partition Keys, Sort keys, Global Secondary Index and the Local Secondary Index. This will be done with the Cloud Development Kit(CDK) to create and deploy the required infrastructure as code(IAC). This article is designed to illustrate the creation of 2 DynamoDB Tables(one with a single Primary Key, and another with a Composite Primary Key) with actual code that can be deployed. We will be illustrating the basics of a Global Secondary Index(GSI) and a Local Secondary Index(LSI).