Skip to content

Commit 5092ae5

Browse files
committed
chore(appsync): don't retain dynamodb tables
Correctly tear down the tables created in the context of the test. Signed-off-by: Duarte Nunes <duarte@uma.ni>
1 parent 9d11c4e commit 5092ae5

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

packages/@aws-cdk/aws-appsync/test/integ.graphql.expected.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,8 @@
483483
],
484484
"BillingMode": "PAY_PER_REQUEST"
485485
},
486-
"UpdateReplacePolicy": "Retain",
487-
"DeletionPolicy": "Retain"
486+
"UpdateReplacePolicy": "Delete",
487+
"DeletionPolicy": "Delete"
488488
},
489489
"OrderTable416EB896": {
490490
"Type": "AWS::DynamoDB::Table",
@@ -511,8 +511,8 @@
511511
],
512512
"BillingMode": "PAY_PER_REQUEST"
513513
},
514-
"UpdateReplacePolicy": "Retain",
515-
"DeletionPolicy": "Retain"
514+
"UpdateReplacePolicy": "Delete",
515+
"DeletionPolicy": "Delete"
516516
}
517517
}
518518
}

packages/@aws-cdk/aws-appsync/test/integ.graphql.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { AttributeType, BillingMode, Table } from '@aws-cdk/aws-dynamodb';
2-
import { App, Stack } from '@aws-cdk/core';
2+
import { App, RemovalPolicy, Stack } from '@aws-cdk/core';
33
import { join } from 'path';
44
import { GraphQLApi, KeyCondition, MappingTemplate, PrimaryKey, Values } from '../lib';
55

@@ -17,6 +17,7 @@ const customerTable = new Table(stack, 'CustomerTable', {
1717
name: 'id',
1818
type: AttributeType.STRING,
1919
},
20+
removalPolicy: RemovalPolicy.DESTROY,
2021
});
2122
const orderTable = new Table(stack, 'OrderTable', {
2223
billingMode: BillingMode.PAY_PER_REQUEST,
@@ -27,7 +28,8 @@ const orderTable = new Table(stack, 'OrderTable', {
2728
sortKey: {
2829
name: 'order',
2930
type: AttributeType.STRING,
30-
}
31+
},
32+
removalPolicy: RemovalPolicy.DESTROY,
3133
});
3234

3335
const customerDS = api.addDynamoDbDataSource('Customer', 'The customer data source', customerTable);

0 commit comments

Comments
 (0)