Skip to content

(cli): CDK_METHOD env var colision #1906

Description

@BDeus

Describe the bug

The CDK CLI dynamically load "CDK_" env var.
I use CDK_METHOD=template for diff to bypass change set.
Unfortunately, deploy use the same keyword with different value.

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

CDK_METHOD should not colision between cdk diff and cdk cli.

Current Behavior

When set CDK_METHOD=template, deploy does not recognize the value

Invalid values:
  Argument: method, Given: "template", Choices: "direct", "change-set", "prepare-change-set", "execute-change-set"

Reproduction Steps

export CDK_METHOD=template
cdk diff
cdk deploy

Invalid values:
Argument: method, Given: "template", Choices: "direct", "change-set", "prepare-change-set", "execute-change-set"

Possible Solution

Probably should used different key word between the two actions.

Additional Information/Context

No response

CDK CLI Version

2.1139.0

Framework Version

No response

Node.js Version

v24.14.0

OS

mac

Language

TypeScript

Language Version

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions