

Die vorliegende Übersetzung wurde maschinell erstellt. Im Falle eines Konflikts oder eines Widerspruchs zwischen dieser übersetzten Fassung und der englischen Fassung (einschließlich infolge von Verzögerungen bei der Übersetzung) ist die englische Fassung maßgeblich.

# Erstellen eines Feature-Flag-Konfigurationsprofils (Befehlszeile)
<a name="appconfig-creating-feature-flag-configuration-commandline"></a>

Im folgenden Verfahren wird beschrieben, wie Sie mithilfe von AWS Command Line Interface (unter Linux oder Windows) oder Tools für Windows PowerShell ein AWS AppConfig Feature-Flag-Konfigurationsprofil erstellen. Wenn Sie das Konfigurationsprofil erstellen, können Sie auch ein grundlegendes Feature-Flag erstellen.

**Um eine Feature-Flag-Konfiguration zu erstellen**

1. Öffnen Sie das AWS CLI.

1. Erstellen Sie ein Konfigurationsprofil für Feature-Flags und geben Sie dessen **Typ** als an`AWS.AppConfig.FeatureFlags`. Das Konfigurationsprofil muss den URI `hosted` für den Standort verwenden.

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

   ```
   aws appconfig create-configuration-profile \
     --application-id {{APPLICATION_ID}} \
     --name {{CONFIGURATION_PROFILE_NAME}} \
     --location-uri hosted \
     --type AWS.AppConfig.FeatureFlags
   ```

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

   ```
   aws appconfig create-configuration-profile ^
     --application-id {{APPLICATION_ID}} ^
     --name {{CONFIGURATION_PROFILE_NAME}} ^
     --location-uri hosted ^
     --type AWS.AppConfig.FeatureFlags
   ```

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

   ```
   New-APPCConfigurationProfile `
     -Name {{CONFIGURATION_PROFILE_NAME}} `
     -ApplicationId {{APPLICATION_ID}} `
     -LocationUri hosted `
     -Type AWS.AppConfig.FeatureFlags
   ```

------

1. Erstellen Sie Ihre Feature-Flag-Konfigurationsdaten. Ihre Daten müssen in einem JSON-Format vorliegen und dem `AWS.AppConfig.FeatureFlags` JSON-Schema entsprechen. Weitere Informationen zum Schema finden Sie unter[Grundlegendes zur Typenreferenz für AWS.AppConfig.FeatureFlags](appconfig-type-reference-feature-flags.md).

1. Verwenden Sie die `CreateHostedConfigurationVersion` API, um Ihre Feature-Flag-Konfigurationsdaten zu speichern AWS AppConfig.

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

   ```
   aws appconfig create-hosted-configuration-version \
     --application-id {{APPLICATION_ID}} \
     --configuration-profile-id {{CONFIGURATION_PROFILE_ID}} \
     --content-type "application/json" \
     --content {{file://path/to/feature_flag_configuration_data.json}} \
     --cli-binary-format raw-in-base64-out
   ```

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

   ```
   aws appconfig create-hosted-configuration-version ^
     --application-id {{APPLICATION_ID}} ^
     --configuration-profile-id {{CONFIGURATION_PROFILE_ID}} ^
     --content-type "application/json" ^
     --content {{file://path/to/feature_flag_configuration_data.json}} ^
     --cli-binary-format raw-in-base64-out
   ```

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

   ```
   New-APPCHostedConfigurationVersion `
     -ApplicationId {{APPLICATION_ID}} `
     -ConfigurationProfileId {{CONFIGURATION_PROFILE_ID}} `
     -ContentType "application/json" `
     -Content {{file://path/to/feature_flag_configuration_data.json}}
   ```

------

   Der Befehl lädt den für den `Content` Parameter angegebenen Inhalt von der Festplatte. Der Inhalt muss dem folgenden Beispiel ähneln.

   ```
   {
       "flags": {
           "ui_refresh": {
               "name": "UI Refresh"
           }
       },
       "values": {
           "ui_refresh": {
               "enabled": false,
               "attributeValues": {
                   "dark_mode_support": true
               }
           }
       },
       "version": "1"
   }
   ```

   Das System gibt unter anderem folgende Informationen zurück

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

   ```
   {
      "ApplicationId"          : "ui_refresh",
      "ConfigurationProfileId" : "UI Refresh",
      "VersionNumber"          : "1",
      "ContentType"            : "application/json"
   }
   ```

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

   ```
   {
      "ApplicationId"          : "ui_refresh",
      "ConfigurationProfileId" : "UI Refresh",
      "VersionNumber"          : "1",
      "ContentType"            : "application/json"
   }
   ```

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

   ```
   ApplicationId          : ui_refresh
   ConfigurationProfileId : UI Refresh
   VersionNumber          : 1
   ContentType            : application/json
   ```

------

   Das `service_returned_content_file` enthält Ihre Konfigurationsdaten, die einige AWS AppConfig generierte Metadaten enthalten.
**Anmerkung**  
Wenn Sie die gehostete Konfigurationsversion erstellen, wird AWS AppConfig überprüft, ob Ihre Daten dem `AWS.AppConfig.FeatureFlags` JSON-Schema entsprechen. AWS AppConfig überprüft außerdem, ob jedes Feature-Flag-Attribut in Ihren Daten die Einschränkungen erfüllt, die Sie für diese Attribute definiert haben.