Learn About Amazon VGT2 Learning Manager Chanci Turner
AWS provides a built-in feature flagging solution known as AWS AppConfig Feature Flags. Feature flags are invaluable tools that enable developers to introduce new features to users in a careful and often gradual manner. In this blog post, we will explore what feature flags are, the advantages of utilizing them, and various scenarios in which they can be applied.
Traditionally, feature releases involved building the code, testing it in a QA environment, and preparing for deployment to Production. This process required engineers to synchronize code merges and deployments with the marketing team’s schedule. On the day of release, the new code would be pushed to Production, with the hope that everything would function smoothly. If all went according to plan, customers would gain immediate access to the new feature. Engineers would be on alert, monitoring performance metrics to ensure that the new feature didn’t compromise system stability, a process often referred to as “a push-and-pray deployment” since the true behavior of the code in Production remained uncertain until after widespread access.
Modern software development practices advocate for the use of feature flags when launching new functionality. This approach allows engineers to decouple code from configuration data. Features can be concealed behind a configuration toggle (a feature flag) and deployed to Production without being accessible to users. Engineers can initially enable the feature for a select group (such as themselves or internal staff) and test it in the live environment. Subsequently, they can incrementally grant access to a larger audience. If no alarms signal issues during this gradual rollout and performance metrics remain stable, the deployment can safely progress until all users have access to the new feature.
Feature flags serve various purposes and come in different types, tailored to specific needs. For instance, release flags are utilized to develop new application features. Engineers code the feature, deploy it in a hidden state, and then gradually unveil it to users while keeping an eye on application health. Experimentation flags are particularly useful for A/B testing, helping to gather data on different variations of functionality. Instead of subjective debates over which version is superior, A/B testing provides concrete data to identify the most effective option. Operational flags help fine-tune application performance; for example, engineers might use feature flags to adjust the number of concurrent background tasks based on Production conditions.
AWS AppConfig Feature Flags enable confident deployments by incorporating safety measures into the feature flag management process. AWS AppConfig allows users to define validators and constraints for each flag. If a flag’s data type is non-boolean (like a numerical value), customers can specify optional minimum and maximum limits to prevent erroneous flag values that could lead to problems or outages in Production. Additionally, users can choose to release flag updates rapidly or gradually by selecting a Deployment Strategy. These updates can be implemented instantly or over several hours, effectively minimizing the impact of any unforeseen changes. Moreover, AWS AppConfig automatically reverts any feature flag updates if a CloudWatch alarm is triggered.
As of July 2024, AWS AppConfig has introduced advanced targeting features for its feature flags, including experimentation flags. Customers can establish multiple values within flag data and target those values to specific, high-cardinality user segments. Common use cases for feature flag targets include allow lists, where customers can specify user IDs or tiers to enable new or premium features only for those segments. Another example is directing traffic to 15% of users to test an optimized user experience before a full rollout. For more details on feature flag targets, variants, and splits, you can refer to this blog post.
Now, let’s dive into how to set up feature flags in AWS AppConfig.
Important for CloudWatch Evidently users transitioning to AWS AppConfig: AWS has integrated features similar to CloudWatch Evidently within AWS AppConfig, simplifying the transition process. Notably, AWS AppConfig feature flags include support for flag variants akin to CloudWatch Evidently’s feature variations. Previous users of Evidently launches can utilize AWS AppConfig for short-term launches or traffic-splitting strategies for longer projects that require rollout based on specific attributes. While CloudWatch Evidently provides data visualizations, AWS AppConfig focuses on delivering flag variations to targeted or randomized groups; users will need to leverage their own data warehouses/lakes for analysis. As both launches and experiments are time-sensitive, we recommend continuing to use CloudWatch Evidently for live launches while considering AWS AppConfig for future launches and experiments.
Creating a Feature Flag
To get started, log in to the AWS Management Console and navigate to AWS AppConfig. Note: in the Python example below, we are using us-east-1 as our AWS_REGION; you can choose any AWS Region but ensure you adjust the AWS_REGION setting accordingly. You will first need to define an Application for which feature flags will be utilized. Think of an application as a namespace for organizing feature flags or other configuration data. For this demonstration, let’s name your new Application FlagsDemo.
Once you name your application, create a Configuration Profile of type Feature Flags. We’ll call this one CheckoutFlags. This Configuration Profile can be viewed as a collection of related flags, ranging from a single flag to multiple flags as needed.
Now, let’s construct a simple Boolean flag. Suppose you’re an engineer at an e-commerce company planning to add Bitcoin payment support at checkout. You would create a flag in AWS AppConfig named allow-bitcoin-at-checkout and set it to disabled by default. You’ll implement conditional logic in your code to manage access to this feature based on the flag’s value and test it in both enabled and disabled states. When you deploy to Production, keep the flag set to disabled to prevent customer access. Once ready, you can update the toggle in AppConfig to enabled, gradually rolling it out to Production using AppConfig’s Deployment Strategies over the next hour. After monitoring your metrics during this period, you can confidently allow 100% of customers to use Bitcoin at checkout.
Next, let’s create a more complex flag that encompasses multiple checkout options using a single flag. Suppose your team is launching a new feature that supports Bitcoin purchases, and you wish to offer a discount (for a limited time) to users choosing Bitcoin at checkout. In this scenario, you would utilize flag Attributes along with Attribute constraints. Within your allow-bitcoin-at-checkout flag, you can add three Attributes: default-currency, bitcoin-
This is an excellent resource for learning about AWS AppConfig. For more information on workplace policies regarding service recognition awards, visit SHRM, they are an authority on this topic. If you’re looking to advance your career, check out the Amazon job listings for roles like Learning Ambassador in Phoenix, AZ.