View a markdown version of this page

Erstellen eines Feature-Flag-Konfigurationsprofils (Befehlszeile) - AWS AppConfig

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)

Das folgende Verfahren beschreibt, wie Sie AWS Command Line Interface (unter Linux oder Windows) oder Tools für Windows verwenden, um ein AWS AppConfig Feature-Flag-Konfigurationsprofil PowerShell zu erstellen. Bei der Erstellung des Konfigurationsprofils können Sie auch ein grundlegendes Feature-Flag erstellen.

Um eine Feature-Flag-Konfiguration zu erstellen
  1. Öffnen Sie die AWS CLI.

  2. Erstellen Sie ein Feature-Flag-Konfigurationsprofil und geben Sie als Typ anAWS.AppConfig.FeatureFlags. Das Konfigurationsprofil muss hosted für den Standort-URI verwendet werden.

    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
  3. 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 unterGrundlegendes zur Typreferenz für AWS.AppConfig.FeatureFlags.

  4. Verwenden Sie die CreateHostedConfigurationVersion API, um Ihre Feature-Flag-Konfigurationsdaten in 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.