Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.

Commit

Permalink
updates for review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jgrillo-grapl committed Jun 19, 2020
1 parent 086e723 commit 76a4c8d
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/js/grapl-cdk/lib/grapl-cdk-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,24 +314,18 @@ class EngagementCreator extends cdk.NestedStack {
}

class DGraphTtl extends cdk.NestedStack {
readonly event_handler: lambda.Function;
readonly name: string;
readonly rule: events.Rule;

constructor(
scope: cdk.Construct,
name: string,
prefix: string,
vpc: ec2.IVpc,
master_graph: DGraphEcs
) {
super(scope, name + "-stack");

this.name = name + prefix;

const grapl_version = process.env.GRAPL_VERSION || "latest";

this.event_handler = new lambda.Function(
let event_handler = new lambda.Function(
this, "Handler", {
runtime: Runtime.PYTHON_3_7,
handler: `app.app`,
Expand All @@ -350,10 +344,10 @@ class DGraphTtl extends cdk.NestedStack {
}
);

this.rule = new events.Rule(
scope, this.name + "-rule", {
new events.Rule(
scope, name + "-rule", {
schedule: events.Schedule.expression("rate(1 hour)"),
targets: [new targets.LambdaFunction(this.event_handler)]
targets: [new targets.LambdaFunction(event_handler)]
}
);
}
Expand Down Expand Up @@ -497,7 +491,6 @@ export class GraplCdkStack extends cdk.Stack {
new DGraphTtl(
this,
"dgraph-ttl",
prefix,
grapl_vpc,
master_graph
);
Expand Down

0 comments on commit 76a4c8d

Please sign in to comment.