Skip to content

Commit c2cede1

Browse files
committed
Disable cron for now
1 parent 6439206 commit c2cede1

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

cdk/lib/__snapshots__/report.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ exports[`The Report stack matches the snapshot for CODE 1`] = `
453453
"EventConsumerEventConsumercron250211CE5C4": {
454454
"Properties": {
455455
"ScheduleExpression": "cron(2/5 * * * ? *)",
456-
"State": "ENABLED",
456+
"State": "DISABLED",
457457
"Tags": [
458458
{
459459
"Key": "App",
@@ -2121,7 +2121,7 @@ exports[`The Report stack matches the snapshot for PROD 1`] = `
21212121
"EventConsumerEventConsumercron250211CE5C4": {
21222122
"Properties": {
21232123
"ScheduleExpression": "cron(2/5 * * * ? *)",
2124-
"State": "ENABLED",
2124+
"State": "DISABLED",
21252125
"Tags": [
21262126
{
21272127
"Key": "App",

cdk/lib/report.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Duration, RemovalPolicy } from 'aws-cdk-lib';
1111
import type { CfnAutoScalingGroup } from 'aws-cdk-lib/aws-autoscaling';
1212
import { Table } from 'aws-cdk-lib/aws-dynamodb';
1313
import { InstanceClass, InstanceSize, InstanceType } from 'aws-cdk-lib/aws-ec2';
14-
import { Schedule } from 'aws-cdk-lib/aws-events';
14+
import { CfnRule, Schedule } from 'aws-cdk-lib/aws-events';
1515
import { Effect, PolicyStatement } from 'aws-cdk-lib/aws-iam';
1616
import { LoggingFormat, Runtime } from 'aws-cdk-lib/aws-lambda';
1717
import { Bucket } from 'aws-cdk-lib/aws-s3';
@@ -226,6 +226,12 @@ export class Report extends GuStack {
226226
functionName: [stack, eventConsumerApp, stage].join('-'),
227227
});
228228

229+
// Disable the schedule rule for testing
230+
const eventConsumerRule = eventConsumer.node.findChild(
231+
'EventConsumer-cron(2/5 * * * ? *)-0',
232+
).node.defaultChild as CfnRule;
233+
eventConsumerRule.state = 'DISABLED';
234+
229235
eventConsumer.addToRolePolicy(
230236
new PolicyStatement({
231237
effect: Effect.ALLOW,

0 commit comments

Comments
 (0)