From 10ee28f886847a049264b9d2ac8406e97f9e1022 Mon Sep 17 00:00:00 2001 From: jgrillo Date: Fri, 26 Jun 2020 14:49:42 -0400 Subject: [PATCH] remove cdk-watchful DynamoDB stuff because we use on-demand pricing --- src/js/grapl-cdk/lib/grapl-cdk-stack.ts | 4 ++-- src/js/grapl-cdk/lib/historydb.ts | 20 +------------------- src/js/grapl-cdk/lib/userauthdb.ts | 7 +------ 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/src/js/grapl-cdk/lib/grapl-cdk-stack.ts b/src/js/grapl-cdk/lib/grapl-cdk-stack.ts index 5a3a36a6d8..8ea6857260 100644 --- a/src/js/grapl-cdk/lib/grapl-cdk-stack.ts +++ b/src/js/grapl-cdk/lib/grapl-cdk-stack.ts @@ -82,7 +82,7 @@ class NodeIdentifier extends cdk.Construct { ) { super(scope, id); - const history_db = new HistoryDb(this, 'graplhistorydb', watchful); + const history_db = new HistoryDb(this, 'graplhistorydb'); const unid_subgraphs = new EventEmitter(this, prefix + '-unid-subgraphs-generated'); this.bucket = unid_subgraphs.bucket; @@ -533,7 +533,7 @@ export class GraplCdkStack extends cdk.Stack { secretName: 'EdgeJwtSecret', }); - const user_auth_table = new UserAuthDb(this, 'UserAuthTable', watchful); + const user_auth_table = new UserAuthDb(this, 'UserAuthTable'); const analyzers_bucket = new s3.Bucket(this, prefix + '-analyzers-bucket', { bucketName: prefix + '-analyzers-bucket', diff --git a/src/js/grapl-cdk/lib/historydb.ts b/src/js/grapl-cdk/lib/historydb.ts index 93a756d2d9..79bec32020 100644 --- a/src/js/grapl-cdk/lib/historydb.ts +++ b/src/js/grapl-cdk/lib/historydb.ts @@ -4,8 +4,6 @@ import * as dynamodb from "@aws-cdk/aws-dynamodb"; import { Service } from "./service"; import { RemovalPolicy } from "@aws-cdk/core"; -import { Watchful } from "./vendor/cdk-watchful/lib/watchful"; - function create_table( scope: cdk.Construct, name: string, @@ -38,29 +36,16 @@ export class HistoryDb extends cdk.Construct { readonly dynamic_session_table: dynamodb.Table; readonly static_mapping_table: dynamodb.Table; - constructor(scope: cdk.Construct, id: string, watchful: Watchful) { + constructor(scope: cdk.Construct, id: string) { super(scope, id); this.proc_history = create_table(this, 'process_history_table'); - // watchful.watchDynamoTable(this.proc_history.tableName, this.proc_history); - this.file_history = create_table(this, 'file_history_table'); - // watchful.watchDynamoTable(this.file_history.tableName, this.file_history); - this.outbound_connection_history = create_table(this, 'outbound_connection_history_table'); - // watchful.watchDynamoTable(this.outbound_connection_history.tableName, this.outbound_connection_history); - this.inbound_connection_history = create_table(this, 'inbound_connection_history_table'); - // watchful.watchDynamoTable(this.inbound_connection_history.tableName, this.inbound_connection_history); - this.network_connection_history = create_table(this, 'network_connection_history_table'); - // watchful.watchDynamoTable(this.network_connection_history.tableName, this.network_connection_history); - this.ip_connection_history = create_table(this, 'ip_connection_history_table'); - // watchful.watchDynamoTable(this.ip_connection_history.tableName, this.ip_connection_history); - this.dynamic_session_table = create_table(this, 'dynamic_session_table'); - // watchful.watchDynamoTable(this.dynamic_session_table.tableName, this.dynamic_session_table); this.asset_history = new dynamodb.Table(this, 'asset_id_mappings', { tableName: "asset_id_mappings", @@ -75,7 +60,6 @@ export class HistoryDb extends cdk.Construct { billingMode: dynamodb.BillingMode.PAY_PER_REQUEST, removalPolicy: RemovalPolicy.DESTROY, }); - // watchful.watchDynamoTable(this.asset_history.tableName, this.asset_history); this.static_mapping_table = new dynamodb.Table(this, 'static_mapping_table', { tableName: "static_mapping_table", @@ -86,7 +70,6 @@ export class HistoryDb extends cdk.Construct { billingMode: dynamodb.BillingMode.PAY_PER_REQUEST, removalPolicy: RemovalPolicy.DESTROY, }); - // watchful.watchDynamoTable(this.static_mapping_table.tableName, this.static_mapping_table); this.node_id_retry_table = new dynamodb.Table(this, 'node_id_retry_table', { tableName: "node_id_retry_table", @@ -98,7 +81,6 @@ export class HistoryDb extends cdk.Construct { timeToLiveAttribute: "ttl_ts", removalPolicy: RemovalPolicy.DESTROY, }); - // watchful.watchDynamoTable(this.node_id_retry_table.tableName, this.node_id_retry_table); } allowReadWrite(service: Service) { diff --git a/src/js/grapl-cdk/lib/userauthdb.ts b/src/js/grapl-cdk/lib/userauthdb.ts index 9f4cbac5a8..d1a841d43c 100644 --- a/src/js/grapl-cdk/lib/userauthdb.ts +++ b/src/js/grapl-cdk/lib/userauthdb.ts @@ -5,15 +5,12 @@ import * as iam from "@aws-cdk/aws-iam"; import { Service } from "./service" import { RemovalPolicy } from "@aws-cdk/core"; -import { Watchful } from "./vendor/cdk-watchful/lib/watchful"; - export class UserAuthDb extends cdk.Construct { readonly user_auth_table: dynamodb.Table; constructor( scope: cdk.Construct, - id: string, - watchful: Watchful + id: string ) { super(scope, id); @@ -27,8 +24,6 @@ export class UserAuthDb extends cdk.Construct { billingMode: dynamodb.BillingMode.PAY_PER_REQUEST, removalPolicy: RemovalPolicy.DESTROY, }); - - // watchful.watchDynamoTable(this.user_auth_table.tableName, this.user_auth_table); } allowRead(service: Service) {