You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: src/pages/[platform]/build-a-backend/data/connect-to-existing-data-sources/connect-external-ddb-table/index.mdx
+19-12Lines changed: 19 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,27 +91,34 @@ export const data = defineData({
91
91
**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.
92
92
</Callout>
93
93
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:
95
95
96
-
1.On the **Schema** page, choose **Create Resources**.
96
+
1.Navigate to the [DynamoDB console](https://console.aws.amazon.com/dynamodb/).
97
97
98
-

98
+
2. Choose **Create table**.
99
99
100
-
2. Choose**Use existing type**, then choose the **Post** type.
100
+
3. For**Table name**, enter `PostTable`.
101
101
102
-

102
+
4. For **Partition key**, enter `id` and select **String** as the type.
103
103
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).
105
105
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**.
107
107
108
-

108
+
Alternatively, you can create the table using the AWS CLI:
109
109
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
+
```
113
120
114
-

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.
115
122
116
123
117
124
## Step 2 - Add your Amazon DynamoDB table as a data source
0 commit comments