AWS AppConfig

A service that safely deploys application configuration with automated gradual rollout and rollback capabilities

Overview

AWS AppConfig is a configuration management service provided as a feature of AWS Systems Manager. It enables safe delivery of application configuration changes independently from code deployments, combining gradual rollout, automatic rollback, and pre-deployment validation to significantly reduce the risk of outages caused by configuration errors. It can deliver feature flags, operational parameters, and allow lists in real time to applications running on Lambda, ECS, EKS, and EC2, letting you control application behavior without redeployment.

Configuration Profiles and Deployment Strategies

AppConfig organizes resources in a three-tier hierarchy: applications, environments, and configuration profiles. An application represents a logical group (such as a microservice), an environment distinguishes deployment targets like production, staging, and development, and a configuration profile defines where the actual configuration data is stored - either an S3 bucket, SSM document, or SSM Parameter Store. Deployment strategies control the rollout speed of configuration changes, with three patterns available: Linear, Exponential, and AllAtOnce. Linear deployment is recommended for production environments; for example, configuring a 10% incremental rollout over 20 minutes limits the blast radius when anomalies are detected. If a CloudWatch alarm fires during deployment, automatic rollback executes immediately, reverting to the last known good configuration. This mechanism lets you manage configuration change risk with the same level of safety as code deployments.

Validators for Safe Configuration Verification

AppConfig validators verify configuration content before deployment, preventing invalid values from reaching your application. There are two types of validators: syntactic validators and Lambda validators. Syntactic validators use JSON Schema to declaratively verify data types, ranges, and required fields. For example, you can define a schema that ensures a timeout value is an integer between 1 and 300, or that a connection URL starts with https. Lambda validators enable advanced verification through custom logic, such as configuration consistency checks, connectivity tests with external systems, and business rule validation. If validation fails, the deployment never starts and an error is returned to the configuration author. You can combine multiple validators, and a pattern of applying syntactic checks followed by business logic checks is effective in practice. By automatically eliminating human error in configuration changes, operational reliability improves dramatically. For a deeper dive into configuration management and operational best practices, related books (Amazon) are a helpful resource.

Feature Flags and Runtime Integration

AppConfig's feature flag capability lets you toggle features on and off without code deployments. When you create a feature flag configuration profile, you can define attributes such as boolean values, strings, and numbers for each flag, and configure user segment or percentage-based targeting. At runtime, the AppConfig Agent retrieves configuration values. The Agent runs as a Lambda layer, ECS sidecar, or local HTTP endpoint, caching configuration values locally for fast retrieval. The default polling interval is 45 seconds, and when a configuration change is deployed, it takes effect at the next poll. Using the Agent, application code retrieves configuration through a simple HTTP GET, minimizing SDK dependencies. In Lambda environments, the AppConfig Lambda Extension is recommended - it fetches configuration during the function's initialization phase and caches it in memory, keeping the impact on cold starts minimal.

共有するXB!