Skip to content

Commit a3ee607

Browse files
author
Leon Michalski
committed
Generate for all modules
1 parent 19001e6 commit a3ee607

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

packages/aws-cdk-lib/aws-appconfig/lib/environment.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,10 @@ export abstract class Monitor {
421421
throw new UnscopedValidationError('You must specify an alarmArn property to use "fromCfnMonitorsProperty".');
422422
}
423423
return {
424-
alarmArn: monitorsProperty.alarmArn,
425-
alarmRoleArn: monitorsProperty.alarmRoleArn,
424+
alarmArn: (monitorsProperty.alarmArn as cloudwatch.IAlarmRef)?.alarmRef?.alarmArn
425+
?? (monitorsProperty.alarmArn as cloudwatch.ICompositeAlarmRef)?.compositeAlarmRef?.compositeAlarmArn
426+
?? monitorsProperty.alarmArn,
427+
alarmRoleArn: (monitorsProperty.alarmRoleArn as iam.IRoleRef)?.roleRef?.roleArn ?? monitorsProperty.alarmRoleArn,
426428
monitorType: MonitorType.CFN_MONITORS_PROPERTY,
427429
};
428430
}

tools/@aws-cdk/spec2cdk/lib/cdk/relationship-decider.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,7 @@ import { createModuleDefinitionFromCfnNamespace } from '../cfn2ts/pkglint';
55
import { log } from '../util';
66

77
// For now we want relationships to be applied only for these services
8-
const RELATIONSHIP_SERVICES = [
9-
'iam',
10-
'apigateway',
11-
'ec2',
12-
'cloudfront',
13-
'kms',
14-
's3',
15-
'lambda',
16-
];
8+
export const RELATIONSHIP_SERVICES: string[] = [];
179

1810
/**
1911
* Represents a cross-service property relationship that enables references
@@ -83,9 +75,6 @@ export class RelationshipDecider {
8375
* properties as a relationship can only target a primary identifier or arn
8476
*/
8577
private findTargetResource(sourcePropName: string, relationship: RelationshipRef) {
86-
if (!RELATIONSHIP_SERVICES.some(s => this.resource.cloudFormationType.toLowerCase().startsWith(`aws::${s}::`))) {
87-
return undefined;
88-
}
8978
const targetResource = this.db.lookup('resource', 'cloudFormationType', 'equals', relationship.cloudFormationType).only();
9079
const refProps = getReferenceProps(targetResource);
9180
const expectedPropName = referencePropertyName(relationship.propertyName, targetResource.name);

0 commit comments

Comments
 (0)