diff --git a/packages/aws-cdk/lib/diff.ts b/packages/aws-cdk/lib/diff.ts index c940efb46fca7..d25478f412b86 100644 --- a/packages/aws-cdk/lib/diff.ts +++ b/packages/aws-cdk/lib/diff.ts @@ -127,7 +127,7 @@ export function printSecurityDiff( const diff = fullDiff(oldTemplate, newTemplate.template, changeSet); // must output the stack name if there are differences, even if quiet - if (!quiet || !diff.isEmpty) { + if (stackName && (!quiet || !diff.isEmpty)) { stream.write(format('Stack %s\n', chalk.bold(stackName))); }