Intermediate LevelCloud Computing (AWS/GCP/Azure)
What is AWS CloudFormation Drift Detection and how do Custom Resources extend templates?
❓ Interview Prompt: Explain AWS CloudFormation templates, Drift Detection (out-of-band changes), and Lambda Custom Resources.
AWS CloudFormation provides declarative infrastructure provisioning using YAML/JSON templates.
Key Advanced Concepts:
1
Drift Detection: Identifies when resources managed by a CloudFormation stack have been modified out-of-band via AWS Console or CLI. Reports differences between template state and real-world resource properties.
2
Custom Resources: Allows templates to invoke custom Lambda functions during stack creation, update, or deletion. Used to provision third-party APIs (Datadog/Auth0) or unsupported AWS resources cleanly inside CloudFormation stacks!
Code Implementation Example
yaml
# CloudFormation Custom Resource invoking Lambda function
Resources:
MyCustomDatabaseSeed:
Type: Custom::DatabaseSeeder
Properties:
ServiceToken: !GetAtt SeedLambdaFunction.Arn
DatabaseName: "production_db"💡CloudFormation Custom Resource triggering a database seeder Lambda function.
🎯 Interview Key Takeaway
Drift Detection identifies unapproved out-of-band infrastructure modifications; Custom Resources trigger Lambda for custom stack logic.
#CloudFormation#Drift Detection#Custom Resources#IaC#Intermediate
Back to all Cloud Computing (AWS/GCP/Azure) Questions→