Create DynamoDB Table which is used in this workshop to store and retrieve data for the application. The table is also registered in Cloud Map Service for the discovery purpose.
-
Goto Amazon DynamoDB console, click on the Create table button.
-
On the next screen, type in dojotable as the table name. Type in id as the primary key. Select String as the type. Keep rest of the configuration to the default. Click on the Create button. You are creating a table with id as the primary key.
-
The table is created in no time. Let’s register it with the Cloud Map. Goto Amazon Cloud Map console, open dojoappnamespace namespace and then open dataservices service. Then click on the Register service instance button.
-
On the next screen, select Identifying information for another resource option for the instance type. You are selecting this option because the resource is not IP Address or EC2 instance based. Type in dojodatainstance for the Service instance ID field. It is the name identifier for the resource. Add two custom attributes - 1) key = name, value = datatable 2) key = tablename, value = dojotable. The custom attributes are used to query / discover the resources and also fetch the resource configuration details. Click on the **Register service instance button.
-
The table is registered as the service instance in no time. In the configuration above, key = name is used to search and discover the data table and key = tablename is used to fetch the actual table name. You will understand it more when you see the code to discover and use the resources later.
-
In the next task, you create the Lambda function which writes data to the table. The Lambda function is also registered with the Cloud Map.