aws-cdk 2.1020.2 → 2.1021.0

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.
Files changed (71) hide show
  1. package/README.md +40 -35
  2. package/THIRD_PARTY_LICENSES +65 -65
  3. package/build-info.json +2 -2
  4. package/db.json.gz +0 -0
  5. package/lib/api/refactor.d.ts +1 -0
  6. package/lib/api/refactor.js +8 -0
  7. package/lib/cli/cdk-toolkit.d.ts +18 -21
  8. package/lib/cli/cdk-toolkit.js +121 -140
  9. package/lib/cli/cli-config.js +12 -12
  10. package/lib/cli/cli-type-registry.json +15 -11
  11. package/lib/cli/cli.js +38 -17
  12. package/lib/cli/convert-to-user-input.js +12 -6
  13. package/lib/cli/display-version.d.ts +11 -0
  14. package/lib/cli/display-version.js +101 -0
  15. package/lib/cli/io-host/cli-io-host.d.ts +1 -6
  16. package/lib/cli/io-host/cli-io-host.js +1 -16
  17. package/lib/cli/parse-command-line-arguments.js +16 -10
  18. package/lib/cli/platform-warnings.d.ts +2 -1
  19. package/lib/cli/platform-warnings.js +3 -4
  20. package/lib/cli/telemetry/endpoint-sink.d.ts +1 -2
  21. package/lib/cli/telemetry/endpoint-sink.js +4 -3
  22. package/lib/cli/telemetry/file-sink.js +8 -12
  23. package/lib/cli/user-configuration.d.ts +14 -4
  24. package/lib/cli/user-configuration.js +42 -30
  25. package/lib/cli/user-input.d.ts +18 -12
  26. package/lib/cli/user-input.js +1 -1
  27. package/lib/cli/util/yargs-helpers.js +3 -3
  28. package/lib/cli/version.d.ts +2 -12
  29. package/lib/cli/version.js +5 -102
  30. package/lib/commands/context.d.ts +10 -5
  31. package/lib/commands/context.js +35 -35
  32. package/lib/commands/docs.d.ts +6 -1
  33. package/lib/commands/docs.js +20 -19
  34. package/lib/commands/doctor.d.ts +4 -1
  35. package/lib/commands/doctor.js +17 -17
  36. package/lib/commands/flags.d.ts +3 -0
  37. package/lib/commands/flags.js +43 -0
  38. package/lib/commands/init/init-hooks.d.ts +2 -1
  39. package/lib/commands/init/init-hooks.js +6 -6
  40. package/lib/commands/init/init.d.ts +4 -2
  41. package/lib/commands/init/init.js +56 -54
  42. package/lib/commands/init/os.d.ts +2 -1
  43. package/lib/commands/init/os.js +3 -4
  44. package/lib/commands/list-stacks.js +8 -2
  45. package/lib/commands/migrate.d.ts +6 -17
  46. package/lib/commands/migrate.js +28 -29
  47. package/lib/cxapp/cloud-assembly.js +1 -1
  48. package/lib/index.d.ts +1 -1
  49. package/lib/index.js +44594 -30673
  50. package/lib/index_bg.wasm +0 -0
  51. package/lib/init-templates/.init-version.json +1 -1
  52. package/lib/init-templates/.recommended-feature-flags.json +1 -0
  53. package/lib/{legacy-aws-auth.d.ts → legacy/aws-auth.d.ts} +1 -1
  54. package/lib/legacy/aws-auth.js +47 -0
  55. package/lib/legacy/configuration.d.ts +82 -0
  56. package/lib/legacy/configuration.js +321 -0
  57. package/lib/legacy/index.d.ts +19 -0
  58. package/lib/{legacy-exports-source.js → legacy/index.js} +23 -23
  59. package/lib/{legacy-logging-source.d.ts → legacy/logging.d.ts} +50 -0
  60. package/lib/legacy/logging.js +154 -0
  61. package/lib/legacy/types.js +3 -0
  62. package/lib/legacy-exports.d.ts +4 -3
  63. package/lib/legacy-exports.js +4 -1
  64. package/package.json +12 -12
  65. package/lib/legacy-aws-auth.js +0 -47
  66. package/lib/legacy-exports-source.d.ts +0 -18
  67. package/lib/legacy-logging-source.js +0 -107
  68. package/lib/legacy-types.js +0 -3
  69. package/lib/logging.d.ts +0 -99
  70. package/lib/logging.js +0 -146
  71. /package/lib/{legacy-types.d.ts → legacy/types.d.ts} +0 -0
package/README.md CHANGED
@@ -1101,8 +1101,12 @@ when using this command.
1101
1101
 
1102
1102
  Compares the infrastructure specified in the current state of the CDK app with
1103
1103
  the currently deployed application, to determine if any resource was moved
1104
- (to a different stack or to a different logical ID, or both). The CLI will
1105
- show the correspondence between the old and new locations in a table:
1104
+ (to a different stack or to a different logical ID, or both). In keeping with
1105
+ the CloudFormation API, you are not allowed to modify the set of resources
1106
+ as part of a refactor. In other words, adding, deleting or updating resources
1107
+ is considered an error.
1108
+
1109
+ The CLI will show the correspondence between the old and new locations in a table:
1106
1110
 
1107
1111
  ```
1108
1112
  $ cdk refactor --unstable=refactor --dry-run
@@ -1125,41 +1129,45 @@ show this table and exit. Eventually, the CLI will also be able to automatically
1125
1129
  apply the refactor on your CloudFormation stacks. But for now, only the dry-run
1126
1130
  mode is supported.
1127
1131
 
1128
- If you want to exclude some resources from the refactor, you can pass an
1129
- exclude file, containing a list of destination locations to exclude. A
1130
- location can be either the stack name + logical ID, or the construct path. For
1131
- example, if you don't want to include the bucket and the distribution from
1132
- the table above in the refactor, you can create a file called
1133
- `exclude.txt` with the following content (destination locations separated by
1134
- newlines):
1132
+ If your application has more than one stack, and you want the `refactor`
1133
+ command to consider only a subset of them, you can pass a list of stack
1134
+ patterns as a parameter:
1135
1135
 
1136
+ ```shell
1137
+ $ cdk refactor Web* --unstable=refactor --dry-run
1136
1138
  ```
1137
- Web/Website/Origin/Resource
1138
- Web/Website/Distribution/Resource
1139
- ```
1140
1139
 
1141
- and pass it to the CLI via the `--exclude-file` flag:
1140
+ The pattern language is the same as the one used in the `cdk deploy` command.
1141
+ However, unlike `cdk deploy`, in the absence of this parameter, all stacks are
1142
+ considered.
1143
+
1144
+ The CLI's default behavior is to include in the comparison only the deployed
1145
+ stacks that have a counterpart (stack with the same name) locally. If you want
1146
+ to include additional deployed stacks in the comparison, pass their names using
1147
+ the `--additional-stack-name` option:
1142
1148
 
1143
1149
  ```shell
1144
- $ cdk refactor --exclude-file exclude.txt --unstable=refactor --dry-run
1150
+ $ cdk refactor --unstable=refactor --dry-run --additional-stack-name=Foo --additional-stack-name=Bar
1145
1151
  ```
1146
1152
 
1147
- If your application has more than one stack, and you want the refactor
1148
- command to consider only a subset of them, you can pass a list of stack
1149
- patterns as a parameter:
1153
+ In case of ambiguities, the CLI will display a table like this:
1150
1154
 
1151
- ```shell
1152
- $ cdk refactor Web* --unstable=refactor --dry-run
1155
+ ```
1156
+ Detected ambiguities:
1157
+ ┌───┬──────────────────────┐
1158
+ │ │ Resource │
1159
+ ├───┼──────────────────────┤
1160
+ │ - │ Stack2/DLQ/Resource │
1161
+ │ │ Stack2/DLQ2/Resource │
1162
+ ├───┼──────────────────────┤
1163
+ │ + │ Stack1/DLQ/Resource │
1164
+ │ │ Stack1/DLQ2/Resource │
1165
+ └───┴──────────────────────┘
1153
1166
  ```
1154
1167
 
1155
- The pattern language is the same as the one used in the `cdk deploy` command.
1156
- However, unlike `cdk deploy`, in the absence of this parameter, all stacks are
1157
- considered.
1158
-
1159
- If, instead of letting the CLI decide which resources to move, you want to
1160
- provide your own mapping of old to new locations, you can do so by passing a
1161
- mapping file to the CLI via the `--mapping-file` flag. This file should
1162
- contain a JSON object with the following format:
1168
+ You can resolve this ambiguity manually, by passing an override file via the
1169
+ `--override-file=<path>` CLI option. This file should contain a JSON object
1170
+ with the following structure:
1163
1171
 
1164
1172
  ```json
1165
1173
  {
@@ -1168,22 +1176,19 @@ contain a JSON object with the following format:
1168
1176
  "account": "123456789012",
1169
1177
  "region": "us-east-1",
1170
1178
  "resources": {
1171
- "Foo.OldName": "Bar.NewName"
1179
+ "Stack2.OldName": "Stack2.NewName"
1172
1180
  }
1173
1181
  }
1174
1182
  ]
1175
1183
  }
1176
1184
  ```
1177
1185
 
1178
- where `resources` is a mapping of resources from source to destination
1179
- locations for a given environment. Resource locations are in the format
1180
- `StackName.LogicalId`.The source must refer to a location where there is a
1181
- resource currently deployed, while the destination must refer to a location
1186
+ where `resources` is a mapping of resources from source to destination
1187
+ locations for a given environment. Resource locations are in the format
1188
+ `StackName.LogicalId`.The source must refer to a location where there is a
1189
+ resource currently deployed, while the destination must refer to a location
1182
1190
  that is not already occupied by any resource.
1183
1191
 
1184
- If you want to undo a refactor, you can use the `--revert` option in
1185
- conjunction with the `--mapping-file` option. It will apply the mapping in
1186
- reverse order (source becomes destination and vice versa).
1187
1192
 
1188
1193
  ### `cdk drift`
1189
1194