# @aws-lite/cloudformation 中文文档

规范地址：https://npmcn.com/package/%40aws-lite/cloudformation/

版本：0\.1\.3
npm 元数据更新时间：2026-03-06T19:09:53.617Z
中文译文更新时间：2026-11-07T15:27:18.785Z
软件包许可：Apache-2\.0

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40aws-lite/cloudformation
原文对照：https://npmcn.com/package/%40aws-lite/cloudformation/?lang=original
项目主页：https://aws-lite.org/services/cloudformation
源码仓库：https://github.com/aws-lite/aws-lite

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：34 kB，5 个文件
- 模块格式：ES Module
- TypeScript 类型：未声明
- Node.js 要求：\>=16
- 运行依赖：0 个
- 首次发布：2023-12-24T04:58:09.824Z
- 最新版本发布：2024-08-01T16:04:25.782Z
- 近 30 天下载量：8508（2026-10-08 至 2026-11-06，npm 官方下载统计）
- 已发布版本数：10（近 12 个月 0 个）

## 中文简介

公务 `aws-lite` 云阵插件

## 安装

```sh
npm install @aws-lite/cloudformation
```

也可以使用：`pnpm add @aws-lite/cloudformation`、`yarn add @aws-lite/cloudformation`、`bun add @aws-lite/cloudformation`

## README

# `@aws-lite/cloudformation`

> 公务 `aws-lite` 云阵插件

> 由下列人员维护: [@ architect](https://github.com/architect)

## 安装

```sh
npm i @aws-lite/cloudformation
```

可选安装类型 :

```sh
npm i -D @aws-lite/cloudformation-types
```

## 参考文献

[在aws-lite.org提供实例参考文件](https://aws-lite.org/services/cloudformation)

## 参考文献

[在aws-lite.org提供实例参考文件](https://aws-lite.org/services/cloudformation)

## 方法

### `CreateStack`

[Canonical AWS API API 文档](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStack.html)

属性 :

-   **`StackName` (弦) \[须\]**
    -   堆栈名称或ID
-   **`Capabilities` (阵列)**
    -   堆栈创建所需的 CloudFormation 能力组合;可以是: `CAPABILITY_IAM`, (中文(简体) ), `CAPABILITY_NAMED_IAM`, (中文(简体) ), `CAPABILITY_AUTO_EXPAND`
-   **`ClientRequestToken` (弦声)**
    -   此请求的独特标识符; 从 1 - 128 b 匹配 `[a-zA-Z0-9][-a-zA-Z0-9]*`
-   **`DisableRollback` (布尔)**
    -   如果堆栈创建失败, 设置为真以禁用堆栈回滚
-   **`EnableTerminationProtection` (布尔)**
    -   启用针对堆栈删除的保护
    -   [更详细情况( AWS)](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-protect-stacks.html)
-   **`NotificationARNs` (阵列)**
    -   SNS主题 ARNs 矩阵以发布堆栈相关活动
-   **`OnFailure` (弦声)**
    -   堆栈创建失败时要采取的行动;可以是: `DO_NOTHING`, (中文(简体) ), `ROLLBACK`, (中文(简体) ), `DELETE`
-   **`Parameters` (阵列)**
    -   指定堆栈输入参数的对象阵列
    -   [更详细情况( AWS)](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html)
-   **`ResourceTypes` (阵列)**
    -   包含此创建堆栈动作权限的 CloudFormation 模板资源类型的组合
    -   [更详细情况( AWS)](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html)
-   **`RetainExceptOnCreate` (布尔)**
    -   设定为真以确保在操作回滚时将新创建的资源删除, 即使带有删除策略 `Retain`
-   **`RoleARN` (弦声)**
    -   IAM 角色 ARN Cloud Formation 假设创建堆栈
-   **`RollbackConfiguration` (标 题)**
    -   在创建和更新过程中监测的回滚触发器
    -   [更详细情况( AWS)](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_RollbackConfiguration.html)
-   **`StackPolicyBody` (字符串,对象)**
    -   堆栈策略文档; 对象将被自动序列化为 JSON, 或提供预序列化的 JSON
    -   [更详细情况( AWS)](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html)
-   **`StackPolicyURL` (弦声)**
    -   堆栈策略 URL
-   **`Tags` (阵列)**
    -   与堆栈关联的标签对象阵列
    -   [更详细情况( AWS)](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Tag.html)
-   **`TemplateBody` (字符串,对象)**
    -   CloudFormation模板对象(会自动为您序列化为JSON),或预序列化的JSON或YAML;最多可达51,200 b
-   **`TemplateURL` (弦声)**
    -   S3 Cloud Formation 模板的位置;最多可达 460 800 b
-   **`TimeoutInMinutes` (数目)**
    -   堆栈状态成为前的时间量 `CREATE_FAILED`

### `DeleteStack`

[Canonical AWS API API 文档](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DeleteStack.html)

属性 :

-   **`StackName` (弦) \[须\]**
    -   堆栈名称或ID
-   **`ClientRequestToken` (弦声)**
    -   此请求的独特标识符; 从 1 - 128 b 匹配 `[a-zA-Z0-9][-a-zA-Z0-9]*`
-   **`RetainResources` (阵列)**
    -   删除堆栈后要保留的逻辑资源ID列表
-   **`RoleARN` (弦声)**
    -   删除时要承担的 IAM 角色 ARN

### `DescribeStackResources`

[Canonical AWS API API 文档](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeStackResources.html)

属性 :

-   **`StackName` (弦声)**
    -   堆栈名称或ID
-   **`LogicalResourceId` (弦声)**
    -   资源的逻辑名称
-   **`PhysicalResourceId` (弦声)**
    -   资源的实际名称或标识; 如果您未指定 `PhysicalResourceId`,必须指定 `StackName`

### `DescribeStacks`

[Canonical AWS API API 文档](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeStacks.html)

属性 :

-   **`StackName` (弦声)**
    -   堆栈名称或ID
-   **`NextToken` (弦声)**
    -   如果 `NextToken` 先前的答复中退回
-   **`paginate` (布尔,字符串)**
    -   启用自动结果 pagination; 使用此选项, 而不是自制个人 pagination 请求

### `ListStackResources`

[Canonical AWS API API 文档](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListStackResources.html)

属性 :

-   **`StackName` (弦) \[须\]**
    -   堆栈名称或ID
-   **`NextToken` (弦声)**
    -   如果 `NextToken` 先前的答复中退回
-   **`paginate` (布尔,字符串)**
    -   启用自动结果 pagination; 使用此选项, 而不是自制个人 pagination 请求

### `UpdateStack`

[Canonical AWS API API 文档](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStack.html)

属性 :

-   **`StackName` (弦) \[须\]**
    -   堆栈名称或ID
-   **`Capabilities` (阵列)**
    -   堆栈创建所需的 CloudFormation 能力组合;可以是: `CAPABILITY_IAM`, (中文(简体) ), `CAPABILITY_NAMED_IAM`, (中文(简体) ), `CAPABILITY_AUTO_EXPAND`
-   **`ClientRequestToken` (弦声)**
    -   此请求的独特标识符; 从 1 - 128 b 匹配 `[a-zA-Z0-9][-a-zA-Z0-9]*`
-   **`DisableRollback` (布尔)**
    -   如果堆栈创建失败, 设置为真以禁用堆栈回滚
-   **`NotificationARNs` (阵列)**
    -   SNS主题 ARNs 矩阵以发布堆栈相关活动
-   **`Parameters` (阵列)**
    -   指定堆栈输入参数的对象阵列
    -   [更详细情况( AWS)](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html)
-   **`ResourceTypes` (阵列)**
    -   包含此创建堆栈动作权限的 CloudFormation 模板资源类型的组合
    -   [更详细情况( AWS)](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html)
-   **`RetainExceptOnCreate` (布尔)**
    -   设定为真以确保在操作回滚时将新创建的资源删除, 即使带有删除策略 `Retain`
-   **`RoleARN` (弦声)**
    -   IAM 角色 ARN Cloud Formation 假设创建堆栈
-   **`RollbackConfiguration` (标 题)**
    -   在创建和更新过程中监测的回滚触发器
    -   [更详细情况( AWS)](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_RollbackConfiguration.html)
-   **`StackPolicyBody` (字符串,对象)**
    -   堆栈策略文档; 对象将被自动序列化为 JSON, 或提供预序列化的 JSON
    -   [更详细情况( AWS)](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html)
-   **`StackPolicyURL` (弦声)**
    -   堆栈策略 URL
-   **`Tags` (阵列)**
    -   与堆栈关联的标签对象阵列
    -   [更详细情况( AWS)](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Tag.html)
-   **`TemplateBody` (字符串,对象)**
    -   CloudFormation模板对象(会自动为您序列化为JSON),或预序列化的JSON或YAML;最多可达51,200 b
-   **`TemplateURL` (弦声)**
    -   S3 Cloud Formation 模板的位置;最多可达 460 800 b

### `UpdateTerminationProtection`

[Canonical AWS API API 文档](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateTerminationProtection.html)

属性 :

-   **`StackName` (弦) \[须\]**
    -   堆栈名称或ID
-   **`EnableTerminationProtection` \[需要\]**
    -   在指定的堆栈上启用终止保护

### 有待执行的方法

> 请帮忙 [打开 PR](https://github.com/aws-lite/aws-lite#authoring-aws-lite-plugins)来啊!

-   [`ActivateOrganizationsAccess`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ActivateOrganizationsAccess.html)
-   [`ActivateType`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ActivateType.html)
-   [`BatchDescribeTypeConfigurations`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_BatchDescribeTypeConfigurations.html)
-   [`CancelUpdateStack`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CancelUpdateStack.html)
-   [`ContinueUpdateRollback`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ContinueUpdateRollback.html)
-   [`CreateChangeSet`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateChangeSet.html)
-   [`CreateStackInstances`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStackInstances.html)
-   [`CreateStackSet`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStackSet.html)
-   [`DeactivateOrganizationsAccess`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DeactivateOrganizationsAccess.html)
-   [`DeactivateType`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DeactivateType.html)
-   [`DeleteChangeSet`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DeleteChangeSet.html)
-   [`DeleteStackInstances`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DeleteStackInstances.html)
-   [`DeleteStackSet`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DeleteStackSet.html)
-   [`DeregisterType`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DeregisterType.html)
-   [`DescribeAccountLimits`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeAccountLimits.html)
-   [`DescribeChangeSet`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeChangeSet.html)
-   [`DescribeChangeSetHooks`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeChangeSetHooks.html)
-   [`DescribeOrganizationsAccess`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeOrganizationsAccess.html)
-   [`DescribePublisher`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribePublisher.html)
-   [`DescribeStackDriftDetectionStatus`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeStackDriftDetectionStatus.html)
-   [`DescribeStackEvents`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeStackEvents.html)
-   [`DescribeStackInstance`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeStackInstance.html)
-   [`DescribeStackResource`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeStackResource.html)
-   [`DescribeStackResourceDrifts`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeStackResourceDrifts.html)
-   [`DescribeStackSet`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeStackSet.html)
-   [`DescribeStackSetOperation`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeStackSetOperation.html)
-   [`DescribeType`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeType.html)
-   [`DescribeTypeRegistration`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeTypeRegistration.html)
-   [`DetectStackDrift`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DetectStackDrift.html)
-   [`DetectStackResourceDrift`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DetectStackResourceDrift.html)
-   [`DetectStackSetDrift`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DetectStackSetDrift.html)
-   [`EstimateTemplateCost`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_EstimateTemplateCost.html)
-   [`ExecuteChangeSet`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ExecuteChangeSet.html)
-   [`GetStackPolicy`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_GetStackPolicy.html)
-   [`GetTemplate`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_GetTemplate.html)
-   [`GetTemplateSummary`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_GetTemplateSummary.html)
-   [`ImportStacksToStackSet`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ImportStacksToStackSet.html)
-   [`ListChangeSets`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListChangeSets.html)
-   [`ListExports`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListExports.html)
-   [`ListImports`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListImports.html)
-   [`ListStackInstanceResourceDrifts`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListStackInstanceResourceDrifts.html)
-   [`ListStackInstances`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListStackInstances.html)
-   [`ListStacks`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListStacks.html)
-   [`ListStackSetOperationResults`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListStackSetOperationResults.html)
-   [`ListStackSetOperations`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListStackSetOperations.html)
-   [`ListStackSets`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListStackSets.html)
-   [`ListTypeRegistrations`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListTypeRegistrations.html)
-   [`ListTypes`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListTypes.html)
-   [`ListTypeVersions`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListTypeVersions.html)
-   [`PublishType`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_PublishType.html)
-   [`RecordHandlerProgress`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_RecordHandlerProgress.html)
-   [`RegisterPublisher`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_RegisterPublisher.html)
-   [`RegisterType`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_RegisterType.html)
-   [`RollbackStack`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_RollbackStack.html)
-   [`SetStackPolicy`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_SetStackPolicy.html)
-   [`SetTypeConfiguration`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_SetTypeConfiguration.html)
-   [`SetTypeDefaultVersion`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_SetTypeDefaultVersion.html)
-   [`SignalResource`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_SignalResource.html)
-   [`StopStackSetOperation`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_StopStackSetOperation.html)
-   [`TestType`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_TestType.html)
-   [`UpdateStackInstances`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackInstances.html)
-   [`UpdateStackSet`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html)
-   [`ValidateTemplate`](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ValidateTemplate.html)

## 学多点

-   [更多关于 `aws-lite` 插件 API](https://aws-lite.org/plugin-api)
-   [学着如何促进这个和其他 `aws-lite` 插件](https://aws-lite.org/contributing)

## 常见问题

### @aws-lite/cloudformation 是什么？

公务 aws-lite 云阵插件

### 如何安装 @aws-lite/cloudformation？

在项目目录运行 npm install @aws-lite/cloudformation，或使用 pnpm add / yarn add / bun add。

### @aws-lite/cloudformation 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/aws-lite\_\_cloudformation 是否存在。

### @aws-lite/cloudformation 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @aws-lite/cloudformation 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=16。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @aws-lite/cloudformation 可以商用吗？

@aws-lite/cloudformation 使用 Apache-2\.0 许可。宽松许可：允许商业使用、修改和再分发，并附带明确的专利授权；分发时需保留许可与 NOTICE 文件，修改过的文件要注明改动。以上为概括，不构成法律意见，请以许可原文为准。

### @aws-lite/cloudformation 的下载量有多少？

根据 npm 官方下载统计，@aws-lite/cloudformation 在 2026/10/08 – 2026/11/06 这 30 天内被下载 8,508 次，日均约 284 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @aws-lite/cloudformation 还在维护吗？

最新版本 0\.1\.3 发布于 2024/08/02（2 年前）；至今共发布 10 个版本，其中过去 12 个月发布了 0 个；首次发布于 2023/12/24。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

