这是 AWS CDK v2 开发者指南。旧版 CDK v1 于 2022 年 6 月 1 日进入维护阶段,并于 2023 年 6 月 1 日终止支持。
本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
显示您 CDK 应用程序的通知。
通知可能包括有关安全漏洞、回归和使用不支持版本的重要消息。
无论相关通知是否已确认,此命令都会显示这些通知。默认情况下,每个命令之后也可能出现相关通知。
您可以使用以下方式隐藏通知:
-
通过命令选项。以下是示例:
$
cdk deploy --no-notices
-
通过项目
cdk.json
文件中的上下文无限期地隐藏所有通知:{ "notices": false, "context": { // ... } }
-
使用
cdk acknowledge
命令确认每条通知。
使用量
$
cdk notices
<options>
选项
查看适用于所有 CDK 的全局选项列表 CLI 命令,请参阅全局选项。
--help, -h
BOOLEAN
-
显示
cdk notices
命令的命令参考信息。
示例
运行 cdk deploy 命令后显示的默认通知示例
$
cdk deploy
... # Normal output of the command NOTICES 16603 Toggling off auto_delete_objects for Bucket empties the bucket 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. Affected versions: <1.126.0. More information at: https://github.com/aws/aws-cdk/issues/16603 17061 Error when building EKS cluster with monocdk import Overview: When using monocdk/aws-eks to build a stack containing an EKS cluster, error is thrown about missing lambda-layer-node-proxy-agent/layer/package.json. Affected versions: >=1.126.0 <=1.130.0. More information at: https://github.com/aws/aws-cdk/issues/17061 If you don’t want to see an notice anymore, use "cdk acknowledge ID". For example, "cdk acknowledge 16603"
运行 cdk notices 命令的简单示例
$
cdk notices
NOTICES 16603 Toggling off auto_delete_objects for Bucket empties the bucket 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. Affected versions: framework: <=2.15.0 >=2.10.0 More information at: https://github.com/aws/aws-cdk/issues/16603 If you don’t want to see a notice anymore, use "cdk acknowledge <id>". For example, "cdk acknowledge 16603"