From 98ca670b9cf7f164183a606217fecfbc3a0d1704 Mon Sep 17 00:00:00 2001 From: Calvin Combs Date: Fri, 3 Jun 2022 12:31:46 -0700 Subject: [PATCH 01/13] fixed mapping issue --- packages/@aws-cdk/core/lib/cfn-mapping.ts | 35 +++++++++++++++- packages/@aws-cdk/core/test/mappings.test.ts | 44 +++++++++++++++++++- 2 files changed, 76 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk/core/lib/cfn-mapping.ts b/packages/@aws-cdk/core/lib/cfn-mapping.ts index d8a5f6a972f5d..7c30a274398d9 100644 --- a/packages/@aws-cdk/core/lib/cfn-mapping.ts +++ b/packages/@aws-cdk/core/lib/cfn-mapping.ts @@ -2,6 +2,8 @@ import { Construct } from 'constructs'; import { Annotations } from './annotations'; import { CfnRefElement } from './cfn-element'; import { Fn } from './cfn-fn'; +import { IResolvable, IResolveContext } from './resolvable'; +import { Stack } from './stack'; import { Token } from './token'; type Mapping = { [k1: string]: { [k2: string]: any } }; @@ -41,7 +43,7 @@ export class CfnMapping extends CfnRefElement { private lazyRender = false; private lazyInformed = false; - constructor(scope: Construct, id: string, props: CfnMappingProps = {}) { + constructor(scope: Construct, readonly id: string, props: CfnMappingProps = {}) { super(scope, id); this.mapping = props.mapping ? this.validateMapping(props.mapping) : {}; this.lazy = props.lazy; @@ -83,7 +85,8 @@ export class CfnMapping extends CfnRefElement { } else { this.lazyRender = true; } - return Fn.findInMap(this.logicalId, key1, key2); + //return Fn.findInMap(this.logicalId, key1, key2); + return new CrossStackToken(this.id, this.mapping, Fn.findInMap(this.logicalId, key1, key2)).toString(); } /** @@ -123,3 +126,31 @@ export class CfnMapping extends CfnRefElement { } } } + +class CrossStackToken implements IResolvable { + readonly creationStack: string[] = []; + + constructor(readonly mappingId: string, readonly mapping: Mapping, readonly value: string) { + } + + public resolve(context: IResolveContext): string { + const consumingStack = Stack.of(context.scope); + const childIds: string[] = []; + + for (const child of consumingStack.node.children) { + childIds.push(child.node.id); + } + + if (!childIds.includes(this.mappingId)) { + new CfnMapping(consumingStack, this.mappingId, { + mapping: this.mapping, + }); + } + + return this.value; + } + + public toString() { + return Token.asString(this); + } +} diff --git a/packages/@aws-cdk/core/test/mappings.test.ts b/packages/@aws-cdk/core/test/mappings.test.ts index 5d67aa0163e68..5ad550fc97833 100644 --- a/packages/@aws-cdk/core/test/mappings.test.ts +++ b/packages/@aws-cdk/core/test/mappings.test.ts @@ -1,6 +1,6 @@ import { ArtifactMetadataEntryType } from '@aws-cdk/cloud-assembly-schema'; import { CloudAssembly } from '@aws-cdk/cx-api'; -import { App, Aws, CfnMapping, CfnResource, Fn, Stack } from '../lib'; +import { App, Aws, CfnMapping, CfnResource, CfnOutput, Fn, Stack } from '../lib'; import { toCloudFormation } from './util'; describe('mappings', () => { @@ -149,6 +149,48 @@ describe('mappings', () => { }, })).toThrowError(/Attribute name 'us-east-1' must contain only alphanumeric characters./); }); + + test('cross stack', () => { + const stack1 = new Stack(undefined, 'stack1'); + const stack2 = new Stack(undefined, 'stack2'); + + const mapping = new CfnMapping(stack1, 'MyMapping', { + mapping: { + boo: { + bah: 'foo', + }, + }, + }); + + new CfnOutput(stack2, 'Output', { + value: mapping.findInMap('boo', 'bah'), + }); + + const v1 = mapping.findInMap('boo', 'bah'); + const v2 = Fn.findInMap(mapping.logicalId, 'boo', 'bah'); + + const expected = { 'Fn::FindInMap': ['MyMapping', 'boo', 'bah'] }; + expect(stack1.resolve(v1)).toEqual(expected); + expect(stack1.resolve(v2)).toEqual(expected); + expect(toCloudFormation(stack1).Mappings).toEqual({ + MyMapping: { + boo: { + bah: 'foo', + }, + }, + }); + expect(stack2.resolve(v1)).toEqual(expected); + expect(stack2.resolve(v2)).toEqual(expected); + expect(toCloudFormation(stack2).Mappings).toEqual({ + MyMapping: { + boo: { + bah: 'foo', + }, + }, + }); + //expect(toCloudFormation(stack2).Outputs).toEqual({ + //}); + }); }); describe('lazy mapping', () => { From 9b3adc86edf8dc7a4795c07c02b47b19e4fa7cfc Mon Sep 17 00:00:00 2001 From: Calvin Combs Date: Fri, 3 Jun 2022 12:32:12 -0700 Subject: [PATCH 02/13] removed comment --- packages/@aws-cdk/core/lib/cfn-mapping.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/core/lib/cfn-mapping.ts b/packages/@aws-cdk/core/lib/cfn-mapping.ts index 7c30a274398d9..d7bcbe1a8d50d 100644 --- a/packages/@aws-cdk/core/lib/cfn-mapping.ts +++ b/packages/@aws-cdk/core/lib/cfn-mapping.ts @@ -85,7 +85,7 @@ export class CfnMapping extends CfnRefElement { } else { this.lazyRender = true; } - //return Fn.findInMap(this.logicalId, key1, key2); + return new CrossStackToken(this.id, this.mapping, Fn.findInMap(this.logicalId, key1, key2)).toString(); } From 175f8a47ea39b1483bcd1875751e3d59cd1f0e1c Mon Sep 17 00:00:00 2001 From: Calvin Combs Date: Fri, 3 Jun 2022 14:16:00 -0700 Subject: [PATCH 03/13] test --- packages/@aws-cdk/core/test/mappings.test.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/core/test/mappings.test.ts b/packages/@aws-cdk/core/test/mappings.test.ts index 5ad550fc97833..51463a749f00e 100644 --- a/packages/@aws-cdk/core/test/mappings.test.ts +++ b/packages/@aws-cdk/core/test/mappings.test.ts @@ -188,8 +188,17 @@ describe('mappings', () => { }, }, }); - //expect(toCloudFormation(stack2).Outputs).toEqual({ - //}); + expect(toCloudFormation(stack2).Outputs).toEqual({ + Output: { + Value: { + 'Fn::FindInMap': [ + 'MyMapping', + 'boo', + 'bah', + ], + }, + }, + }); }); }); From dfb9919329c8f48dbacd866e471d3eb1d6539681 Mon Sep 17 00:00:00 2001 From: Calvin Combs Date: Fri, 3 Jun 2022 14:41:21 -0700 Subject: [PATCH 04/13] rename --- packages/@aws-cdk/core/lib/cfn-mapping.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/core/lib/cfn-mapping.ts b/packages/@aws-cdk/core/lib/cfn-mapping.ts index d7bcbe1a8d50d..0441182b1b8f8 100644 --- a/packages/@aws-cdk/core/lib/cfn-mapping.ts +++ b/packages/@aws-cdk/core/lib/cfn-mapping.ts @@ -86,7 +86,7 @@ export class CfnMapping extends CfnRefElement { this.lazyRender = true; } - return new CrossStackToken(this.id, this.mapping, Fn.findInMap(this.logicalId, key1, key2)).toString(); + return new CfnMappingEmbedder(this.id, this.mapping, Fn.findInMap(this.logicalId, key1, key2)).toString(); } /** @@ -127,7 +127,7 @@ export class CfnMapping extends CfnRefElement { } } -class CrossStackToken implements IResolvable { +class CfnMappingEmbedder implements IResolvable { readonly creationStack: string[] = []; constructor(readonly mappingId: string, readonly mapping: Mapping, readonly value: string) { From 222743feca81c91173f99b80f10c395bb64c48bd Mon Sep 17 00:00:00 2001 From: Calvin Combs Date: Fri, 3 Jun 2022 15:00:29 -0700 Subject: [PATCH 05/13] formatting --- packages/@aws-cdk/core/lib/cfn-mapping.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/@aws-cdk/core/lib/cfn-mapping.ts b/packages/@aws-cdk/core/lib/cfn-mapping.ts index 0441182b1b8f8..19a620181fb22 100644 --- a/packages/@aws-cdk/core/lib/cfn-mapping.ts +++ b/packages/@aws-cdk/core/lib/cfn-mapping.ts @@ -130,8 +130,7 @@ export class CfnMapping extends CfnRefElement { class CfnMappingEmbedder implements IResolvable { readonly creationStack: string[] = []; - constructor(readonly mappingId: string, readonly mapping: Mapping, readonly value: string) { - } + constructor(readonly mappingId: string, readonly mapping: Mapping, readonly value: string) { } public resolve(context: IResolveContext): string { const consumingStack = Stack.of(context.scope); From 61c436726a23164c88b86e134554a6f86bcbf00d Mon Sep 17 00:00:00 2001 From: Calvin Combs Date: Fri, 3 Jun 2022 15:02:12 -0700 Subject: [PATCH 06/13] test name --- packages/@aws-cdk/core/test/mappings.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/core/test/mappings.test.ts b/packages/@aws-cdk/core/test/mappings.test.ts index 51463a749f00e..64300f2d7dc4b 100644 --- a/packages/@aws-cdk/core/test/mappings.test.ts +++ b/packages/@aws-cdk/core/test/mappings.test.ts @@ -150,7 +150,7 @@ describe('mappings', () => { })).toThrowError(/Attribute name 'us-east-1' must contain only alphanumeric characters./); }); - test('cross stack', () => { + test('using the value of a mapping in a different stack copies the mapping to the consuming stack', () => { const stack1 = new Stack(undefined, 'stack1'); const stack2 = new Stack(undefined, 'stack2'); From e9939840c071531f4ccb681d5355b7459b22d538 Mon Sep 17 00:00:00 2001 From: Calvin Combs Date: Fri, 3 Jun 2022 15:03:46 -0700 Subject: [PATCH 07/13] removed debug info --- packages/@aws-cdk/core/test/mappings.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/core/test/mappings.test.ts b/packages/@aws-cdk/core/test/mappings.test.ts index 64300f2d7dc4b..b0cbd4f107671 100644 --- a/packages/@aws-cdk/core/test/mappings.test.ts +++ b/packages/@aws-cdk/core/test/mappings.test.ts @@ -151,8 +151,8 @@ describe('mappings', () => { }); test('using the value of a mapping in a different stack copies the mapping to the consuming stack', () => { - const stack1 = new Stack(undefined, 'stack1'); - const stack2 = new Stack(undefined, 'stack2'); + const stack1 = new Stack(); + const stack2 = new Stack(); const mapping = new CfnMapping(stack1, 'MyMapping', { mapping: { From 09021c86d100ed5a0d2978d9292c4f63c49d3a55 Mon Sep 17 00:00:00 2001 From: Calvin Combs Date: Mon, 6 Jun 2022 08:58:40 -0700 Subject: [PATCH 08/13] children are now correctly searched for --- packages/@aws-cdk/core/lib/cfn-mapping.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/packages/@aws-cdk/core/lib/cfn-mapping.ts b/packages/@aws-cdk/core/lib/cfn-mapping.ts index 19a620181fb22..85246e2ddb23d 100644 --- a/packages/@aws-cdk/core/lib/cfn-mapping.ts +++ b/packages/@aws-cdk/core/lib/cfn-mapping.ts @@ -134,13 +134,7 @@ class CfnMappingEmbedder implements IResolvable { public resolve(context: IResolveContext): string { const consumingStack = Stack.of(context.scope); - const childIds: string[] = []; - - for (const child of consumingStack.node.children) { - childIds.push(child.node.id); - } - - if (!childIds.includes(this.mappingId)) { + if (!consumingStack.node.tryFindChild(this.mappingId)) { new CfnMapping(consumingStack, this.mappingId, { mapping: this.mapping, }); From 795dfc16edd37f377192e00bef86423fa06e2276 Mon Sep 17 00:00:00 2001 From: Calvin Combs Date: Mon, 6 Jun 2022 09:07:03 -0700 Subject: [PATCH 09/13] made properties private --- packages/@aws-cdk/core/lib/cfn-mapping.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/core/lib/cfn-mapping.ts b/packages/@aws-cdk/core/lib/cfn-mapping.ts index 85246e2ddb23d..4c05c12a7d391 100644 --- a/packages/@aws-cdk/core/lib/cfn-mapping.ts +++ b/packages/@aws-cdk/core/lib/cfn-mapping.ts @@ -130,7 +130,7 @@ export class CfnMapping extends CfnRefElement { class CfnMappingEmbedder implements IResolvable { readonly creationStack: string[] = []; - constructor(readonly mappingId: string, readonly mapping: Mapping, readonly value: string) { } + constructor(private readonly mappingId: string, private readonly mapping: Mapping, private readonly value: string) { } public resolve(context: IResolveContext): string { const consumingStack = Stack.of(context.scope); From 9a4687647cc74c4d92b2cbf50182559f09340c94 Mon Sep 17 00:00:00 2001 From: Calvin Combs Date: Mon, 6 Jun 2022 11:23:48 -0700 Subject: [PATCH 10/13] recurse over all children --- packages/@aws-cdk/core/lib/cfn-mapping.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/@aws-cdk/core/lib/cfn-mapping.ts b/packages/@aws-cdk/core/lib/cfn-mapping.ts index 4c05c12a7d391..fbedb52d83201 100644 --- a/packages/@aws-cdk/core/lib/cfn-mapping.ts +++ b/packages/@aws-cdk/core/lib/cfn-mapping.ts @@ -132,9 +132,26 @@ class CfnMappingEmbedder implements IResolvable { constructor(private readonly mappingId: string, private readonly mapping: Mapping, private readonly value: string) { } + private tryFindChildRecurse(scope: Construct): boolean { + if (scope.node.tryFindChild(this.mappingId)) { + return true; + } + + for (const child of scope.node.children) { + if (this.tryFindChildRecurse(child)) { + return true; + } + } + + return false; + } + public resolve(context: IResolveContext): string { const consumingStack = Stack.of(context.scope); - if (!consumingStack.node.tryFindChild(this.mappingId)) { + // we must check the entire tree because CfnMappings can be + // added to Constructs and won't be direct children of the + // stack. This is done in aws-secretsmanager/lib/secret-rotation.ts + if (!this.tryFindChildRecurse(consumingStack)) { new CfnMapping(consumingStack, this.mappingId, { mapping: this.mapping, }); From 234d45d894602f937ca6772bd6d3ca0e216e4214 Mon Sep 17 00:00:00 2001 From: Calvin Combs Date: Mon, 13 Jun 2022 17:35:13 -0700 Subject: [PATCH 11/13] removed unneeded uid=39434934(comcalvi) gid=1896053708(ANT\Domain Users) groups=1896053708(ANT\Domain Users),12(everyone),61(localaccounts),80(admin),702(com.apple.sharepoint.group.2),33(_appstore),98(_lpadmin),100(_lpoperator),204(_developer),250(_analyticsusers),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh),400(com.apple.access_remote_ae),701(com.apple.sharepoint.group.1) --- packages/@aws-cdk/core/lib/cfn-mapping.ts | 4 ++-- packages/@aws-cdk/core/test/mappings.test.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/@aws-cdk/core/lib/cfn-mapping.ts b/packages/@aws-cdk/core/lib/cfn-mapping.ts index fbedb52d83201..b01e71621c641 100644 --- a/packages/@aws-cdk/core/lib/cfn-mapping.ts +++ b/packages/@aws-cdk/core/lib/cfn-mapping.ts @@ -43,7 +43,7 @@ export class CfnMapping extends CfnRefElement { private lazyRender = false; private lazyInformed = false; - constructor(scope: Construct, readonly id: string, props: CfnMappingProps = {}) { + constructor(scope: Construct, id: string, props: CfnMappingProps = {}) { super(scope, id); this.mapping = props.mapping ? this.validateMapping(props.mapping) : {}; this.lazy = props.lazy; @@ -86,7 +86,7 @@ export class CfnMapping extends CfnRefElement { this.lazyRender = true; } - return new CfnMappingEmbedder(this.id, this.mapping, Fn.findInMap(this.logicalId, key1, key2)).toString(); + return new CfnMappingEmbedder(this.node.id, this.mapping, Fn.findInMap(this.logicalId, key1, key2)).toString(); } /** diff --git a/packages/@aws-cdk/core/test/mappings.test.ts b/packages/@aws-cdk/core/test/mappings.test.ts index b0cbd4f107671..71639e92a241e 100644 --- a/packages/@aws-cdk/core/test/mappings.test.ts +++ b/packages/@aws-cdk/core/test/mappings.test.ts @@ -151,8 +151,9 @@ describe('mappings', () => { }); test('using the value of a mapping in a different stack copies the mapping to the consuming stack', () => { - const stack1 = new Stack(); - const stack2 = new Stack(); + const app = new App(); + const stack1 = new Stack(app, 'stack1'); + const stack2 = new Stack(app, 'stack2'); const mapping = new CfnMapping(stack1, 'MyMapping', { mapping: { From c65bcca0527e5cd59e7c3042ec09dd015a1b6144 Mon Sep 17 00:00:00 2001 From: Calvin Combs Date: Tue, 14 Jun 2022 15:28:41 -0700 Subject: [PATCH 12/13] simplified logic --- packages/@aws-cdk/core/lib/cfn-mapping.ts | 33 +++++++------------ packages/@aws-cdk/core/test/mappings.test.ts | 34 +++++++++++--------- 2 files changed, 31 insertions(+), 36 deletions(-) diff --git a/packages/@aws-cdk/core/lib/cfn-mapping.ts b/packages/@aws-cdk/core/lib/cfn-mapping.ts index b01e71621c641..15be7e1054185 100644 --- a/packages/@aws-cdk/core/lib/cfn-mapping.ts +++ b/packages/@aws-cdk/core/lib/cfn-mapping.ts @@ -86,7 +86,7 @@ export class CfnMapping extends CfnRefElement { this.lazyRender = true; } - return new CfnMappingEmbedder(this.node.id, this.mapping, Fn.findInMap(this.logicalId, key1, key2)).toString(); + return new CfnMappingEmbedder(this, this.mapping, key1, key2).toString(); } /** @@ -130,34 +130,25 @@ export class CfnMapping extends CfnRefElement { class CfnMappingEmbedder implements IResolvable { readonly creationStack: string[] = []; - constructor(private readonly mappingId: string, private readonly mapping: Mapping, private readonly value: string) { } + constructor(private readonly cfnMapping: CfnMapping, readonly mapping: Mapping, private readonly key1: string, private readonly key2: string) { } - private tryFindChildRecurse(scope: Construct): boolean { - if (scope.node.tryFindChild(this.mappingId)) { - return true; - } - - for (const child of scope.node.children) { - if (this.tryFindChildRecurse(child)) { - return true; - } + public resolve(context: IResolveContext): string { + const consumingStack = Stack.of(context.scope); + if (consumingStack === Stack.of(this.cfnMapping)) { + return Fn.findInMap(this.cfnMapping.logicalId, this.key1, this.key2); } - return false; - } + const constructScope = consumingStack; + const constructId = `MappingCopy-${this.cfnMapping.node.id}-${this.cfnMapping.node.addr}`; - public resolve(context: IResolveContext): string { - const consumingStack = Stack.of(context.scope); - // we must check the entire tree because CfnMappings can be - // added to Constructs and won't be direct children of the - // stack. This is done in aws-secretsmanager/lib/secret-rotation.ts - if (!this.tryFindChildRecurse(consumingStack)) { - new CfnMapping(consumingStack, this.mappingId, { + let mappingCopy = constructScope.node.tryFindChild(constructId) as CfnMapping | undefined; + if (!mappingCopy) { + mappingCopy = new CfnMapping(constructScope, constructId, { mapping: this.mapping, }); } - return this.value; + return Fn.findInMap(mappingCopy.logicalId, this.key1, this.key2); } public toString() { diff --git a/packages/@aws-cdk/core/test/mappings.test.ts b/packages/@aws-cdk/core/test/mappings.test.ts index 71639e92a241e..d7ef368a90afd 100644 --- a/packages/@aws-cdk/core/test/mappings.test.ts +++ b/packages/@aws-cdk/core/test/mappings.test.ts @@ -152,10 +152,10 @@ describe('mappings', () => { test('using the value of a mapping in a different stack copies the mapping to the consuming stack', () => { const app = new App(); - const stack1 = new Stack(app, 'stack1'); - const stack2 = new Stack(app, 'stack2'); + const creationStack = new Stack(app, 'creationStack'); + const consumingStack = new Stack(app, 'consumingStack'); - const mapping = new CfnMapping(stack1, 'MyMapping', { + const mapping = new CfnMapping(creationStack, 'MyMapping', { mapping: { boo: { bah: 'foo', @@ -163,37 +163,41 @@ describe('mappings', () => { }, }); - new CfnOutput(stack2, 'Output', { + new CfnOutput(consumingStack, 'Output', { value: mapping.findInMap('boo', 'bah'), }); const v1 = mapping.findInMap('boo', 'bah'); - const v2 = Fn.findInMap(mapping.logicalId, 'boo', 'bah'); + let v2 = Fn.findInMap(mapping.logicalId, 'boo', 'bah'); - const expected = { 'Fn::FindInMap': ['MyMapping', 'boo', 'bah'] }; - expect(stack1.resolve(v1)).toEqual(expected); - expect(stack1.resolve(v2)).toEqual(expected); - expect(toCloudFormation(stack1).Mappings).toEqual({ + const creationStackExpected = { 'Fn::FindInMap': ['MyMapping', 'boo', 'bah'] }; + expect(creationStack.resolve(v1)).toEqual(creationStackExpected); + expect(creationStack.resolve(v2)).toEqual(creationStackExpected); + expect(toCloudFormation(creationStack).Mappings).toEqual({ MyMapping: { boo: { bah: 'foo', }, }, }); - expect(stack2.resolve(v1)).toEqual(expected); - expect(stack2.resolve(v2)).toEqual(expected); - expect(toCloudFormation(stack2).Mappings).toEqual({ - MyMapping: { + + const mappingCopyLogicalId = 'MappingCopyMyMappingc843c23de60b3672d919ab3e4cb2c14042794164d8'; + v2 = Fn.findInMap(mappingCopyLogicalId, 'boo', 'bah'); + const consumingStackExpected = { 'Fn::FindInMap': [mappingCopyLogicalId, 'boo', 'bah'] }; + expect(consumingStack.resolve(v1)).toEqual(consumingStackExpected); + expect(consumingStack.resolve(v2)).toEqual(consumingStackExpected); + expect(toCloudFormation(consumingStack).Mappings).toEqual({ + [mappingCopyLogicalId]: { boo: { bah: 'foo', }, }, }); - expect(toCloudFormation(stack2).Outputs).toEqual({ + expect(toCloudFormation(consumingStack).Outputs).toEqual({ Output: { Value: { 'Fn::FindInMap': [ - 'MyMapping', + mappingCopyLogicalId, 'boo', 'bah', ], From 092bb9e96418a9cdf2b91c60ae1a72a7a973eecc Mon Sep 17 00:00:00 2001 From: Calvin Combs Date: Tue, 14 Jun 2022 15:30:46 -0700 Subject: [PATCH 13/13] yep --- packages/@aws-cdk/core/test/mappings.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/@aws-cdk/core/test/mappings.test.ts b/packages/@aws-cdk/core/test/mappings.test.ts index d7ef368a90afd..18b6c76ba6bed 100644 --- a/packages/@aws-cdk/core/test/mappings.test.ts +++ b/packages/@aws-cdk/core/test/mappings.test.ts @@ -184,6 +184,7 @@ describe('mappings', () => { const mappingCopyLogicalId = 'MappingCopyMyMappingc843c23de60b3672d919ab3e4cb2c14042794164d8'; v2 = Fn.findInMap(mappingCopyLogicalId, 'boo', 'bah'); const consumingStackExpected = { 'Fn::FindInMap': [mappingCopyLogicalId, 'boo', 'bah'] }; + expect(consumingStack.resolve(v1)).toEqual(consumingStackExpected); expect(consumingStack.resolve(v2)).toEqual(consumingStackExpected); expect(toCloudFormation(consumingStack).Mappings).toEqual({