From 211737452e9af66a3f2b214c44071362a2a3172d Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 4 Mar 2020 21:43:48 +0000 Subject: [PATCH] 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 Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- .../@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 2face78179375..f31e1ba15348c 100644 --- a/packages/@aws-cdk/aws-appsync/test/integ.graphql.expected.json +++ b/packages/@aws-cdk/aws-appsync/test/integ.graphql.expected.json @@ -574,8 +574,8 @@ ], "BillingMode": "PAY_PER_REQUEST" }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" }, "OrderTable416EB896": { "Type": "AWS::DynamoDB::Table", @@ -602,8 +602,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 a2efb337e3a28..d7fc704153599 100644 --- a/packages/@aws-cdk/aws-appsync/test/integ.graphql.ts +++ b/packages/@aws-cdk/aws-appsync/test/integ.graphql.ts @@ -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'; @@ -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, @@ -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);