You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds information about the `cdk flags` command to the README.
---
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache-2.0 license
Copy file name to clipboardExpand all lines: packages/aws-cdk/README.md
+143Lines changed: 143 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1238,6 +1238,149 @@ that can be set in many different ways (such as `~/.cdk.json`).
1238
1238
$ # Check the current status of telemetry
1239
1239
$ cdk cli-telemetry --status
1240
1240
```
1241
+
### `cdk flags`
1242
+
1243
+
View and modify your feature flag configurations.
1244
+
1245
+
Run `cdk flags` to see a report of your feature flag configurations that differ from our recommended states. Unconfigured flags will be labelled with `<unset>` to show that flag currently has no value. The flags are displayed to you in the following order:
1246
+
1247
+
1. flags whose states do not match our recommended values
1248
+
2. flags that are not configured at all
1249
+
1250
+
```shell
1251
+
$ cdk flags --unstable=flags
1252
+
Feature Flag Recommended User
1253
+
* @aws-cdk/... truefalse
1254
+
* @aws-cdk/... truefalse
1255
+
* @aws-cdk/... true<unset>
1256
+
```
1257
+
1258
+
Alternatively, you can also run `cdk flags --all` to see a report of all feature flags in the following order:
1259
+
1260
+
1. flags whose states match our recommended values
1261
+
2. flags whose states do not match our recommended values
1262
+
3. flags that are not configured at all
1263
+
1264
+
```shell
1265
+
$ cdk flags --unstable=flags --all
1266
+
Feature Flag Recommended User
1267
+
@aws-cdk/... truetrue
1268
+
* @aws-cdk/... truefalse
1269
+
* @aws-cdk/... truefalse
1270
+
* @aws-cdk/... true<unset>
1271
+
```
1272
+
1273
+
### Modifying your feature flag values
1274
+
1275
+
To modify your feature flags interactively, you can run `cdk flags --interactive` (or `cdk flags -i`) to view a list of menu options.
1276
+
1277
+
To change every single feature flag to our recommended value and potentially overwrite existing configured values, run `cdk flags --set --recommended --all`. To keep feature flag configuration up-to-date with the latest CDK feature flag configurations, use this command.
If you would prefer your existing configured flags untouched, this option only changes the unconfigured feature flags to our recommended values, run `cdk flags --set --recommended --unconfigured`. This only changes the unconfigured feature flags to our recommended values.
If you want to ensure the unconfigured flags do not interfere with your application, `cdk flags --set --default --unconfigured` changes the unconfigured feature flags to its default values. For example, if `@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021` is unconfigured, it leads to the notification appearing after running `cdk synth`. However, if you set the flag to its default state (false), it will be configured, turned off, and have no impact on your application whatsoever.
Besides running `cdk flags` and `cdk flags --all` to view your feature flag configuration, you can also utilize `cdk flags "#FLAGNAME#"` to inspect a specific feature flag and find out what a specific flag does. This can be helpful in cases where you want to understand a particular flag and its impact on your application.
Description: Enable this feature flag to have cloudfront distributions use the security policy TLSv1.2_2021 by default.
1339
+
Recommended Value: true
1340
+
User Value: true
1341
+
```
1342
+
1343
+
#### Filter flags by substring
1344
+
1345
+
You can also run `cdk flags #substring#` to view all matching feature flags. If there is only one feature flag that matches that substring, specific details will be displayed.
1346
+
1347
+
```shell
1348
+
$ cdk flags --unstable=flags ebs
1349
+
@aws-cdk/aws-ec2:ebsDefaultGp3Volume
1350
+
Description: When enabled, the default volume type of the EBS volume will be GP3
1351
+
Recommended Value: true
1352
+
User Value: true
1353
+
```
1354
+
1355
+
If there are multiple flags matching the substring, a table with all matching flags will be displayed. If you enter multiple substrings, all matching flags
1356
+
that contain any of those substrings will be returned.
1357
+
1358
+
```shell
1359
+
$ cdk flags --unstable=flags s3 lambda
1360
+
Feature Flag Recommended User
1361
+
* @aws-cdk/s3... truefalse
1362
+
* @aws-cdk/lambda... truefalse
1363
+
* @aws-cdk/lambda... true<unset>
1364
+
```
1365
+
1366
+
#### Modify a particular flag
1367
+
1368
+
If you need to modify the value of this flag and want to make sure you’re setting it to a correct and supported state, run `cdk flags --set "#FLAGNAME#" --value="#state#"`.
0 commit comments