From 5092ae5d76795e691dc8ecd317399842ecbca503 Mon Sep 17 00:00:00 2001 From: Duarte Nunes Date: Wed, 12 Feb 2020 23:34:19 -0300 Subject: [PATCH] chore(appsync): don't retain dynamodb tables Correctly tear down the tables created in the context of the test. Signed-off-by: Duarte Nunes --- .../@aws-cdk/aws-appsync/test/integ.graphql.expected.json | 8 ++++---- packages/@aws-cdk/aws-appsync/test/integ.graphql.ts | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/@aws-cdk/aws-appsync/test/integ.graphql.expected.json b/packages/@aws-cdk/aws-appsync/test/integ.graphql.expected.json index 1fad1ba0f55a6..7bdfe7337e8eb 100644 --- a/packages/@aws-cdk/aws-appsync/test/integ.graphql.expected.json +++ b/packages/@aws-cdk/aws-appsync/test/integ.graphql.expected.json @@ -483,8 +483,8 @@ ], "BillingMode": "PAY_PER_REQUEST" }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "OrderTable416EB896": { "Type": "AWS::DynamoDB::Table", @@ -511,8 +511,8 @@ ], "BillingMode": "PAY_PER_REQUEST" }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-appsync/test/integ.graphql.ts b/packages/@aws-cdk/aws-appsync/test/integ.graphql.ts index a3d1cee096029..f132677cf311c 100644 --- a/packages/@aws-cdk/aws-appsync/test/integ.graphql.ts +++ b/packages/@aws-cdk/aws-appsync/test/integ.graphql.ts @@ -1,5 +1,5 @@ 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, Values } from '../lib'; @@ -17,6 +17,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, @@ -27,7 +28,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);