Creating a feature flag configuration profile (command line)
The following procedure describes how to use the AWS Command Line Interface (on Linux or Windows) or Tools for Windows PowerShell to create an AWS 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 AWS CLI.
-
Create a feature flag configuration profile specifying its Type as
AWS.AppConfig.FeatureFlags. The configuration profile must usehostedfor the location URI. -
Create your feature flag configuration data. Your data must be in a JSON format and conform to the
AWS.AppConfig.FeatureFlagsJSON schema. For more information about the schema, see Understanding the type reference for AWS.AppConfig.FeatureFlags. -
Use the
CreateHostedConfigurationVersionAPI to save your feature flag configuration data to AWS AppConfig.The command loads the content specified for the
Contentparameter from disk. The content must be 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_filecontains your configuration data that includes some AWS AppConfig generated metadata.Note
When you create the hosted configuration version, AWS AppConfig verifies that your data conforms to the
AWS.AppConfig.FeatureFlagsJSON schema. AWS AppConfig additionally validates that each feature flag attribute in your data satisfies the constraints you defined for those attributes.