Skip to content

Commit f02cbb3

Browse files
authored
docs: replace AppSync console instructions with DynamoDB table creation (#8472)
Remove outdated AppSync console workflow for creating DynamoDB tables and replace with direct DynamoDB console and CLI instructions. This simplifies the setup process and removes dependency on deprecated AppSync console features.
1 parent 3d5d261 commit f02cbb3

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed
-41.5 KB
Binary file not shown.
-115 KB
Binary file not shown.
-157 KB
Binary file not shown.
-157 KB
Binary file not shown.

src/pages/[platform]/build-a-backend/data/connect-to-existing-data-sources/connect-external-ddb-table/index.mdx

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,27 +91,34 @@ export const data = defineData({
9191
**NOTE:** To comply with the GraphQL spec, at least one query is required for a schema to be valid. Otherwise, deployments will fail with a schema error. The Amplify Data schema is auto-generated with a `Todo` model and corresponding queries under the hood. You can leave the `Todo` model in the schema until you add the first custom query to the schema in the next steps.
9292
</Callout>
9393

94-
Once the deployment successfully completes, navigate to the AppSync console and select your Amplify-generated API. Follow these steps to create a new DynamoDB table:
94+
Once the deployment successfully completes, you need to create a DynamoDB table that will serve as your external data source. You can create this table using the AWS Console, AWS CLI, or AWS CDK. For this example, we'll create it using the DynamoDB console:
9595

96-
1. On the **Schema** page, choose **Create Resources**.
96+
1. Navigate to the [DynamoDB console](https://console.aws.amazon.com/dynamodb/).
9797

98-
![AWS AppSync console showing navigation pane with "AWS AppSync" expanded and "APIs" > "TestAPI" selected. Main content displays "Schema Info" section with a "Create Resources" button.](/images/create-ddb-resource-0.png)
98+
2. Choose **Create table**.
9999

100-
2. Choose **Use existing type**, then choose the **Post** type.
100+
3. For **Table name**, enter `PostTable`.
101101

102-
![AWS AppSync console, "Create Resources" page. A prominent heading reads "Create Resources". Radio buttons are presented for either defining a new type or selecting an existing type for the table creation.](/images/create-ddb-resource-1.png)
102+
4. For **Partition key**, enter `id` and select **String** as the type.
103103

104-
3. Set the **Primary key** to `id` and the **Sort key** to `None`.
104+
5. Leave **Sort key** empty (we don't need one for this example).
105105

106-
4. Disable **Automatically generate GraphQL**. In this example, we'll create the resolver ourselves.
106+
6. Keep the default settings for the remaining options and choose **Create table**.
107107

108-
![AWS AppSync console, "Create a table to hold Post objects" page. A table structure is shown with columns and values of "Table name": "PostTable", "Primary Key": "id", and "Sort key": "None". Below the table, there is an option to "Automatically generate GraphQL" which is disabled.](/images/create-ddb-resource-2.png)
108+
Alternatively, you can create the table using the AWS CLI:
109109

110-
5. Choose **Create**.
111-
112-
You now have a new DynamoDB table named `PostTable`, which you can see by visiting `Data sources` in the side tab. You will use this table as the data source for your custom queries and mutations to your Amazon DynamoDB table.
110+
```bash
111+
aws dynamodb create-table \
112+
--table-name PostTable \
113+
--attribute-definitions \
114+
AttributeName=id,AttributeType=S \
115+
--key-schema \
116+
AttributeName=id,KeyType=HASH \
117+
--provisioned-throughput \
118+
ReadCapacityUnits=5,WriteCapacityUnits=5
119+
```
113120

114-
![AWS AppSync console, 'Data sources' page. The page shows a list of existing data sources connected to an API. The data sources include an Amazon DynamoDB table named 'PostTable' and another table named 'Todo'.*](/images/create-ddb-resource-3.png)
121+
You now have a new DynamoDB table named `PostTable` that exists independently of your Amplify-generated resources. You will use this table as the data source for your custom queries and mutations.
115122

116123

117124
## Step 2 - Add your Amazon DynamoDB table as a data source

0 commit comments

Comments
 (0)