Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.

Create a Connection to Amazon DynamoDB

Learning Objectives

After completing this unit, you'll be able to:

  • Describe connecting to Amazon DynamoDB.
  • Identify mapping options for different types of fields.

Let's go through the steps to set up the DynamoDB connection and initiate the External Objects.

Configure a Named Credential

  1. From Setup, enter Named Credentials into the Quick Find text box. Select Named Credentials.
  2. Then, click New Named Credential.
  3. For Label, enter a user-friendly name that will be displayed in the Salesforce user interface. For example,  DynamoDBNC.
  4. Name autopopulates based on the Label, with the unique identifier that's used to refer to this named credential from callout definition while creating an external data source for Amazon DynamoDB. In this case, DynamoDBNC.
  5. For URL enter the URL of the Amazon DynamoDB endpoint, https://dynamodb.REGION.amazonaws.com. Change REGION to the AWS region being used. For example, https://dynamodb.us-east-1.amazonaws.com.
  6. For Identity Type select Named Principal.
  7. For Authentication Protocol select AWS Signature Version 4.
  8. For AWS Access Key ID, enter the first part of the access key used to sign programmatic requests to AWS.
  9. For AWS Secret Access Key, enter the second part of the access key used to sign programmatic requests to AWS.
  10. For AWS Region enter the AWS region name for the named credential's endpoint. For example, us-east-1.
  11. For AWS Service enter the AWS utility to access. For example, dynamoDB.
  12. Click Save.

Create an External Data Source

  1. From Setup, enter External Data into the Quick Find text box. Select External Data Sources.
  2. Then, click New External Data Source.
  3. For External Data Source enter a user-friendly name for the external data source. This is displayed in the Salesforce user interface. For example, ShippingDynamoDB.
  4. Name auto populates based on the External Data Source, with the unique identifier that's used to refer to this external data source definition through the API. In this case, ShippingDynamoDB.
  5. For Type select Amazon DynamoDB.
  6. For Named Credential enter the named credential you created in the step above. In this case DynamoDBNC.
  7. Connection Timeout is defaulted to the maximum of 120 seconds. This is the number of seconds to wait for a response before timing out.
  8. Writable External Objects defaults to read only for external objects. Select this only if you want to create, edit, and delete data that is stored in Amazon DynamoDB.
  9. Leave the other fields with their default values, and click Save.

Create Salesforce External Objects

Map tables in Amazon DynamoDB to one or more external objects in Salesforce. Combine all your data and content and present them in a friendly format for users in your org. This is done with external objects and associated fields. External objects are similar to custom objects, except that they map to data that's stored in DynamoDB.

  1. From Setup, enter External Objects into the Quick Find text box. Select External Objects and click New External Object.
  2. For Label enter a user-friendly name for the external object. For example, Shipping Manifest.
  3. For Plural Label enter the plural name of the external object. This name is used for the tab. For example, Shipping Manifests.
  4. Object Name autopopulates based on the Label, with the unique identifier that's used to refer to this external object definition when using the API. In this case, Shipping Manifest. Object names must be unique across all standard, custom, and external objects in the org.
  5. For External Data Source enter the external data source you created in the above step. In this case, ShippingDynamoDB.
  6. For Table Name enter the table in Amazon DynamoDB data source that the external object maps to. For example, ShippingData.
  7. Click Save.

Sync Object Metadata

Now that you have an external object it's time to sync object metadata from your DynamoDB.

  1. From Setup, enter External Data into the Quick Find text box. Select External Data Sources.
  2. Select the name of the external data source. In this case, ShippingDynamoDB.
  3. Click Validate and Sync.
  4. Select the DynamoDB tables you want to sync and click Sync.

Map External Object Fields to DynamoDB Attributes

The attribute values in DynamoDB must be appropriately mapped to the data type defined for the external object fields. The external object fields can be mapped to attributes of string, number, and boolean scalar types. 

Note

For attributes of string type that represent a date or a timestamp, the date, dateTime, or time must be stored in ISO 8601 format.

A typical use case is for records in DynamoDB to be displayed connected to a native Salesforce record. Here are some examples.

  • Multiple eCommerce Orders in DynamoDB that belong to one Account in Salesforce, appear as a Related List.
  • Multiple Shipments in DynamoDB that belong to one Account or Order in Salesforce, appear as a Related List.

Typically, these external records are linked to native records via Indirect Lookup fields. This avoids needing to transfer Salesforce record IDs into DynamoDB.

External Lookups are brought to bear when DynamoDB records need to reference each other. For example, Order Items looking up to Orders, Shipments looking up to Shippers or Warehouses, all of which reside in DynamoDB.

After the external object and its fields are created, you may have to provide additional configuration so that Salesforce can apply a schema-like concept on top of data that's inherently schemaless. See Manage Qualifiers for Salesforce Connect Adapter for Amazon DynamoDB.

Specify Qualifiers

Amazon DynamoDB uses unique design patterns that support multiple table and single table designs. This ensures efficiency. 

To make data stored in the Amazon DynamoDB table accessible to external objects, use qualifiers to reinterpret external data. The qualifiers describe the item attributes and indicate whether an item belongs to the schema represented by the external object. For multiple-table schema designs, the table qualifier is optional.

This is only the basics for the Salesforce Connect Adapter for Amazon DynamoDB. Be sure to check out the resources for more information and a deeper dive into the adapter.

Resources

在 Salesforce 帮助中分享 Trailhead 反馈

我们很想听听您使用 Trailhead 的经验——您现在可以随时从 Salesforce 帮助网站访问新的反馈表单。

了解更多 继续分享反馈