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
Features
- [x] notices show up on every `cdk` command
- [x] `cdk acknowledge` will acknowledge an issue by id, scoped to individual cdk apps
- [x] `cdk notices` _always_ returns relevant notices
- [x] context flag `'notices' = false` will hide notices always
- [x] notices are filtered by cli version
- [x] notices are filtered by v2 framework version
- [x] notices are filtered by v1 framework version
- [x] `--no-notices` option
- [ ] think about versioning for v2 alpha modules -- this will be left for a separate PR
- [ ] `--fail-on-notices` option -- this will be left for a separate PR
Example:
<img width="964" alt="Screenshot 2022-02-21 at 20 22 24" src="https://user-images.githubusercontent.com/288203/155021996-e4f72dec-5f1d-4940-85fb-0abdd3939c8b.png">
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
[`cdk docs`](#cdk-docs) | Access the online documentation
17
+
[`cdk init`](#cdk-init) | Start a new CDK project (app or library)
18
+
[`cdk list`](#cdk-list) | List stacks in an application
19
+
[`cdk synth`](#cdk-synthesize) | Synthesize a CDK app to CloudFormation template(s)
20
+
[`cdk diff`](#cdk-diff) | Diff stacks against current state
21
+
[`cdk deploy`](#cdk-deploy) | Deploy a stack into an AWS account
22
+
[`cdk watch`](#cdk-watch) | Watches a CDK app for deployable and hotswappable changes
23
+
[`cdk destroy`](#cdk-destroy) | Deletes a stack from an AWS account
24
+
[`cdk bootstrap`](#cdk-bootstrap) | Deploy a toolkit stack to support deploying large stacks & artifacts
25
+
[`cdk doctor`](#cdk-doctor) | Inspect the environment and produce information useful for troubleshooting
26
+
[`cdk acknowledge`](#cdk-acknowledge) | Acknowledge (and hide) a notice by issue number
27
+
[`cdk notices`](#cdk-notices) | List all relevant notices for the application
26
28
27
29
This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.
28
30
@@ -503,6 +505,97 @@ $ cdk doctor
503
505
- AWS_SDK_LOAD_CONFIG = 1
504
506
```
505
507
508
+
## Notices
509
+
510
+
> This feature exists on CDK CLI version 2.14.0 and up.
511
+
512
+
CDK Notices are important messages regarding security vulnerabilities, regressions, and usage of unsupported
513
+
versions. Relevant notices appear on every command by default. For example,
514
+
515
+
```console
516
+
$ cdk deploy
517
+
518
+
... # Normal output of the command
519
+
520
+
NOTICES
521
+
522
+
16603 Toggling off auto_delete_objects for Bucket empties the bucket
523
+
524
+
Overview: If a stack is deployed with an S3 bucket with
525
+
auto_delete_objects=True, and then re-deployed with
526
+
auto_delete_objects=False, all the objects in the bucket
527
+
will be deleted.
528
+
529
+
Affected versions: <1.126.0.
530
+
531
+
More information at: https://github.com/aws/aws-cdk/issues/16603
532
+
533
+
17061 Error when building EKS cluster with monocdk import
534
+
535
+
Overview: When using monocdk/aws-eks to build a stack containing
536
+
an EKS cluster, error is thrown about missing
537
+
lambda-layer-node-proxy-agent/layer/package.json.
538
+
539
+
Affected versions: >=1.126.0 <=1.130.0.
540
+
541
+
More information at: https://github.com/aws/aws-cdk/issues/17061
542
+
543
+
If you don’t want to see an notice anymore, use "cdk acknowledge ID". For example, "cdk acknowledge 16603".
544
+
```
545
+
546
+
You can suppress warnings in a variety of ways:
547
+
548
+
- per individual execution:
549
+
550
+
`cdk deploy --no-notices`
551
+
552
+
- disable all notices indefinitely through context in `cdk.json`:
553
+
554
+
```json
555
+
{
556
+
"context": {
557
+
"notices": false
558
+
}
559
+
}
560
+
```
561
+
562
+
- acknowleding individual notices via `cdk acknowledge` (see below).
563
+
564
+
### `cdk acknowledge`
565
+
566
+
To hide a particular notice that has been addressed or does not apply, call `cdk acknowledge` with the ID of
567
+
the notice:
568
+
569
+
```console
570
+
$cdk acknowledge 16603
571
+
```
572
+
573
+
> Please note that the acknowledgements are made project by project. If you acknowledge an notice in one CDK
574
+
> project, it will still appear on other projects when you run any CDK commands, unless you have suppressed
575
+
> or disabled notices.
576
+
577
+
578
+
### `cdk notices`
579
+
580
+
List the notices that are relevant to the current CDK repository, regardless of context flags or notices that
581
+
have been acknowledged:
582
+
583
+
```console
584
+
$ cdk notices
585
+
586
+
NOTICES
587
+
588
+
16603 Toggling off auto_delete_objects for Bucket empties the bucket
589
+
590
+
Overview: if a stack is deployed with an S3 bucket with auto_delete_objects=True, and then re-deployed with auto_delete_objects=False, all the objects in the bucket will be deleted.
591
+
592
+
Affected versions: framework: <=2.15.0 >=2.10.0
593
+
594
+
More information at: https://github.com/aws/aws-cdk/issues/16603
595
+
596
+
If you don’t want to see a notice anymore, use "cdk acknowledge <id>". For example, "cdk acknowledge 16603".
597
+
```
598
+
506
599
### Bundling
507
600
508
601
By default asset bundling is skipped for `cdk list` and `cdk destroy`. For `cdk deploy`, `cdk diff`
@@ -71,6 +71,7 @@ async function parseCommandLineArguments() {
71
71
.option('role-arn',{type: 'string',alias: 'r',desc: 'ARN of Role to use when invoking CloudFormation',default: undefined,requiresArg: true})
72
72
.option('staging',{type: 'boolean',desc: 'Copy assets to the output directory (use --no-staging to disable, needed for local debugging the source files with SAM CLI)',default: true})
73
73
.option('output',{type: 'string',alias: 'o',desc: 'Emits the synthesized cloud assembly into a directory (default: cdk.out)',requiresArg: true})
.option('no-color',{type: 'boolean',desc: 'Removes colors and other style from console output',default: false})
75
76
.command(['list [STACKS..]','ls [STACKS..]'],'Lists all stacks in the app',yargs=>yargs
76
77
.option('long',{type: 'boolean',default: false,alias: 'l',desc: 'Display environment information for each stack'}),
@@ -193,6 +194,8 @@ async function parseCommandLineArguments() {
193
194
.option('security-only',{type: 'boolean',desc: 'Only diff for broadened security changes',default: false})
194
195
.option('fail',{type: 'boolean',desc: 'Fail with exit code 1 in case of diff',default: false}))
195
196
.command('metadata [STACK]','Returns all metadata associated with this stack')
197
+
.command(['acknowledge [ID]','ack [ID]'],'Acknowledge a notice so that it does not show up anymore')
198
+
.command('notices','Returns a list of relevant notices')
196
199
.command('init [TEMPLATE]','Create a new, empty CDK project from a template.',yargs=>yargs
197
200
.option('language',{type: 'string',alias: 'l',desc: 'The language to be used for the new project (default can be configured in ~/.cdk.json)',choices: initTemplateLanguages})
198
201
.option('list',{type: 'boolean',desc: 'List the available templates'})
@@ -227,6 +230,10 @@ if (!process.stdout.isTTY) {
227
230
}
228
231
229
232
asyncfunctioninitCommandLine(){
233
+
voidrefreshNotices()
234
+
.then(_=>debug('Notices refreshed'))
235
+
.catch(e=>debug(`Notices refresh failed: ${e}`));
236
+
230
237
constargv=awaitparseCommandLineArguments();
231
238
if(argv.verbose){
232
239
setLogLevel(argv.verbose);
@@ -295,37 +302,32 @@ async function initCommandLine() {
0 commit comments