Set up DynamoDB Access Key
In this section, you need to take some manual steps to make DynamoDB accessible to this notebook. The following steps create a new AWS IAM user with the required permissions. You can also choose to use your existing users or roles.
Create an AWS IAM user and download secrets
- Go to AWS console http://console.aws.amazon.com, navigate to IAM, and click "Users".
- Click "Add users" and create a new user with "Access Key".
- Click Next and select policy
AmazonDynamoDBFullAccess
. - Click Next until the user is created.
- Download the "Access key ID" and "Secret access key".
Provide online store credentials using Databricks secrets
Note: For simplicity, the commands below use predefined names for the scope and secrets. To choose your own scope and secret names, follow the process in the Databricks documentation.
Create two secret scopes in Databricks.
databricks secrets create-scope --scope feature-store databricks secrets create-scope --scope feature-store
Create secrets in the scopes. Note: the keys should follow the format
<prefix>-access-key-id
and<prefix>-secret-access-key
respectively. Again, for simplicity, these commands use predefined names here. When the commands run, you will be prompted to copy your secrets into an editor.databricks secrets put --scope feature-store --key dynamo-access-key-id databricks secrets put --scope feature-store --key dynamo-secret-access-key databricks secrets put --scope feature-store --key dynamo-access-key-id databricks secrets put --scope feature-store --key dynamo-secret-access-key
Now the credentials are stored with Databricks Secrets. You will use them below to create the online store.
On-demand features - Restaurant recommendation demo
In this example, a restaurant recommendation model takes a JSON strong containing a user's location and a restaurant id. The restaurant's location is looked up from a pre-materialized feature table published to an online store, and an on-demand feature computes the distance from the user to the restaurant. This distance is passed as input to a model.
Requirements: