

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

# 從帳戶移除第三方私有擴充功能
<a name="registry-private-deregister-extension"></a>

要移除第三方私有擴充功能或擴充功能版本，請使用 [https://docs.aws.amazon.com/cli/latest/reference/cloudformation/deregister-type.html](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/deregister-type.html) 命令。

您可取消註冊特定的擴充功能版本，或整個擴充功能。要取消註冊擴充功能，必須分別取消註冊該擴充功能的全部已註冊版本。若某個擴充功能僅有一個已註冊版本，取消註冊該版本會導致取消註冊擴充功能本身。您無法取消註冊擴充功能的預設版本，除非是該擴充功能的唯一已註冊版本，這種情況下擴充功能本身也會被取消註冊。

**警告**  
私人擴充功能的取消註冊操作無法撤銷。此動作將會：  
使該擴充功能在所有 CloudFormation 操作中無法使用。
導致未來使用此擴充功能的堆疊更新失敗 (適用於模組和資源類型)。儘管您稍後可以重新私下註冊該擴充功能，但如果 CloudFormation 依賴舊版本，可能會導致失敗。
繼續之前，使用 [list-stacks](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/list-stacks.html) 與 [get-template](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/get-template.html) 命令，驗證是否沒有作用中的堆疊使用此擴充功能。

## 取消註冊擴充功能命令的範例
<a name="registry-deregister-type-commands"></a>

本節提供範例，說明取消註冊私有擴充功能的不同方式。

**依據類型名稱取消註冊**  
搭配 `--type` 和 `--type-name` 選項使用 [https://docs.aws.amazon.com/cli/latest/reference/cloudformation/deregister-type.html](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/deregister-type.html) 命令，即可取消註冊您的擴充功能。

```
aws cloudformation deregister-type \
  --type MODULE \
  --type-name My::S3::SampleBucket::MODULE
```

**依據類型名稱和版本取消註冊**  
要取消註冊特定版本的擴充功能，請在命令中指定 `--version-id` 選項。

```
aws cloudformation deregister-type \
  --type MODULE \
  --type-name My::S3::SampleBucket::MODULE \
  --version-id 00000001
```

**提示**  
要先將不同版本的擴充功能設定為預設版本，使用 [set-type-default-version](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/set-type-default-version.html) 命令。

**依據 ARN 取消註冊**  
搭配 `--arn` 選項並指定您擴充功能的 ARN，即可取消註冊該擴充功能。

```
aws cloudformation deregister-type \
  --arn arn:aws:cloudformation:us-west-2:123456789012:type/resource/Organization-Service-Resource
```