Skip to content

Commit ff89ec5

Browse files
author
Leon Michalski
committed
Fix arrays not being passed as lazy
1 parent fcfab96 commit ff89ec5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/aws-cdk-lib/aws-cloudtrail/lib/cloudtrail.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as lambda from '../../aws-lambda';
77
import * as logs from '../../aws-logs';
88
import * as s3 from '../../aws-s3';
99
import * as sns from '../../aws-sns';
10-
import { Resource, Stack, ValidationError } from '../../core';
10+
import { Lazy, Resource, Stack, ValidationError } from '../../core';
1111
import { addConstructMetadata, MethodMetadata } from '../../core/lib/metadata-resource';
1212
import { propertyInjectable } from '../../core/lib/prop-injectable';
1313

@@ -351,7 +351,7 @@ export class Trail extends Resource {
351351
cloudWatchLogsLogGroupArn: this.logGroup?.logGroupArn,
352352
cloudWatchLogsRoleArn: logsRole?.roleArn,
353353
snsTopicName: this.topic?.topicName,
354-
eventSelectors: this.eventSelectors,
354+
eventSelectors: Lazy.any({ produce: () => [...this.eventSelectors] }),
355355
isOrganizationTrail: props.isOrganizationTrail,
356356
insightSelectors: this.insightTypeValues,
357357
});

packages/aws-cdk-lib/aws-codestarnotifications/lib/notification-rule.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as constructs from 'constructs';
22
import { CfnNotificationRule } from './codestarnotifications.generated';
33
import { INotificationRuleSource } from './notification-rule-source';
44
import { INotificationRuleTarget, NotificationRuleTargetConfig } from './notification-rule-target';
5-
import { IResource, Resource, Names } from '../../core';
5+
import { IResource, Resource, Names, Lazy } from '../../core';
66
import { addConstructMetadata, MethodMetadata } from '../../core/lib/metadata-resource';
77
import { propertyInjectable } from '../../core/lib/prop-injectable';
88

@@ -158,7 +158,7 @@ export class NotificationRule extends Resource implements INotificationRule {
158158
// It has a 64 characters limit for the name
159159
name: props.notificationRuleName || Names.uniqueId(this).slice(-64),
160160
detailType: props.detailType || DetailType.FULL,
161-
targets: this.targets,
161+
targets: Lazy.any({ produce: () => this.targets }),
162162
eventTypeIds: this.events,
163163
resource: source.sourceArn,
164164
status: props.enabled !== undefined

0 commit comments

Comments
 (0)