

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

# 在中为您的应用程序创建命名空间 AWS AppConfig
<a name="appconfig-creating-namespace"></a>

本节中的过程可帮助您创建名为 AWS AppConfig 应用程序的构件。应用程序只是一种组织构造，就像文件夹一样，用于标识应用程序的命名空间。此组织构造与某些可执行代码单元有关。例如，您可以创建一个名为的应用程序 MyMobileApp 来组织和管理用户安装的移动应用程序的配置数据。必须先创建这些工件，然后 AWS AppConfig 才能使用部署和检索功能标志或自由格式配置数据。

以下过程为您提供了将扩展与功能标志配置文件关联的选项。在创建或部署配置 AWS AppConfig 的工作流程中，*扩展*可以增强您在不同时刻注入逻辑或行为的能力。有关更多信息，请参阅 [了解 AWS AppConfig 扩展](working-with-appconfig-extensions-about.md)。

**注意**  
您可以使用 AWS CloudFormation 创建 AWS AppConfig 项目，包括应用程序、环境、配置配置文件、部署、部署策略和托管配置版本。有关更多信息，请参阅《AWS CloudFormation 用户指南》**中的 [AWS AppConfig 资源类型参考](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_AppConfig.html)。

**Topics**
+ [创建 AWS AppConfig 应用程序（控制台）](#appconfig-creating-application-console)
+ [创建 AWS AppConfig 应用程序（命令行）](#appconfig-creating-application-commandline)

## 创建 AWS AppConfig 应用程序（控制台）
<a name="appconfig-creating-application-console"></a>

使用以下步骤通过 AWS Systems Manager 控制台创建 AWS AppConfig 应用程序。

**创建应用程序**

1. 在 [https://console.aws.amazon.com/systems-manager/appconfig](https://console.aws.amazon.com/systems-manager/appconfig/)/上打开 AWS Systems Manager 控制台。

1. 在导航窗格中，选择**应用程序**，然后选择**创建应用程序**。

1. 对于 **Name (名称)**，请输入应用程序的名称。

1. 对于 **Description (描述)**，请输入有关应用程序的信息。

1. （可选）在**扩展**部分中，从列表中选择一个扩展。有关更多信息，请参阅 [了解 AWS AppConfig 扩展](working-with-appconfig-extensions-about.md)。

1. （可选）在**标签**部分中，输入键和可选的值。您最多可以为一个资源指定 50 个标签。

1. 选择**创建应用程序**。

AWS AppConfig 创建应用程序，然后显示 “**环境**” 选项卡。继续执行[在中为您的应用程序创建环境 AWS AppConfig](appconfig-creating-environment.md)。

## 创建 AWS AppConfig 应用程序（命令行）
<a name="appconfig-creating-application-commandline"></a>

以下过程介绍如何使用 AWS CLI （在 Linux 或 Windows 上）或 AWS Tools for PowerShell 如何创建 AWS AppConfig 应用程序。

**分步创建应用程序**

1. 打开 AWS CLI.

1. 运行以下命令以创建应用程序。

------
#### [ Linux ]

   ```
   aws appconfig create-application \
     --name A_name_for_the_application \
     --description A_description_of_the_application \  
     --tags User_defined_key_value_pair_metadata_for_the_application
   ```

------
#### [ Windows ]

   ```
   aws appconfig create-application ^
     --name A_name_for_the_application ^
     --description A_description_of_the_application ^
     --tags User_defined_key_value_pair_metadata_for_the_application
   ```

------
#### [ PowerShell ]

   ```
   New-APPCApplication `
     -Name Name_for_the_application `
     -Description Description_of_the_application `
     -Tag Hashtable_type_user_defined_key_value_pair_metadata_for_the_application
   ```

------

   系统将返回类似于以下内容的信息。

------
#### [ Linux ]

   ```
   {
      "Id": "Application ID",
      "Name": "Application name",
      "Description": "Description of the application"
   }
   ```

------
#### [ Windows ]

   ```
   {
      "Id": "Application ID",
      "Name": "Application name",
      "Description": "Description of the application"
   }
   ```

------
#### [ PowerShell ]

   ```
   ContentLength    : Runtime of the command
   Description      : Description of the application
   HttpStatusCode   : HTTP Status of the runtime
   Id               : Application ID
   Name             : Application name
   ResponseMetadata : Runtime Metadata
   ```

------