

這是 AWS CDK v2 開發人員指南。較舊的 CDK v1 已於 2022 年 6 月 1 日進入維護，並於 2023 年 6 月 1 日結束支援。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# `cdk notices`
<a name="ref-cli-cmd-notices"></a>

顯示 CDK 應用程式的通知。

通知可以包含有關安全漏洞、迴歸和不受支援版本使用的重要訊息。

此命令會顯示相關通知，無論它們是否已獲得確認。根據預設，相關通知也可能出現在每個命令之後。

您可以透過下列方式隱藏通知：
+ 透過命令選項。以下是範例：

  ```
  $ cdk deploy --no-notices
  ```
+ 透過專案`cdk.json`檔案中的內容無限期隱藏所有通知：

  ```
  {
    "notices": false,
    "context": {
      // ...
    }
  }
  ```
+ 使用 `cdk acknowledge`命令確認每個通知。

## 用量
<a name="ref-cli-cmd-notices-usage"></a>

```
$ cdk notices <options>
```

## 選項
<a name="ref-cli-cmd-notices-options"></a>

如需適用於所有 CDK CLI 命令的全域選項清單，請參閱[全域選項](ref-cli-cmd.md#ref-cli-cmd-options)。<a name="ref-cli-cmd-notices-options-help"></a>

 `--help, -h <BOOLEAN>`   
顯示命令的`cdk notices`命令參考資訊。

## 範例
<a name="ref-cli-cmd-notices-examples"></a>

### 執行 cdk 部署命令後顯示的預設通知範例
<a name="ref-cli-cmd-notices-examples-1"></a>

```
$ 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 通知命令的簡單範例
<a name="ref-cli-cmd-notices-examples-2"></a>

```
$ 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"
```