

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 更新自定义 Hook
<a name="updating-registered-hook"></a>

更新自定义 Hook 允许在 CloudFormation注册表中提供 Hook 中的修订版本。

要更新自定义 Hook，请通过 CloudFormation CLI [https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-cli-submit.html](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-cli-submit.html)操作将您的修订提交到 CloudFormation 注册表。

```
$ cfn submit
```

要在您的账户中指定挂钩的默认版本，请使用[https://docs.aws.amazon.com/cli/latest/reference/cloudformation/set-type-default-version.html](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/set-type-default-version.html)命令并指定类型、类型名称和版本 ID。

```
$ aws cloudformation set-type-default-version \
    --type HOOK \
    --type-name {{MyCompany::Testing::MyTestHook}} \
    --version-id {{00000003}}
```

要检索有关 Hook 版本的信息，请使用[https://docs.aws.amazon.com/cli/latest/reference/cloudformation/list-type-versions.html](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/list-type-versions.html)。

```
$ aws cloudformation list-type-versions \
  --type HOOK \
  --type-name "{{MyCompany::Testing::MyTestHook}}"
```