

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

# 使用着陆区域加速器自动创建账户 AWS
<a name="automate-account-creation-lza"></a>

*Justin Kuskowski、Joe Behrens 和 Nathan Scott，Amazon Web Services*

## Summary
<a name="automate-account-creation-lza-summary"></a>

此模式说明了如何在授权用户提交请求 AWS 账户 时使用 AWS解决方案[上的着陆区加速器](https://aws.amazon.com/solutions/implementations/landing-zone-accelerator-on-aws/)自动部署新的解决方案。它 AWS Step Functions 用来编排许多 AWS Lambda 功能。Lambda 函数将账户信息添加到 Git 存储库，启动 AWS CodePipeline 管道，并验证是否已配置必要的 AWS 资源。该过程完成后，用户会收到一条通知，告知已创建账户。

或者，你可以在帐户创建过程中集成 Microsoft Entra ID 组并分配 AWS IAM Identity Center 权限集。如果您的组织使用 Microsoft Entra ID 作为身份源，此可选功能可帮助您自动管理和配置对新账户的访问权限。

## 先决条件和限制
<a name="automate-account-creation-lza-prereqs"></a>

**先决条件**
+ 访问中的管理账户 AWS Organizations
+ AWS Cloud Development Kit (AWS CDK) [https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html#getting_started_install](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html#getting_started_install)
+ Python 3.9 或更高版本，[已安装](https://www.python.org/downloads/)
+ AWS Command Line Interface [(AWS CLI) 版本 2.13.19 或更高版本，已安装](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)
+ Docker 24.0.6 或更高版本，[已安装](https://docs.docker.com/get-started/get-docker/)
+  AWS 解决方案上的着陆区域加速器，[部署](https://docs.aws.amazon.com/solutions/latest/landing-zone-accelerator-on-aws/deploy-the-solution.html)在管理账户中
+ （可选）Microsoft Entra ID 和 IAM Identity Center，[已集成](https://docs.aws.amazon.com/singlesignon/latest/userguide/idp-microsoft-entra.html)

**限制**

账户创建工作流支持按顺序执行以部署单个 AWS 账户。此限制可确保账户创建工作流已成功完成，而无需在并行运行期间争夺资源。

## 架构
<a name="automate-account-creation-lza-architecture"></a>

**目标架构**

下图显示了使用着陆区加速器自动创建新 AWS 账户 版本的高级架构。 AWS AWS Step Functions 协调自动化。Step Functions 工作流程中的每项任务都由一个或多个 AWS Lambda 函数执行。

![\[使用 AWS 登录区加速器自动创建新账户的工作流。\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/images/pattern-img/d31abfaa-6854-4923-b896-3b817de9f4d9/images/dfd6503d-a4ed-43df-82d4-082f8153d473.png)


下图显示了如下工作流：

1. 用户通过运行 Python 脚本或使用 Amazon API Gateway 来申请账户。

1. 账户创建 Orchestrator 工作流从 AWS Step Functions中启动。

1. 该工作流更新源代码存储库中的 `account-config.yaml` 文件。它还会在 AWS 管道上启动着陆区加速器并检查管道的状态。此管道创建并设置新账户。有关其工作原理的更多信息，请参阅 AWS登录区加速器的[架构概述](https://docs.aws.amazon.com/solutions/latest/landing-zone-accelerator-on-aws/architecture-overview.html)。

1. （可选）管道完成后，工作流将检查 Microsoft Entra ID 中是否存在该组。如果 Microsoft Entra ID 中不存在该组，则工作流会将该组添加到 Microsoft Entra ID。

1. 该工作流程会执行 AWS 解决方案上的 “着陆区域加速器” 无法执行的其他步骤。默认步骤包括：
   + 在 AWS Identity and Access Management (IAM) 中创建[账户别名](https://docs.aws.amazon.com/IAM/latest/UserGuide/console-account-alias.html)
   + 在中为账户添加[标签](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html) AWS Organizations
   + 根据分配给账户的标签在 [AWS Systems Manager Parameter Store](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html) 中创建参数

1. （可选）该工作流会将一个或多个[权限集](https://docs.aws.amazon.com/singlesignon/latest/userguide/permissionsetsconcept.html)分配给您之前指定的 Microsoft Entra ID 组。该权限集允许组中的用户访问新账户并允许他们执行您配置的操作。

1.  AWS Lambda 函数运行 QA 和验证测试。它会验证资源创建，检查标签是否已创建，并验证是否已部署安全资源。

1. 该工作流释放账户，并使用 Amazon Simple Email Service（Amazon SES）通知用户该过程已成功完成。

有关 Step Functions 工作流的更多信息，请参阅此模式的[其他信息](#automate-account-creation-lza-additional)部分中的 *Step Functions 工作流图表*。

**Microft Entra ID 应用程序**

如果您选择与 Microsoft Entra ID 集成，则在部署此模式时将创建以下两个应用程序：
+ 链接到 IAM Identity Center 并确保 Microsoft Entra ID 组在 IAM Identity Center 可用的应用程序。在本示例中，这个 Microsoft Entra ID 应用程序命名为 `LZA2`。
+ [允许 Lambda 函数与微软 Entra ID 通信并调用微软 Graph 的应用程序。 APIs](https://learn.microsoft.com/en-us/graph/identity-network-access-overview)在此模式中，此应用程序被命名为 `create_aws_account`。

这些应用程序收集的数据用于同步 Microsoft Entra ID 组和分配权限集。

## 工具
<a name="automate-account-creation-lza-tools"></a>

**AWS 服务**
+ [Amazon API Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/welcome.html) 可帮助您创建、发布、维护、监控和保护任何规模的 RES WebSocket APIs T、HTTP。在此模式中，您可以使用 API Gateway 来检查 AWS 账户 名称的可用性、启动 AWS Step Functions 工作流程以及检查 Step Functions 的执行状态。
+ [AWS Cloud Development Kit (AWS CDK)](https://docs.aws.amazon.com/cdk/v2/guide/home.html)是一个软件开发框架，可帮助您在代码中定义和配置 AWS 云 基础架构。
+ [AWS Control Tower](https://docs.aws.amazon.com/controltower/latest/userguide/what-is-control-tower.html)按照规范性最佳实践，帮助您设置和管理 AWS 多账户环境。
+ [Amazon EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html) 是一项无服务器事件总线服务，可帮助您将应用程序与来自各种来源的实时数据连接起来。例如， AWS Lambda 函数、使用 API 目的地的 HTTP 调用端点或其他 AWS 账户目的地的事件总线。此解决方案使用的[EventBridge 规则](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-rules.html)是，如果 Step Functions 工作流程状态更改为`Failed``Timed-out`、或，则启动 Lambda 函数。`Aborted`
+ [AWS Identity and Access Management (IAM)](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html) 通过控制谁经过身份验证并有权使用 AWS 资源，从而帮助您安全地管理对资源的访问权限。
+ [AWS IAM Identity Center](https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html)帮助您集中管理对所有应用程序 AWS 账户 和云应用程序的单点登录 (SSO) 访问权限。
+ [AWS Key Management Service (AWS KMS)](https://docs.aws.amazon.com/kms/latest/developerguide/overview.html) 可帮助您创建和控制加密密钥以帮助保护您的数据。在这种模式中， AWS KMS 密钥用于加密数据，例如存储在亚马逊简单存储服务 (Amazon S3) Simple Service 中的数据、Lambda 环境变量和 Step Functions 中的数据。
+ [AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/welcome.html) 是一项计算服务，可帮助您运行代码，无需预调配或管理服务器。它只在需要时运行您的代码，并自动进行扩展，因此您只需为使用的计算时间付费。
+ [AWS Organizations](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html)是一项账户管理服务，可帮助您将多个账户整合 AWS 账户 到一个由您创建和集中管理的组织中。
+ [Amazon Simple Email Service (Amazon SES)](https://docs.aws.amazon.com/ses/latest/dg/Welcome.html) 帮助您通过使用您自己的电子邮件地址和域发送和接收电子邮件。成功创建新账户后，您将通过 Amazon SES 收到通知。
+ [Amazon Simple Notification Service（Amazon SNS）](https://docs.aws.amazon.com/sns/latest/dg/welcome.html)可帮助您协调和管理发布者与客户端（包括 Web 服务器和电子邮件地址）之间的消息交换。如果在账户创建过程中出错，Amazon SNS 会向您配置的电子邮件地址发送通知。
+ [AWS Step Functions](https://docs.aws.amazon.com/step-functions/latest/dg/welcome.html)是一项无服务器编排服务，可帮助您组合 AWS Lambda 功能和其他功能 AWS 服务 来构建关键业务应用程序。
+ [AWS Systems Manager Parameter Store](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html) 为配置数据管理和密钥管理提供安全的分层存储。

**其他工具**
+ [awscurl](https://pypi.org/project/awscurl/0.6/) 可自动执行 AWS API 请求的签名，并帮助您以标准 curl 命令的形式发出请求。
+ [Microsoft Entra ID](https://learn.microsoft.com/en-us/entra/fundamentals/whatis)，前身为 *Azure Active Directory*，它是一项基于云的身份和访问管理服务。
+ [Microsoft Graph](https://learn.microsoft.com/en-us/graph/graph-explorer/graph-explorer-overview) 可 APIs帮助你访问微软云服务（例如微软 Entra 和微软 365）中的数据和情报。

**代码存储库**

此模式的代码可在 GitHub [lza-account-creation-workflow](https://github.com/aws-samples/lza-account-creation-workflow)存储库中找到。

[lambda\$1layer](https://github.com/aws-samples/lza-account-creation-workflow/tree/main/app/lambda_layer) 目录包含以下层，它们在多个 Lambda 函数中被引用：
+ [account\$1creation\$1helper](https://github.com/aws-samples/lza-account-creation-workflow/tree/main/app/lambda_layer/account_creation_helper) — 此层包括用于担任角色和检查进度的模块。 AWS Service Catalog
+ [boto3](https://github.com/aws-samples/lza-account-creation-workflow/tree/main/app/lambda_layer/boto3) — 此层包含[适用于 Python (Boto3) 的 AWS SDK](https://boto3.amazonaws.com/v1/documentation/api/latest/index.html)模块，以确保该模块 AWS Lambda 具有最新版本。
+ [identity\$1center\$1helper](https://github.com/aws-samples/lza-account-creation-workflow/tree/main/app/lambda_layer/identity_center_helper) – 此层支持对 IAM Identity Center 的调用。

[lambda\$1src](https://github.com/aws-samples/lza-account-creation-workflow/tree/main/app/lambda_src) 目录包含以下 Lambda 函数：
+ [AccountTagToSsmParameter](https://github.com/aws-samples/lza-account-creation-workflow/tree/main/app/lambda_src/event/AccountTagToSsmParameter)— 此函数使用附加到账户的标签 AWS Organizations 在 Parameter Store 中创建参数。每个参数都以前缀 `/account/tags/` 开头。
+ [AttachPermissionSet](https://github.com/aws-samples/lza-account-creation-workflow/tree/main/app/lambda_src/stepfunction/AttachPermissionSet)— 此函数向 IAM 身份中心群组添加权限集。
+ [Azure ADGroup 同步](https://github.com/aws-samples/lza-account-creation-workflow/tree/main/app/lambda_src/stepfunction/AzureADGroupSync) — 此功能将目标 Microsoft Entra ID 组同步到 IAM 身份中心。
+ [CheckForRunningProcesses](https://github.com/aws-samples/lza-account-creation-workflow/tree/main/app/lambda_src/stepfunction/CheckForRunningProcesses)— 此函数检查`AWSAccelerator-Pipeline`管道当前是否正在运行。如果管道正在运行，则该函数会延迟 AWS Step Functions 工作流程。
+ [CreateAccount](https://github.com/aws-samples/lza-account-creation-workflow/tree/main/app/lambda_src/stepfunction/CreateAccount)— 此函数使用 AWS Service Catalog 和 AWS Control Tower 来创建新的 AWS 账户。
+ [CreateAdditionalResources](https://github.com/aws-samples/lza-account-creation-workflow/tree/main/app/lambda_src/stepfunction/CreateAdditionalResources)— 此功能可创建不由着陆区加速器管理的 AWS 资源 AWS CloudFormation，例如账户别名和 AWS Service Catalog 标签。
+ [GetAccountStatus](https://github.com/aws-samples/lza-account-creation-workflow/tree/main/app/lambda_src/stepfunction/GetAccountStatus)— 此功能在中扫描已配置的产品 AWS Service Catalog ，以确定账户创建过程是否已完成。
+ [GetExecutionStatus](https://github.com/aws-samples/lza-account-creation-workflow/tree/main/app/lambda_src/api/GetExecutionStatus)— 此函数检索正在运行或已完成的 AWS Step Functions 执行的状态。
+ [NameAvailability](https://github.com/aws-samples/lza-account-creation-workflow/tree/main/app/lambda_src/api/NameAvailability)— 此函数检查中是否已存在 AWS 账户 名称 AWS Organizations。
+ [ReturnResponse](https://github.com/aws-samples/lza-account-creation-workflow/tree/main/app/lambda_src/stepfunction/ReturnResponse)— 如果账户创建成功，则此函数返回新账户的 ID。如果创建账户未成功，将返回错误消息。
+ [RunStepFunction](https://github.com/aws-samples/lza-account-creation-workflow/tree/main/app/lambda_src/api/RunStepFunction)— 此函数运行创建账户 AWS Step Functions 的工作流程。
+ [SendEmailWithSES](https://github.com/aws-samples/lza-account-creation-workflow/tree/main/app/lambda_src/stepfunction/SendEmailWithSES) — 此功能向正在等待账户创建完成的用户发送电子邮件。
+ [验证 ADGroup SyncTo SSO](https://github.com/aws-samples/lza-account-creation-workflow/tree/main/app/lambda_src/stepfunction/ValidateAdGroupSyncToSSO) — 此功能检查指定的 Microsoft Entra ID 组是否与 IAM 身份中心同步。
+ [ValidateResources](https://github.com/aws-samples/lza-account-creation-workflow/tree/main/app/lambda_src/stepfunction/ValidateResources)— 此函数验证所有 AWS Control Tower 自定义设置是否已成功运行。

## 最佳实践
<a name="automate-account-creation-lza-best-practices"></a>

我们建议对 AWS CDK使用以下命名惯例： 
+ 所有参数都以 `p` 前缀开头。
+ 所有条件都以 `c` 前缀开头。
+ 所有资源都以 `r` 前缀开头。
+ 所有输出都以 `o` 前缀开头。

## 操作说明
<a name="automate-account-creation-lza-epics"></a>

### 部署 IAM 角色以进行验证和标记
<a name="deploy-the-iam-roles-for-validation-and-tagging"></a>


| Task | 说明 | 所需技能 | 
| --- | --- | --- | 
| 准备开启着陆区域加速器 AWS 以进行自定义。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/automate-account-creation-lza.html) | AWS DevOps | 
| 准备部署 `lza-account-creation-validation` 角色。 | 现在，您可以自定义解决方案，以便在除管理账户之外的所有账户中部署 `lza-account-creation-validation` IAM 角色。此角色为 `ValidateResources` Lambda 函数提供了新账户的只读访问权限。[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/automate-account-creation-lza.html) | AWS DevOps | 
| 准备部署 `account-tagging-to-ssm-parameter-role` 角色。 | 现在，您可以自定义解决方案，以便在除管理账户之外的所有账户中部署 `account-tagging-to-ssm-parameter-role` IAM 角色。此角色用于在参数存储中创建 AWS Systems Manager 参数。[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/automate-account-creation-lza.html) | AWS DevOps | 
| 准备部署 `config-log-validation-role` 角色。 | 现在，您可以自定义解决方案，以便在日志存档账户中部署 `config-log-validation-role` IAM 角色。此角色允许 `ValidateResources` Lambda 函数访问 Amazon S3 存储桶以获取日志记录和访问 AWS Config 规则。[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/automate-account-creation-lza.html) | AWS DevOps | 

### （可选）从 Microsoft Entra ID 获取数据
<a name="optional-get-data-from-microsoft-entra-id"></a>


| Task | 说明 | 所需技能 | 
| --- | --- | --- | 
| 创建允许 Lambda 函数与 Microsoft Entra ID 通信的应用程序。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/automate-account-creation-lza.html) | Microsoft Entra ID | 
| 检索 `create_aws_account` 应用程序的值。 | 现在，您可以检索您需要用于 `create_aws_account` 应用程序的值。[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/automate-account-creation-lza.html) | Microsoft Entra ID | 
| 创建将 Microsoft Entra ID 与 IAM Identity Center 集成的应用程序。 | 在 Microsoft Entra ID 管理中心，注册 `LZA2` 应用程序。有关说明，请参阅 Microsoft 文档中的[注册应用程序](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app)。 | Microsoft Entra ID | 
| 检索 `LZA2` 应用程序的值。 | 现在，您可以检索您需要用于 `LZA2` 应用程序的值。[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/automate-account-creation-lza.html) | Microsoft Entra ID | 
| 创建密钥。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/automate-account-creation-lza.html) | AWS DevOps | 

### 部署解决方案
<a name="deploy-the-solution"></a>


| Task | 说明 | 所需技能 | 
| --- | --- | --- | 
| 克隆源代码。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/automate-account-creation-lza.html) | DevOps 工程师 | 
| 更新 `deploy-config.yaml` 文件。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/automate-account-creation-lza.html) | AWS DevOps | 
| 在您的 AWS 环境中部署解决方案。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/automate-account-creation-lza.html)此解决方案使用 Amazon S3 存储桶来存储此解决方案的源代码。您可以使用 [upload\$1to\$1source\$1bucket.py](https://github.com/aws-samples/gen-ai-trivia/blob/main/scripts/upload_to_source_bucket.py) 脚本创建源代码存档并上传更新的版本。 | AWS DevOps | 

### 选项 1 ‒ 使用 Python 创建账户
<a name="option-1-create-an-account-using-python"></a>


| Task | 说明 | 所需技能 | 
| --- | --- | --- | 
| 确定要使用哪些参数。 | 选择在运行启动 Step Functions 工作流的 Python 脚本时要使用的参数。有关参数的完整列表，请参阅此模式的[其他信息](#automate-account-creation-lza-additional)部分。 | AWS DevOps，Python | 
| 启动 Python 脚本。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/automate-account-creation-lza.html) | DevOps 工程师，Python | 

### 选项 2 ‒ 使用 API Gateway 和 awscurl 创建账户
<a name="option-2-create-an-account-using-api-gateway-and-awscurl"></a>


| Task | 说明 | 所需技能 | 
| --- | --- | --- | 
| 为 awscurl 设置变量。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/automate-account-creation-lza.html) | AWS DevOps | 
| 检查名称可用性。 | 输入以下命令以验证该名称可用于 AWS 账户。将 `<AWS_ACCOUNT_NAME>` 替换为目标账户的名称：<pre>awscurl --service execute-api \<br />    --region ${AWS_REGION} \<br />    --access_key ${AWS_ACCESS_KEY_ID} \<br />    --secret_key ${AWS_SECRET_ACCESS_KEY} \<br />    --security_token ${AWS_SESSION_TOKEN} \<br />    -X POST ${API_GATEWAY_ENDPOINT}check_name?account_name=<AWS_ACCOUNT_NAME></pre> | AWS DevOps | 
| 运行账户创建工作流。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/automate-account-creation-lza.html) | AWS DevOps | 

### （可选）清理解决方案
<a name="optional-clean-up-the-solution"></a>


| Task | 说明 | 所需技能 | 
| --- | --- | --- | 
| 从 Amazon S3 存储桶中移除对象。 | 移除以下 Amazon S3 存储桶中的所有对象：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/automate-account-creation-lza.html) | AWS DevOps | 
| 删除 CloudFormation 堆栈。 | 输入以下命令删除 CloudFormation 堆栈：<pre>aws cloudformation delete-stack \<br />  --stack-name lza-account-creation-workflow-application<br />aws cloudformation wait stack-delete-complete \<br />  --stack-name lza-account-creation-workflow-application</pre> | AWS DevOps | 
| 删除管道。 | 输入以下命令以删除 `lza-account-creation-workflow-pipeline` 管道：<pre>cdk destroy lza-account-creation-workflow-pipeline --force</pre> | AWS DevOps | 

## 相关资源
<a name="automate-account-creation-lza-resources"></a>
+ [着陆区加速器已开启 AWS](https://aws.amazon.com/solutions/implementations/landing-zone-accelerator-on-aws/)（AWS 解决方案库）
+ [常见 AWS CDK 问题疑难解答](https://docs.aws.amazon.com/cdk/v2/guide/troubleshooting.html)（AWS CDK 文档）

## 附加信息
<a name="automate-account-creation-lza-additional"></a>

**Step Functions 工作流图表**

下图显示了 Step Functions 工作流中的状态。

![\[Step Functions 工作流中的状态。\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/images/pattern-img/d31abfaa-6854-4923-b896-3b817de9f4d9/images/d93aa7bf-1144-4f25-9488-aacc534a7813.png)


**参数**

下面是运行启动 Step Functions 工作流的 Python 脚本时可以使用的参数。

以下参数为必需参数：
+ `account-name (-a)`（字符串）-新的名称 AWS 账户。
+ `support-dl (-s)`（字符串）- 账户创建过程完成后接收通知的电子邮件地址。
+ `managed-org-unit (-m)`（字符串）- 将包含新账户的托管[组织单元（OU）](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#organizationalunit)。

下列参数是可选参数：
+ `ad-integration (-ad)`（字符串字典）– Microsoft Entra ID 组和分配的权限集。下面的示例说明如何使用此参数：

  ```
  --ad-integration "{\"<PermissionSetName>\": \"<EntraIdGroupName>\"}"
  ```
+ `account-email (-e)`****（字符串）-新的 root 用户的电子邮件地址 AWS 账户。
**注意**  
如果不使用此参数，则将使用 `configs/deploy-config.yaml` 文件中的值 `rootEmailPrefix` 和 `rootEmailDomain` 生成电子邮件地址。如果未提供电子邮件地址，则使用以下格式生成电子邮件地址：`rootEmailPrefix+accountName@rootEmailDomain`。
+ `region (-r)`（字符串）— Step Functions 工作流程的部署 AWS 区域 位置。默认值为 `us-east-1`。
+ `force-update (-f)`（字符串布尔值）-输入`true`强制 AWS Service Catalog 更新预配置的产品。
+ `bypass-creation (-b)`（布尔值字符串）- 输入 `true` 以绕过向 `accounts-config.yaml` 文件添加账户的步骤，并绕过运行 `AWSAccelerator-Pipeline` 管道的步骤。此参数通常用于测试账户创建工作流或在 `Landing Zone Accelerator` 管道中出现错误时运行 Step Functions 的其余步骤。
+ `tags (-t)`（字符串）-要添加到的其他标签 AWS 账户。默认情况下，会添加以下标签：`account-name`、`support-dl` 和 `purpose`。下面的示例说明如何使用此参数：

  ```
  --tags TEST1=VALUE1 TEST2=VALUE2
  ```