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
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
+16-30
Original file line number
Diff line number
Diff line change
@@ -481,19 +481,18 @@ To delete your external DynamoDB table, you can navigate to the AppSync console
481
481
[Reference](https://docs.aws.amazon.com/appsync/latest/devguide/js-resolver-reference-dynamodb.html#js-aws-appsync-resolver-reference-dynamodb-getitem) - The `GetItem` request lets you tell the AWS AppSync DynamoDB function to make a `GetItem` request to DynamoDB, and enables you to specify:
482
482
483
483
- The key of the item in DynamoDB
484
-
485
484
- Whether to use a consistent read or not
486
485
487
486
**Example:**
488
487
489
488
```js
490
489
exportfunctionrequest(ctx) {
491
-
const {foo, bar} =ctx.args
490
+
const {foo, bar} =ctx.args;
492
491
return {
493
-
operation:"GetItem",
494
-
key:util.dynamodb.toMapValues({foo, bar}),
495
-
consistentRead:true
496
-
}
492
+
operation:'GetItem',
493
+
key:util.dynamodb.toMapValues({foo, bar}),
494
+
consistentRead:true
495
+
};
497
496
}
498
497
```
499
498
@@ -502,21 +501,20 @@ export function request(ctx) {
502
501
[PutItem](https://docs.aws.amazon.com/appsync/latest/devguide/js-resolver-reference-dynamodb.html#js-aws-appsync-resolver-reference-dynamodb-putitem) - The `PutItem` request mapping document lets you tell the AWS AppSync DynamoDB function to make a `PutItem` request to DynamoDB, and enables you to specify the following:
503
502
504
503
- The key of the item in DynamoDB
505
-
506
504
- The full contents of the item (composed of key and attributeValues)
@@ -526,15 +524,14 @@ export function request(ctx) {
526
524
[UpdateItem](https://docs.aws.amazon.com/appsync/latest/devguide/js-resolver-reference-dynamodb.html#js-aws-appsync-resolver-reference-dynamodb-updateitem) - The `UpdateItem` request enables you to tell the AWS AppSync DynamoDB function to make a `UpdateItem` request to DynamoDB and allows you to specify the following:
527
525
528
526
- The key of the item in DynamoDB
529
-
530
527
- An update expression describing how to update the item in DynamoDB
531
-
532
528
- Conditions for the operation to succeed
533
529
534
530
**Example:**
535
531
536
532
```js
537
533
import { util } from'@aws-appsync/utils';
534
+
538
535
exportfunctionrequest(ctx) {
539
536
const { id } =ctx.args;
540
537
return {
@@ -543,8 +540,8 @@ export function request(ctx) {
543
540
update: {
544
541
expression:'ADD #voteField :plusOne, version :plusOne',
545
542
expressionNames: { '#voteField':'upvotes' },
546
-
expressionValues: { ':plusOne': { N:1 } },
547
-
},
543
+
expressionValues: { ':plusOne': { N:1 } }
544
+
}
548
545
};
549
546
}
550
547
```
@@ -554,17 +551,17 @@ export function request(ctx) {
554
551
[DeleteItem](https://docs.aws.amazon.com/appsync/latest/devguide/js-resolver-reference-dynamodb.html#js-aws-appsync-resolver-reference-dynamodb-deleteitem) - The `DeleteItem` request lets you tell the AWS AppSync DynamoDB function to make a `DeleteItem` request to DynamoDB, and enables you to specify the following:
@@ -574,17 +571,11 @@ export function request(ctx) {
574
571
[Query](https://docs.aws.amazon.com/appsync/latest/devguide/js-resolver-reference-dynamodb.html#js-aws-appsync-resolver-reference-dynamodb-query) - The Query request object lets you tell the AWS AppSync DynamoDB resolver to make a Query request to DynamoDB, and enables you to specify the following:
575
572
576
573
- Key expression
577
-
578
574
- Which index to use
579
-
580
575
- Any additional filter
581
-
582
576
- How many items to return
583
-
584
577
- Whether to use consistent reads
585
-
586
578
- query direction (forward or backward)
587
-
588
579
- Pagination token
589
580
590
581
**Example:**
@@ -598,9 +589,9 @@ export function request(ctx) {
@@ -609,15 +600,10 @@ export function request(ctx) {
609
600
[Scan](https://docs.aws.amazon.com/appsync/latest/devguide/js-resolver-reference-dynamodb.html#js-aws-appsync-resolver-reference-dynamodb-scan) - The `Scan` request lets you tell the AWS AppSync DynamoDB function to make a `Scan` request to DynamoDB, and enables you to specify the following:
You can cancel any mutation API request by calling `.cancel` on the mutation request promise that's returned by `.create(...)`, `.update(...)`, or `.delete(...)`.
Copy file name to clipboardExpand all lines: src/pages/[platform]/build-a-backend/data/override-resources/index.mdx
+21-20
Original file line number
Diff line number
Diff line change
@@ -34,53 +34,53 @@ Amplify GraphQL API uses a variety of auto-generated, underlying AWS services an
34
34
35
35
In your Amplify app, you can access every underlying resource using CDK ["L2"](https://docs.aws.amazon.com/cdk/v2/guide/constructs.html#constructs_using) or ["L1"](https://docs.aws.amazon.com/cdk/v2/guide/constructs.html#constructs_l1_using) constructs. Access the generated resources as L2 constructs via the `.resources` property on the returned stack or access the generated resources as L1 constructs using the `.resources.cfnResources` property.
for (const table ofObject.values(cfnResources.amplifyDynamoDbTables)) {
48
48
table.pointInTimeRecoveryEnabled=true;
49
-
});
49
+
}
50
50
```
51
51
52
52
## Customize Amplify-generated AppSync GraphQL API resources
53
53
54
54
Apply all the customizations on `backend.data.resources.graphqlApi` or `backend.data.resources.cfnResources.cfnGraphqlApi`. For example, to enable X-Ray tracing for the AppSync GraphQL API:
## Customize Amplify-generated resources for data models
70
70
71
71
Pass in the model type name into `backend.data.resources.amplifyDynamoDbTables["MODEL_NAME"]` to modify the resources generated for that particular model type. For example, to enable time-to-live on the Todo `@model` type's DynamoDB table:
Set the [DynamoDB billing mode](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-billingmode) for the DynamoDB table as either "PROVISIONED" or "PAY_PER_REQUEST".
### Example - Configure provisioned throughput for a DynamoDB table
107
108
108
109
Override the default [ProvisionedThroughput](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-provisionedthroughput) provisioned for each model table and its Global Secondary Indexes (GSI). This override is only valid if the "DynamoDBBillingMode" is set to "PROVISIONED".
Enable/disable [DynamoDB point-in-time recovery](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-pointintimerecoveryspecification.html) for each model table.
0 commit comments