Creating a feature flag configuration profile (command line)
The following procedure describes how to use the Amazon Command Line Interface (on Linux or Windows) or Tools for Windows PowerShell to create an Amazon AppConfig feature flag configuration profile. At the time you create the configuration profile, you can also create a basic feature flag.
To create a feature flag configuration
-
Open the Amazon CLI.
-
Create a feature flag configuration profile specifying its Type as
AWS.AppConfig.FeatureFlags
. The configuration profile must usehosted
for the location URI. -
Create your feature flag configuration data. Your data must be in a JSON format and conform to the
AWS.AppConfig.FeatureFlags
JSON schema. For more information about the schema, see Type reference for AWS.AppConfig.FeatureFlags. -
Use the
CreateHostedConfigurationVersion
API to save your feature flag configuration data to Amazon AppConfig.The
content
parameter usesbase64
encoded data, similar to the following example.{ "flags": { "ui_refresh": { "name": "UI Refresh" } }, "values": { "ui_refresh": { "enabled": false, "attributeValues": { "dark_mode_support": true } } }, "version": "1" }
The system returns information like the following.
The
service_returned_content_file
contains your configuration data that includes some Amazon AppConfig generated metadata.Note
When you create the hosted configuration version, Amazon AppConfig verifies that your data conforms to the
AWS.AppConfig.FeatureFlags
JSON schema. Amazon AppConfig additionally validates that each feature flag attribute in your data satisfies the constraints you defined for those attributes.