Skill 3.1.4
Manage environment-specific application configuration by using AWS services (for example, AWS AppConfig, AWS Systems Manager Parameter Store, AWS Secrets Manager, Amazon API Gateway, AWS Lambda).
Key Concepts
AWS AppConfig, part of Systems Manager, manages application configuration and feature flags separately from code. You define an application, environments (dev, test, prod) and configuration profiles, validate changes with a JSON Schema or a Lambda validator, and roll them out using a deployment strategy that releases gradually and rolls back automatically if a CloudWatch alarm fires.
Applications retrieve configuration through the AppConfig Data API (starting a session, then polling for the latest version), or through the AppConfig Lambda extension, which caches it locally. For simpler needs, Parameter Store paths per environment (such as /myapp/prod/), Lambda environment variables or CloudFormation parameters also work.
API Gateway stage variables can be referenced in integration URIs, for example a Lambda ARN ending in :${stageVariables.lambdaAlias}, so each stage calls a different alias of the same function. Stage variables are also passed to Lambda in the event (event.stageVariables) with proxy integrations. When a stage variable selects a Lambda alias, API Gateway needs permission to invoke each alias, which you grant with aws lambda add-permission.
Lambda environment variables, AppConfig configuration, Parameter Store values and CloudFormation parameters provide similar runtime switches for other services.