CLOUD CONCEPT

Feature Flags

Feature flags are configurable controls that let applications enable, disable, or vary behavior without changing the deployed code.

Cloud Concepts Hub →

What is Feature Flags

Feature flags separate deploying software from releasing its functionality to users. They help engineers configure environments, expose changes gradually, and disable problematic behavior, but require careful validation, testing, and lifecycle management.

A feature flag is a configuration value that application code evaluates to select behavior. A simple Boolean flag might choose between an existing checkout flow and a new implementation. More advanced flags can return different variants based on attributes such as tenant, account tier, or user identifier. The application must already contain the relevant behavior; changing a flag cannot introduce code that was never deployed.

For cloud deployments, feature flags support promoting the same application artifact through development, test, and production while keeping environment-specific configuration separate. For example, a new search implementation can be enabled in development, tested with representative data in staging, and deployed to production while remaining disabled. A subsequent configuration change releases it without rebuilding the container image or application package. Environment variables can hold simple flags, but updates commonly require a process restart or workload replacement. Runtime configuration services allow applications to refresh values independently of code deployments.

Prepare flag configuration as a versioned deployment input. Define names, types, safe defaults, allowed values, and ownership, and isolate configurations for each environment. Validate configuration before publishing it and restrict production changes through access controls and approval workflows. In AWS AppConfig, applications, environments, and configuration profiles organize configuration, while deployment strategies control its distribution. Feature flag configurations support validation of flag attributes through configured constraints.

Consider releasing a new recommendation engine first to internal users, then to a stable subset of customers. User targeting should use consistent assignment so that the same customer does not alternate unexpectedly between implementations. Distinguish targeted exposure from gradual configuration distribution: updating configuration across a fleet over time does not, by itself, mean exactly the same percentage of end users receives a feature. The evaluation rules and deployment strategy determine those different outcomes.

Applications should normally retrieve configuration through an appropriate SDK, agent, or extension and cache it locally rather than making a remote request for every flag evaluation. Define refresh intervals, startup behavior, and what happens when the configuration service is unavailable. A last-known-good value can preserve availability, while a conservative default may be safer for a risky new feature. Cached configuration also means a flag change is not necessarily instantaneous across all instances.

Monitor error rates, latency, and business outcomes during release. A flag can act as a kill switch, and a configuration deployment can be rolled back when monitoring detects problems. However, disabling a feature does not undo database writes, external transactions, or incompatible schema changes. Both code paths must remain compatible with shared data and dependent services until rollback is no longer required.

Feature flags are not authorization controls: hiding a button does not prevent a caller from invoking its backend API. Keep authorization checks on the server, and do not place secrets in client-visible flag payloads. Flags also do not automatically create a valid experiment; meaningful experiments require controlled assignment and reliable measurement. Finally, test relevant flag combinations and remove obsolete flags and unused code paths after release. Unmanaged flags increase branching complexity, operational risk, and maintenance cost.

Key aspects of Feature Flags

Effective feature flags combine independent release control with validated environment configuration, stable targeting, resilient evaluation, monitoring, and disciplined cleanup.

Deployment and release separation

Deploy code with new behavior disabled, then release it through a configuration change. This supports independent release timing without rebuilding the application artifact.

Environment-specific configuration

Promote the same artifact across environments while supplying separate flag values for development, testing, and production. Validate configuration types and constraints before deployment.

Targeted and progressive exposure

Enable behavior for selected users or stable cohorts before expanding access. Treat user targeting and gradual configuration distribution as separate mechanisms that must be coordinated.

Resilient runtime evaluation

Use local caching, appropriate refresh intervals, and explicitly defined fallback behavior. Account for stale values and configuration-service outages rather than assuming every evaluation sees the latest setting.

Observable and reversible releases

Track operational and business metrics while changing flags, and define when to disable behavior or roll back configuration. Remember that configuration rollback does not reverse persistent side effects.

Governance and lifecycle management

Assign owners, control configuration changes, and test relevant flag combinations. Remove temporary flags after rollout, and enforce authorization independently of feature visibility.

Cloud services for Feature Flags

AWS AppConfig manages flag configuration and its deployment separately from application code. AWS Lambda functions can consume that configuration through the AWS AppConfig Agent Lambda extension, while other workloads can use the agent or configuration APIs. Amazon CloudWatch supplies metrics and alarms to detect regressions and support automatic rollback of AppConfig deployments. AWS Systems Manager Parameter Store is useful for simpler environment-specific values, but applications must supply any targeting and rollout logic it lacks. Together, configuration management, runtime evaluation, and monitoring support controlled releases of the same application artifact across environments.

AWS AppConfig image AWS AppConfig

Provides managed feature flag configuration with applications, environments, configuration profiles, and controlled deployment strategies. Applications can retrieve values through the AWS AppConfig Agent or supported integrations, and configured Amazon CloudWatch alarms can trigger automatic configuration rollback.

Open AWS AppConfig →
AWS Systems Manager image AWS Systems Manager

Its Parameter Store capability can store environment-specific configuration values, including simple flags. Applications must implement retrieval, caching, evaluation, and rollout behavior; Parameter Store alone is not a feature-targeting engine.

Open AWS Systems Manager →
Amazon CloudWatch image Amazon CloudWatch

Provides metrics, logs, and alarms for detecting regressions during feature releases. AWS AppConfig can monitor configured CloudWatch alarms during configuration deployment and roll back when an alarm enters the ALARM state.

Open Amazon CloudWatch →
AWS Lambda image AWS Lambda

Functions can evaluate flags to select behavior without deploying a new function version for each flag change. The AWS AppConfig Agent Lambda extension retrieves and caches configuration locally, reducing repeated direct calls to the configuration service.

Open AWS Lambda →