The online Trailblazer Community becomes read-only Oct 30, 2026. Read More
Prepare your Salesforce org to access external data hosted by Amazon RDS by completing these steps.
Obtain access to a Salesforce org to set up and test your configuration. The sample data in this example represents a scenario where customer data is stored in Salesforce and order and product data are stored in Amazon RDS. Even though these are disparate data sources, the Order table has a foreign key identifying the customer who placed the order. This foreign key is used to create an indirect lookup that links orders to accounts in Salesforce. Load the sample data, and explore how customer data in Salesforce can be augmented with data from the external system.
Create a text field customerID on the Account object. Mark the field as an external ID and unique.
Import the data from the sample-customers.csv as Accounts and Contacts using the Data Import Wizard. Make sure to import the first column into the new customerID field.
Populate the new customerID field with the value CUST-3675 on a test Account.
The order data stored in Amazon RDS can be viewed as a related list on the Account page.
Define the connectivity and authentication to the GraphQL API endpoint as a named credential in Salesforce. The AWS server resources, created by running the CloudFormation template, are accessed from Salesforce (client application) via HTTP callouts. Named Credentials define the URL of the remote endpoint and capture its authentication parameters in the linked external credential.
The Salesforce Platform supports the use of permission sets to control which users are authorized to make callouts. All users, including System Administrators, need permissions to make the callout to the Amazon AppSync API.
From Setup, in the Quick Find box, enter Permission Sets, and then select Permission Sets.
Click New.
You can also identify a permission set shared by users who are authorized to make callouts. In a production environment, where many users need permissions to make this callout, consider adding the permission to a permission set group.
Note
Specify the label as Access External Systems, and enter other permission set information.
Click Save.
Click Manage Assignments, and then click Add Assignments to assign Access External Systems permission set to the identified users.
Follow the wizard to complete the process.
Use external credentials to set up an API Key and capture the authentication configuration required to access the Amazon AppSync endpoint.
From Setup, in the Quick Find box, enter Named Credentials, then select Named Credentials.
Click External Credentials, click New, and then set these fields.
Label: API Key Auth for AppSync
Name: APIKeyAuthForAppSync
Note the name to use when adding a custom header.
Authentication Protocol: Custom
Save the external credential.
After creating the external credential, store the API key securely, and then link its access to the Access External Systems permission set.
From Setup, in the Quick Find box, enter Named Credentials, then select Named Credentials.
Click External Credentials.
Under Custom Headers, click New, and then set these fields.
Name: x-api-key
This format is as required by Amazon AppSync and becomes the name of the header in the HTTP callout.
Value: {!$Credential.APIKeyAuthForAppSync.APIKey}
With this merge field syntax, you can reference the API key without reducing security by hard-coding the secret value in clear text.
Click Save.
After you create the external credential with custom authentication protocol and Access External Systems permission set to use for authenticating the AWS RDS, configure the named credential to specify the callout endpoint.
Named Credentials, then select Named Credentials.Named credentials reference external credentials, which specify authentication protocols and authorization information. In turn, external credentials leverage user external credentials to store encrypted authentication tokens. Any user performing an authenticated callout needs profile based, or permission set based, access to user external credentials.
From Setup, in the Quick Find box, enter Profiles, and then select Profiles.
Click the profile for whom you want to enable user external credentials.
Scroll to Standard Object Permissions, and select User External Credentials.
Check the boxes for the user external credential access that you want to give this user profile.
You must grant read, create, edit, and delete access even if the user is a system admin.
Note
Save the settings.
Create Salesforce’s representation of the external data source, and create the external objects via metadata sync. The AppSync GraphQL API acts as an external data source in Salesforce, which results in one or more external objects.
To create an external data source:
External Data Sources, then select External Data Sources.To create external objects:
External Data Sources, then select External Data Sources.