Skip to content

Commit 2117374

Browse files
authored
chore(appsync): don't retain dynamodb tables (#6401)
Correctly tear down the tables created in the context of the test. Signed-off-by: Duarte Nunes <duarte@uma.ni> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent e7760c5 commit 2117374

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
@@ -574,8 +574,8 @@
574574
],
575575
"BillingMode": "PAY_PER_REQUEST"
576576
},
577-
"UpdateReplacePolicy": "Retain",
578-
"DeletionPolicy": "Retain"
577+
"UpdateReplacePolicy": "Delete",
578+
"DeletionPolicy": "Delete"
579579
},
580580
"OrderTable416EB896": {
581581
"Type": "AWS::DynamoDB::Table",
@@ -602,8 +602,8 @@
602602
],
603603
"BillingMode": "PAY_PER_REQUEST"
604604
},
605-
"UpdateReplacePolicy": "Retain",
606-
"DeletionPolicy": "Retain"
605+
"UpdateReplacePolicy": "Delete",
606+
"DeletionPolicy": "Delete"
607607
}
608608
}
609609
}

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

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

@@ -35,6 +35,7 @@ const customerTable = new Table(stack, 'CustomerTable', {
3535
name: 'id',
3636
type: AttributeType.STRING,
3737
},
38+
removalPolicy: RemovalPolicy.DESTROY,
3839
});
3940
const orderTable = new Table(stack, 'OrderTable', {
4041
billingMode: BillingMode.PAY_PER_REQUEST,
@@ -45,7 +46,8 @@ const orderTable = new Table(stack, 'OrderTable', {
4546
sortKey: {
4647
name: 'order',
4748
type: AttributeType.STRING,
48-
}
49+
},
50+
removalPolicy: RemovalPolicy.DESTROY,
4951
});
5052

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

0 commit comments

Comments
 (0)