AWS AppConfig là capability của AWS Systems Manager giúp:
AppConfig works với applications hosted on:
Application → Environment (dev, staging, prod)
→ Configuration Profile → Hosted/S3/SSM
→ Deployment Strategy
| Feature | AppConfig | Parameter Store | Secrets Manager |
|---|---|---|---|
| Feature flags | ✅ Built-in | ❌ Manual | ❌ |
| Gradual rollout | ✅ Deployment strategies | ❌ Instant | ❌ |
| Validation | ✅ JSON Schema / Lambda | ❌ | ❌ |
| Rollback | ✅ Automatic on errors | ❌ | ❌ |
| Caching | ✅ Client-side (extension) | ❌ | ❌ |
| Secrets | ❌ | ✅ | ✅ Encrypted all |
| Rotation | ❌ | ❌ | ✅ Automatic |
| Cost | Free (config hosting) | Free (standard tier) | Paid |
Retrieve Secrets Manager secrets khi using AWS services support references to Parameter Store parameters:
Use Parameter Store to reference Secrets Manager secrets:
Scenario: Use parameters từ Parameter Store trong Lambda functions without using SDK
Solution: Secrets Lambda Extension
import urllib.request
import json
def get_parameter():
# Extension runs on localhost:2773
url = 'http://localhost:2773/systemsmanager/parameters/get?name=/myapp/config'
response = urllib.request.urlopen(url)
return json.loads(response.read())
Lambda Extension for AppConfig:
import urllib.request
import json
def get_config():
# Extension runs on localhost:2772
url = 'http://localhost:2772/applications/MyApp/environments/prod/configurations/MyConfig'
response = urllib.request.urlopen(url)
return json.loads(response.read())
| Strategy | Mô tả |
|---|---|
| AllAtOnce | Deploy to all targets immediately |
| Linear | Deploy to % of targets every interval |
| Exponential | Double % of targets every interval |
{
"version": "1",
"flags": {
"new_checkout": {
"name": "New Checkout Flow",
"attributes": {
"enabled": {"constraints": {"type": "boolean"}}
}
}
},
"values": {
"new_checkout": {
"enabled": true
}
}
}
| Method | Service | Use Case |
|---|---|---|
| Direct SDK | Parameter Store, Secrets Manager | Full control, custom logic |
| Lambda Extension | Parameter Store, Secrets Manager | No SDK, caching, performance |
| AppConfig Extension | AppConfig | Feature flags, gradual rollout |
| CloudFormation | Parameter Store, Secrets Manager | IaC templates |
| Systems Manager | Parameter Store, AppConfig | Centralized management |
Exam Tip: