aws-cdk 2.1029.0 → 2.1029.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1194,6 +1194,28 @@ locations for a given environment. Resource locations are in the format
1194
1194
  resource currently deployed, while the destination must refer to a location
1195
1195
  that is not already occupied by any resource.
1196
1196
 
1197
+ #### How resources are compared
1198
+
1199
+ To determine if a resource was moved or renamed, the CLI computes a digest
1200
+ for each resource, both in the deployed stacks and in the local stacks, and
1201
+ then compares the digests.
1202
+
1203
+ Conceptually, the digest is computed as:
1204
+
1205
+ ```
1206
+ digest(resource) = hash(type + properties + dependencies.map(d))
1207
+ ```
1208
+
1209
+ where hash is a cryptographic hash function. In other words, the digest of a
1210
+ resource is computed from its type, its own properties (that is, excluding
1211
+ properties that refer to other resources), and the digests of each of its
1212
+ dependencies. The digest of a resource, defined recursively this way, remains
1213
+ stable even if one or more of its dependencies gets renamed. Since the
1214
+ resources in a CloudFormation template form a directed acyclic graph, this
1215
+ function is well-defined.
1216
+
1217
+ Resources that have the same digest, but different locations, are considered to be
1218
+ the same resource, and therefore to have been moved or renamed.
1197
1219
 
1198
1220
  #### Limitations
1199
1221
  - A refactor cannot leave a stack empty. This is a CloudFormation API limitation,