AWS Security ChangesHomeSearch

AWS cdk documentation change

Service: cdk · 2026-03-31 · Documentation low

File: cdk/v2/guide/ref-cli-cmd-diff.md

Summary

Updated CDK diff command documentation to replace deprecated --change-set flag with new --method option with auto, change-set, and template modes

Security assessment

This is a routine documentation update for a CLI command change. The update introduces a new --method parameter to replace the deprecated --change-set flag, providing more granular control over how diffs are computed. There's no evidence of security vulnerability remediation or security feature documentation in this change.

Diff

diff --git a/cdk/v2/guide/ref-cli-cmd-diff.md b/cdk/v2/guide/ref-cli-cmd-diff.md
index 4d91088d4..992f6abf4 100644
--- a//cdk/v2/guide/ref-cli-cmd-diff.md
+++ b//cdk/v2/guide/ref-cli-cmd-diff.md
@@ -35 +35 @@ For a list of global options that work with all CDK CLI commands, see [Global op
-`--change-set <BOOLEAN>`
+`--method, -m <STRING>`
@@ -38 +38 @@ For a list of global options that work with all CDK CLI commands, see [Global op
-Specify whether to create a change set to analyze resource replacements.
+Specifies how to compute the diff.
@@ -40 +40 @@ Specify whether to create a change set to analyze resource replacements.
-When `true`, the CDK CLI will create an AWS CloudFormation change set to display the exact changes that will be made to your stack. This output includes whether resources will be updated or replaced. The CDK CLI uses the deploy role instead of the lookup role to perform this action.
+  * `auto` – Default. Creates an AWS CloudFormation change set to display accurate replacement information. If the change set can’t be created (for example, due to missing permissions), falls back to a template-only diff. Uses the deploy role.
@@ -42 +42 @@ When `true`, the CDK CLI will create an AWS CloudFormation change set to display
-When `false`, a quicker, but less-accurate diff is performed by comparing CloudFormation templates. Any change detected to properties that require resource replacement will be displayed as a resource replacement, even if the change is purely cosmetic, like replacing a resource reference with a hard-coded ARN.
+  * `change-set` – Always creates a change set and fails if it can’t be created. Use this when you need guaranteed accuracy. Uses the deploy role.
@@ -44 +44,13 @@ When `false`, a quicker, but less-accurate diff is performed by comparing CloudF
-_Default value_ : `true`
+  * `template` – Compares CloudFormation templates directly. Faster, but less accurate. Any change detected to properties that require resource replacement is displayed as a resource replacement, even if the change is purely cosmetic. Uses the lookup role.
+
+_Default value_ : `auto`
+
+
+
+
+`--change-set <BOOLEAN>` _(deprecated)_
+    
+
+Specifies whether to create a change set to analyze resource replacements. Use `--method` instead.
+
+`--change-set` maps to `--method=auto`. `--no-change-set` maps to `--method=template`.
@@ -99 +111 @@ _Default value_ : `false`
-The path to the CloudFormation template to compare a CDK stack with.
+The path to the CloudFormation template to compare a CDK stack with. Implies `--method=template`.
@@ -124 +136 @@ The following is an example that shows a diff of local changes to a Lambda funct
-    Hold on while we create a read-only change set to get a diff with accurate replacement information (use --no-change-set to use a less accurate but faster template-only diff)
+    Hold on while we create a read-only change set to get a diff with accurate replacement information (use --method=template to use a less accurate but faster template-only diff)