AWS Config for compliance - Time & Space Complexity
We want to understand how the time to check compliance using AWS Config changes as we add more resources.
Specifically, how does the number of compliance checks grow when the number of resources increases?
Analyze the time complexity of the following AWS Config rule evaluation process.
aws configservice put-config-rule --config-rule file://rule.json
aws configservice describe-compliance-by-config-rule --config-rule-name MyRule
aws configservice get-compliance-details-by-config-rule --config-rule-name MyRule
This sequence sets a compliance rule, then checks compliance status for all resources against that rule.
Identify the API calls, resource provisioning, data transfers that repeat.
- Primary operation: Compliance evaluation of each resource against the rule.
- How many times: Once per resource in the account.
As the number of resources grows, AWS Config must evaluate each resource against the compliance rule.
| Input Size (n) | Approx. Api Calls/Operations |
|---|---|
| 10 | 10 compliance evaluations |
| 100 | 100 compliance evaluations |
| 1000 | 1000 compliance evaluations |
Pattern observation: The number of compliance checks grows directly with the number of resources.
Time Complexity: O(n)
This means the time to check compliance grows in a straight line as you add more resources.
[X] Wrong: "Adding more resources won't affect compliance check time because AWS Config handles it instantly."
[OK] Correct: Each resource must be individually checked, so more resources mean more work and more time.
Understanding how compliance checks scale helps you design systems that stay efficient as they grow.
"What if we added multiple compliance rules instead of one? How would the time complexity change?"
Practice
Solution
Step 1: Understand AWS Config's role
AWS Config records configuration changes and evaluates compliance of AWS resources.Step 2: Compare with other options
Other options describe different AWS services like deployment, monitoring, or IAM, not AWS Config.Final Answer:
To track changes in AWS resource configurations and check compliance -> Option BQuick Check:
AWS Config = Compliance tracking [OK]
- Confusing AWS Config with deployment services
- Thinking AWS Config manages user permissions
- Mixing AWS Config with network monitoring tools
Solution
Step 1: Identify the component that records changes
The Configuration Recorder captures resource configuration changes in AWS Config.Step 2: Understand other components
Config Rules evaluate compliance, Delivery Channel sends data to storage, Compliance Packs group rules.Final Answer:
Configuration Recorder -> Option CQuick Check:
Recorder = records changes [OK]
- Confusing Delivery Channel with recording
- Thinking Config Rule records changes
- Mixing Compliance Pack with recording function
{
"ConfigRuleName": "s3-bucket-public-read-prohibited",
"Source": {
"Owner": "AWS",
"SourceIdentifier": "S3_BUCKET_PUBLIC_READ_PROHIBITED"
}
}Solution
Step 1: Analyze the SourceIdentifier
The SourceIdentifier "S3_BUCKET_PUBLIC_READ_PROHIBITED" indicates the rule checks for public read access on S3 buckets.Step 2: Match with options
Checks if S3 buckets allow public read access matches the rule's purpose; others relate to different bucket settings.Final Answer:
Checks if S3 buckets allow public read access -> Option AQuick Check:
Rule name = public read check [OK]
- Assuming it checks encryption or versioning
- Ignoring the SourceIdentifier meaning
- Confusing lifecycle policies with access controls
Solution
Step 1: Understand data flow in AWS Config
Configuration Recorder records changes; Delivery Channel sends data to S3 or SNS.Step 2: Identify cause of no data delivery
If no compliance data arrives, Delivery Channel is likely missing or misconfigured.Final Answer:
Delivery Channel is missing or misconfigured -> Option DQuick Check:
Delivery Channel = data delivery [OK]
- Assuming Recorder is off without checking
- Confusing Config Rules with data delivery
- Blaming IAM permissions unrelated to Config
Solution
Step 1: Identify enforcement method
A Config Rule can automatically check EC2 instances for required tags and report compliance.Step 2: Evaluate other options
Recorder only records data, Delivery Channel sends data but doesn't enforce, manual review is inefficient.Final Answer:
Create a Config Rule that checks EC2 instances for the required tag and alerts non-compliance -> Option AQuick Check:
Config Rule = automatic compliance check [OK]
- Thinking Recorder enforces compliance
- Confusing Delivery Channel with enforcement
- Relying on manual checks instead of automation
Ready to prove it?
Pass the test and this pattern moves unknown
