Creating feature flags and free form configuration data in Amazon AppConfig - Amazon AppConfig
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Creating feature flags and free form configuration data in Amazon AppConfig

The topics in this section help you complete the following tasks in Amazon AppConfig. These tasks create important artifacts for deploying configuration data.

1. Create an application namespace

To create an application namespace, you create an Amazon AppConfig artifact called an application. An application is simply an organizational construct like a folder.

2. Create environments

For each Amazon AppConfig application, you define one or more environments. An environment is a logical deployment group of Amazon AppConfig targets, such as applications in a Beta or Production environment. You can also define environments for application subcomponents, such as Amazon Lambda functions, Containers, Web, Mobile, and Back-end.

You can configure Amazon CloudWatch alarms for each environment to automatically rollback problematic configuration changes. The system monitors alarms during a configuration deployment. If an alarm is triggered, the system rolls back the configuration.

3. Create a configuration profile

Configuration data is a collection of settings that influence the behavior of your application. A configuration profile includes, among other things, a URI that enables Amazon AppConfig to locate your configuration data in its stored location and a configure type. Amazon AppConfig supports the following types of configuration profiles:

  • Feature flags: You can use feature flags to enable or disable features within your applications or to configure different characteristics of your application features using flag attributes. Amazon AppConfig stores feature flag configurations in the Amazon AppConfig hosted configuration store in a feature flag format that contains data and metadata about your flags and the flag attributes. The URI for feature flag configurations is simply hosted.

  • Freeform configurations: A freeform configuration can store data in any of the following services and capabilities:

    • Amazon AppConfig hosted configuration store

    • Amazon Simple Storage Service

    • Amazon CodePipeline

    • Amazon Secrets Manager

    • Amazon Systems Manager (SSM) Parameter Store

    • SSM Document Store

Note

If possible, we recommend hosting your configuration data in the Amazon AppConfig hosted configuration store as it offers the most features and enhancements.

4. (Optional, but recommended) Create multi-variant feature flags

Amazon AppConfig offers basic feature flags, which (if enabled) return a specific set of configuration data per request. To better support user segmentation and traffic splitting use cases, Amazon AppConfig also offers multi-variant feature flags, which enable you to define a set of possible flag values to return for a request. You can also configure different statuses (enabled or disabled) for multi-variant flags. When requesting a flag configured with variants, your application provides context that Amazon AppConfig evaluates against a set of user-defined rules. Depending on the context specified in the request and the rules defined for the variant, Amazon AppConfig returns different flag values to the application.

The following section includes feature flag and freeform configuration data samples.

Feature flag configuration data

The following feature flag configuration data enables or disables mobile payments and default payments on a per-region basis.

JSON
{ "allow_mobile_payments": { "enabled": false }, "default_payments_per_region": { "enabled": true } }
YAML
--- allow_mobile_payments: enabled: false default_payments_per_region: enabled: true

Operational configuration data

The following freeform configuration data enforces limits on how an application processes requests.

JSON
{ "throttle-limits": { "enabled": "true", "throttles": [ { "simultaneous_connections": 12 }, { "tps_maximum": 5000 } ], "limit-background-tasks": [ true ] } }
YAML
--- throttle-limits: enabled: 'true' throttles: - simultaneous_connections: 12 - tps_maximum: 5000 limit-background-tasks: - true

Access control list configuration data

The following access control list freeform configuration data specifies which users or groups can access an application.

JSON
{ "allow-list": { "enabled": "true", "cohorts": [ { "internal_employees": true }, { "beta_group": false }, { "recent_new_customers": false }, { "user_name": "Jane_Doe" }, { "user_name": "John_Doe" } ] } }
YAML
--- allow-list: enabled: 'true' cohorts: - internal_employees: true - beta_group: false - recent_new_customers: false - user_name: Jane_Doe - user_name: Ashok_Kumar