From e0718ef7cc26798ec2401451be9d7b7894f0b8bc Mon Sep 17 00:00:00 2001 From: Adam Ruka Date: Wed, 12 Jun 2019 05:06:28 -0700 Subject: [PATCH] fix(cli): correctly pass Stack-level Tags (#2829) Fixes #2822 --- packages/aws-cdk/lib/api/cxapp/stacks.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/aws-cdk/lib/api/cxapp/stacks.ts b/packages/aws-cdk/lib/api/cxapp/stacks.ts index e9438c5e2c359..e88d52a2a566e 100644 --- a/packages/aws-cdk/lib/api/cxapp/stacks.ts +++ b/packages/aws-cdk/lib/api/cxapp/stacks.ts @@ -5,6 +5,7 @@ import minimatch = require('minimatch'); import contextproviders = require('../../context-providers'); import { debug, error, print, warning } from '../../logging'; import { Configuration } from '../../settings'; +import { flatMap } from '../../util/arrays'; import { SDK } from '../util/sdk'; /** @@ -218,7 +219,7 @@ export class AppStacks { * @returns an array with the tags available in the stack metadata. */ public getTagsFromStackMetadata(stack: cxapi.CloudFormationStackArtifact): Tag[] { - return stack.findMetadataByType(cxapi.STACK_TAGS_METADATA_KEY).map(x => x.data); + return flatMap(stack.findMetadataByType(cxapi.STACK_TAGS_METADATA_KEY), x => x.data); } /**