Skip to content

fix(core): synth output is not valid YAML when using policy validation#37597

Merged
mergify[bot] merged 5 commits intomainfrom
conroy/stderr
Apr 16, 2026
Merged

fix(core): synth output is not valid YAML when using policy validation#37597
mergify[bot] merged 5 commits intomainfrom
conroy/stderr

Conversation

@kaizencc
Copy link
Copy Markdown
Contributor

@kaizencc kaizencc commented Apr 14, 2026

Closes #25331

Reason for this change

According to synth docs, CDK is supposed to support cdk synth > template.yml

When using policy validation, some outputs are being written to stdout. This makes the stdout not valid YAML (in situations where we specify a single stack and thus write the YAML template to stdout).

Description of changes

Instead of writing to stdout, we write to stderr. This is a pattern established elsewhere in CDK where we reserve stdout for the YAML template. No new tests; only the output channel is being changed and is reflected in updated tests.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@kaizencc kaizencc requested a review from a team as a code owner April 14, 2026 17:43
@github-actions github-actions bot added bug This issue is a bug. effort/medium Medium work item – several days of effort p2 labels Apr 14, 2026
@aws-cdk-automation aws-cdk-automation requested a review from a team April 14, 2026 17:43
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Apr 14, 2026
Copy link
Copy Markdown
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This review is outdated)

@kaizencc kaizencc added pr-linter/exempt-test The PR linter will not require test changes pr-linter/exempt-integ-test The PR linter will not require integ test changes labels Apr 14, 2026
@aws-cdk-automation aws-cdk-automation dismissed their stale review April 14, 2026 20:02

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

Tests were asserting on consoleLogMock for messages that now go to
console.error. Updated all test assertions to read from
consoleErrorMock with adjusted call indices since 'Performing Policy
Validations' is now also on stderr (index 0), shifting the report
to index 1.
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 16, 2026

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 16, 2026

Merge Queue Status

  • Entered queue2026-04-16 02:24 UTC · Rule: default-squash
  • Checks skipped · PR is already up-to-date
  • Merged2026-04-16 02:25 UTC · at 57960feab29c7450da8fbb5dd35f7ff36a7103cb

This pull request spent 10 seconds in the queue, including 1 second running CI.

Required conditions to merge

@mergify mergify bot merged commit 927dd60 into main Apr 16, 2026
19 of 20 checks passed
@mergify mergify bot deleted the conroy/stderr branch April 16, 2026 02:25
@github-actions
Copy link
Copy Markdown
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug This issue is a bug. contribution/core This is a PR that came from AWS. effort/medium Medium work item – several days of effort p2 pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/exempt-test The PR linter will not require test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(synthesis): CDK synth output is not valid CFN

3 participants