Skip to content

(watch) cdk watch has no way to write a CloudFormation outputs file (--outputs-file and cdk.json outputsFile both ignored) #1649

Description

@ShaMan123

Summary

There is no supported way to write a CloudFormation outputs file during cdk watch. cdk deploy writes outputs via either --outputs-file or the cdk.json outputsFile key; cdk watch honors neither, so a frontend/consumer outputs file can't be kept in sync during a watch session.

Environment

  • aws-cdk (CLI): 2.1128.0 (build 7daa104)
  • aws-cdk-lib: 2.258.1
  • node: v24.12.0
  • OS: macOS 26.5.1 (Darwin)

Reproduction

  • cdk watch --outputs-file out.jsonUnknown option(s): --outputs-file, --outputsFile. These will be ignored.
  • The cdk.json "outputsFile" key is silently ignored by cdk watch (it is honored by cdk deploy, verified on 2.1128.0).

Expected

cdk watch honors outputsFile (and/or --outputs-file), since it is cdk deploy --watch and each watch deployment is a deploy — or the limitation is documented.

Workaround

Run a cdk deploy --hotswap --outputs-file ... once before cdk watch to produce the outputs file, then watch for iteration (watch deployments don't change stack outputs).

Related

  • aws/aws-cdk-cli#1389 — the separate cdk deploy --outputs-file "no file written" regression; appears resolved on 2.1128.0 (the flag does write for cdk deploy here), so this issue is specifically about watch having no outputs-file mechanism.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions