Skip to content

Commit

Permalink
chore(appsync): don't retain dynamodb tables (#6401)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mergify[bot] authored Mar 4, 2020
1 parent e7760c5 commit 2117374
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,8 @@
],
"BillingMode": "PAY_PER_REQUEST"
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"OrderTable416EB896": {
"Type": "AWS::DynamoDB::Table",
Expand All @@ -602,8 +602,8 @@
],
"BillingMode": "PAY_PER_REQUEST"
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
}
}
}
6 changes: 4 additions & 2 deletions packages/@aws-cdk/aws-appsync/test/integ.graphql.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { UserPool } from '@aws-cdk/aws-cognito';
import { AttributeType, BillingMode, Table } from '@aws-cdk/aws-dynamodb';
import { App, Stack } from '@aws-cdk/core';
import { App, RemovalPolicy, Stack } from '@aws-cdk/core';
import { join } from 'path';
import { GraphQLApi, KeyCondition, MappingTemplate, PrimaryKey, UserPoolDefaultAction, Values } from '../lib';

Expand Down Expand Up @@ -35,6 +35,7 @@ const customerTable = new Table(stack, 'CustomerTable', {
name: 'id',
type: AttributeType.STRING,
},
removalPolicy: RemovalPolicy.DESTROY,
});
const orderTable = new Table(stack, 'OrderTable', {
billingMode: BillingMode.PAY_PER_REQUEST,
Expand All @@ -45,7 +46,8 @@ const orderTable = new Table(stack, 'OrderTable', {
sortKey: {
name: 'order',
type: AttributeType.STRING,
}
},
removalPolicy: RemovalPolicy.DESTROY,
});

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

0 comments on commit 2117374

Please sign in to comment.