AWS Config Rule Deployer
What this skill does
Provisions AWS Config rules with correct evaluation modes, resource
scopes, and remediation wiring. Runs deterministic pre-checks before any
state-changing CLI (is the configuration recorder running? does the
delivery channel exist? does the Lambda function exist for custom rules?
does the SSM Automation document exist for remediation? does the IAM
principal hold config:PutConfigRule?), emits the exact put-config-rule
/ put-conformance-pack / put-organization-config-rule CLI behind a
CONFIRM gate, and verifies compliance evaluation after apply. Every rule
plan surfaces the evaluation frequency (configuration-change triggered
vs periodic), the maximum evaluation frequency (1h/3h/6h/12h/24h), and
the remediation trigger model (automatic vs manual).
Quick navigation
| Section |
What it covers |
When to read it |
| § Quick reference |
Verdict thresholds + pre-check priority order |
Before any operation |
| § Mindset |
Why recorder status matters, evaluation modes, remediation triggers |
Understanding the model |
| § Pre-flight |
Recorder/delivery channel/IAM gate |
Before executing any CLI |
| § Process |
Per-operation planning: managed, custom, conformance, org, proactive |
When choosing which operation |
| § Common patterns |
Managed/custom/conformance/remediation boilerplate |
Boilerplate lookup |
| § Output format |
STRICT output contract with worked example |
Formatting the response |
| § NEVER |
Top 5 anti-patterns |
Review before deploy |
references/ |
Full NEVER list, stale compliance diagnostics, expert heuristics, all pattern examples |
Deep reference |
Quick reference — verdict thresholds
| Verdict |
Trigger condition |
Action |
PREREQUISITES_MISSING |
One or more pre-checks failed (recorder stopped, delivery channel missing, Lambda not found, SSM doc not found, IAM missing) |
List failures, do NOT execute |
READY_TO_DEPLOY |
All pre-checks passed; awaiting CONFIRM gate |
Emit exact CLI sequence, wait for operator yes |
Priority order for pre-checks (all must pass for READY_TO_DEPLOY):
- Configuration recorder —
recording = true, allSupported = true
(or scoped types).
- Delivery channel — valid S3 bucket exists and accepts Config data.
- Rule type validation — managed rule identifier exists; custom rule
has valid Lambda ARN.
- Resource scope — valid for the rule's evaluation type.
- Evaluation mode — config-change has valid resource types; periodic
has valid MaximumExecutionFrequency (1h/3h/6h/12h/24h).
- IAM permissions — caller holds
config:PutConfigRule and (for
custom rules) lambda:AddPermission.
- Lambda function policy — for custom rules,
config.amazonaws.com
can invoke the function.
- SSM document — for remediation, document exists in-region and
Config service role can assume it.
- Security Hub — if forwarding compliance, verify SH is enabled.
- Organization aggregator — for org rules, verify authorization.
Config rule limits (2026): max 150 rules/region/account (soft limit),
25 conformance packs/region, 150 org config rules/region. Template body
max 256 KB.
Mindset
A Config rule has one job — evaluate resource compliance and optionally
trigger remediation. When any link breaks, the rule silently reports stale
compliance. Three AWS Config realities drive the mindset:
- The configuration recorder is the foundation. If stopped or the
delivery channel is broken, ALL rules report stale compliance. #1 Config
blind spot: rules appear active but evaluate nothing.
- Config rules evaluate asynchronously. After
put-config-rule, the
rule does NOT evaluate immediately. Force with
start-config-rules-evaluation. Even then, 1-30 min lag.
- Remediation requires explicit opt-in. Adding an SSM Automation
document does NOT auto-remediate. Each non-compliant resource needs
start-remediation-execution (manual) or AutoRemediation = true.
Operators frequently deploy rules with remediation documents and assume
auto-remediation is active — it isn't.
Pre-flight: Config rule metadata gate
Run before classification. Live-account pre-flight:
aws configservice describe-configuration-recorders — confirm
status.recording = true. Capture recordingGroup.
aws configservice describe-delivery-channels — confirm valid S3 bucket.
aws configservice describe-config-rules --config-rule-names <name>
— confirm rule exists (or doesn't). Capture state, source, scope.
- For managed rules: verify
ManagedRuleIdentifier is valid.
- For custom rules:
aws lambda get-function — verify function + permission
for config.amazonaws.com.
- For remediation:
aws ssm describe-document — verify SSM doc exists.
- For org rules:
aws organizations describe-organization — verify
management account or delegated admin.
| Attribute |
Effect on operation |
| Recorder stopped |
ALL rules report stale compliance. PREREQUISITES_MISSING. |
| Delivery channel missing/bucket deleted |
Config cannot store data. PREREQUISITES_MISSING. |
ConfigRuleState: DELETING |
Wait for completion before recreating. |
| Lambda function not found |
Custom rule has nothing to invoke. PREREQUISITES_MISSING. |
| SSM document not found |
Remediation cannot execute. Reports compliance only. |
| Rule scope includes unsupported type |
Rule evaluates nothing — silent blind spot. |
Process — operation planning (apply in order)
Step 0: Expert knowledge — non-obvious AWS Config behaviors
Key behaviors that change a plan if ignored (full detail in references/):
- Recorder must be RUNNING. Stopped recorder = stale compliance for ALL
rules. Most common Config blind spot.
- PutConfigRule does NOT trigger immediate evaluation. Force with
start-config-rules-evaluation. Even forced, takes 1-30 min.
- Remediation is NOT automatic by default. Must set
Automatic: true
explicitly. Default is manual.
- MaximumExecutionFrequency applies to BOTH periodic AND config-change
rules (controls re-evaluation of unchanged resources for the latter).
- Conformance packs deploy via CloudFormation under the hood. Template
errors surface as CFN stack events, not Config API errors.
- Organization config rules deploy from management account only. Member
accounts cannot modify or delete org rules.
- Custom rules invoke Lambda synchronously. Lambda timeout > 60s or
errors →
EvaluationError. Keep functions < 10s and idempotent.
- Lambda permissions for Config are resource-based. Function needs a
permission statement allowing
config.amazonaws.com to invoke.
- Proactive rules use CloudFormation hooks — evaluate BEFORE resource
creation, preventing non-compliant deployments.
- Config API calls cost money. Each
put-config-rule and
start-config-rules-evaluation is billable. Large fleets (100+ rules,
frequent evaluations) can exceed $1,000/month. Conformance packs amplify.
- Config rule scope narrows evaluation. A scope of
resourceTypes: ["AWS::S3::Bucket"] evaluates only S3 buckets. Without
a scope, the rule evaluates ALL supported types — potentially exceeding
timeouts and Lambda cost for custom rules.
- Tag-based scope filters by tags.
tagKey: "Environment", tagValue: "prod" evaluates only resources tagged Environment=prod.
Useful for phased compliance rollouts.
- SSM Automation documents must be in the SAME region as the Config
rule. Cross-region remediation is not supported.
- Deletion is eventual.
delete-config-rule marks for deletion; rule
may take up to 6 hours to fully delete. During this window, the rule
continues to evaluate. ConfigRuleState shows DELETING.
Step 1: Pre-check gate — PREREQUISITES_MISSING if any check fails
Run ALL pre-checks. If ANY fails, verdict is PREREQUISITES_MISSING with
failed checks enumerated. Do NOT execute.
For ALL operations:
- Recorder exists and
status.recording = true.
- Delivery channel exists with valid S3 bucket.
- Rule name <= 128 chars, matches
^[a-zA-Z0-9-]+$.
- IAM principal holds
config:PutConfigRule (and
config:PutConformancePack or config:PutOrganizationConfigRule).
- Total rule count + new <= 150 per region.
For managed rule: ManagedRuleIdentifier exists in managed rules list.
Required input parameters provided.
For custom Lambda rule: Lambda ARN exists. Function has resource-based
permission for config.amazonaws.com. IAM role has config:PutEvaluations.
Timeout <= 60s.
For conformance pack: Template body valid YAML/JSON, <= 256 KB. All
referenced managed rules have valid identifiers. Total packs + new <= 25.
For organization config rule: Account is management account or
delegated admin. Aggregator authorized. Metadata complete.
For remediation: SSM Automation document exists in-region. Config
service-linked role has ssm:StartAutomationExecution. AutoRemediation
is an explicit choice, not the default.
Step 2: READY_TO_DEPLOY — emit deployment plan
If all pre-checks pass, emit VERDICT: READY_TO_DEPLOY with the exact CLI
sequence and CONFIRM gate. The plan includes: exact CLI command with all
flags populated, expected evaluation lag, expected compliance status, and
remediation behavior (automatic vs manual).
Step 3: Execute behind CONFIRM gate
- MANDATORY CONFIRMATION GATE before any state-changing CLI.
- Snapshot current rule config before modification.
- Execute the CLI.
- Force immediate evaluation:
aws configservice start-config-rules-evaluation --config-rule-names <name>.
Step 4: Post-verification
describe-config-rules returns expected rule configuration.
get-compliance-summary shows Compliant/NonCompliant counts (1-30 min).
- For custom rules:
describe-config-rule-evaluation-status shows
recent LastSuccessfulInvocationTime.
- For remediation:
describe-remediation-executions-status shows
remediation executions.
- For conformance packs:
describe-conformance-pack-compliance.
Common Config rule patterns (boilerplate)
Managed rule — S3 public read prohibited
aws configservice put-config-rule \
--config-rule '{
"ConfigRuleName": "s3-bucket-public-read-prohibited",
"Description": "Detects S3 buckets that allow public read access.",
"Source": {"Owner": "AWS", "SourceIdentifier": "S3_BUCKET_PUBLIC_READ_PROHIBITED"},
"Scope": {"ComplianceResourceTypes": ["AWS::S3::Bucket"]},
"ConfigRuleState": "ACTIVE"
}'
Managed rule with remediation (SSM Automation)
# 1. Create the rule
aws configservice put-config-rule \
--config-rule '{
"ConfigRuleName": "s3-bucket-public-read-prohibited",
"Source": {"Owner": "AWS", "SourceIdentifier": "S3_BUCKET_PUBLIC_READ_PROHIBITED"},
"Scope": {"ComplianceResourceTypes": ["AWS::S3::Bucket"]}
}'
# 2. Attach remediation (auto-remediate)
aws configservice put-remediation-configurations \
--remediation-configurations '[{
"ConfigRuleName": "s3-bucket-public-read-prohibited",
"TargetType": "SSM_DOCUMENT",
"TargetId": "AWS-DisableS3BucketPublicReadWrite",
"Automatic": true,
"MaximumAutomaticAttempts": 3,
"RetryAttemptSeconds": 600,
"Parameters": {"S3BucketName": {"ResourceValue": {"Value": "RESOURCE_ID"}}}
}]'
Custom Lambda rule — tag enforcement
aws configservice put-config-rule \
--config-rule '{
"ConfigRuleName": "ec2-required-tags",
"Description": "Ensures all EC2 instances have Environment, Owner, CostCenter tags.",
"Source": {
"Owner": "CUSTOM_LAMBDA",
"SourceIdentifier": "arn:aws:lambda:us-east-1:111111111111:function:config-rule-required-tags",
"SourceDetails": [{"EventSource": "aws.config", "MessageType": "ConfigurationItemChangeNotification"}]
},
"Scope": {"ComplianceResourceTypes": ["AWS::EC2::Instance"]},
"InputParameters": "{\"requiredTags\": \"Environment,Owner,CostCenter\"}",
"ConfigRuleState": "ACTIVE"
}'
# Lambda permission for Config invocation (REQUIRED)
aws lambda add-permission \
--function-name config-rule-required-tags \
--statement-id AllowConfigToInvoke \
--action lambda:InvokeFunction \
--principal config.amazonaws.com \
--source-account 111111111111
Conformance pack — CIS AWS Foundations Benchmark
aws configservice put-conformance-pack \
--conformance-pack-name "cis-aws-foundations-benchmark" \
--template-body '
Resources:
IamNoInlinePolicyRule:
Type: AWS::Config::ConfigRule
Properties:
ConfigRuleName: iam-no-inline-policy
Source: {Owner: AWS, SourceIdentifier: IAM_NO_INLINE_POLICY_CHECK}
Scope: {ComplianceResourceTypes: ["AWS::IAM::User"]}
RootMfaEnabledRule:
Type: AWS::Config::ConfigRule
Properties:
ConfigRuleName: root-mfa-enabled
Source: {Owner: AWS, SourceIdentifier: ROOT_ACCOUNT_MFA_ENABLED}
MaximumExecutionFrequency: One_Hour
'
Periodic rule — evaluate every 6 hours
aws configservice put-config-rule \
--config-rule '{
"ConfigRuleName": "iam-password-policy-check",
"Description": "Checks the account password policy meets minimum requirements.",
"Source": {"Owner": "AWS", "SourceIdentifier": "IAM_PASSWORD_POLICY"},
"MaximumExecutionFrequency": "Six_Hours",
"ConfigRuleState": "ACTIVE"
}'
Account-level rules (not scoped to a resource type) MUST be periodic
because there is no resource change to trigger evaluation.
Organization config rule — org-wide managed rule
aws configservice put-organization-config-rule \
--organization-config-rule '{
"OrganizationConfigRuleName": "org-s3-public-read-prohibited",
"OrganizationManagedRuleMetadata": {
"Description": "Org-wide: no S3 buckets with public read access.",
"RuleIdentifier": "S3_BUCKET_PUBLIC_READ_PROHIBITED",
"ResourceTypesScope": ["AWS::S3::Bucket"]
},
"ExcludedAccounts": []
}'
Must be deployed from the management account or delegated admin. Member
accounts cannot modify or delete org rules.
Additional pattern (proactive rule via CloudFormation hooks) in
references/config-rule-catalog.md.
STRICT output contract
Required output structure
Every response MUST begin with this block — no preamble, no conversational
opening:
RULE: <rule-name>
VERDICT: READY_TO_DEPLOY | PREREQUISITES_MISSING
TARGET: <rule-name>
PRE_CHECKS:
- [PASS] <check description>
- [FAIL] <check description> — <reason>
STEPS:
1. CONFIRM: About to <operation> on Config rule <name> in account <account> region <region>. This will <consequence>. Proceed? (yes/no)
2. <exact CLI command with every flag populated — no placeholders>
POST_VERIFY:
- [PASS] <verification description>
- [FAIL] <verification description> — <reason>
EVALUATION: <configuration-change:1-30min | periodic:Next_MaxFreq | pending>
COMPLIANCE: <Compliant:N / NonCompliant:N / pending — first evaluation not complete>
REMEDIATION: <none | manual:SSM-doc | auto:SSM-doc>
NOTES: <evaluation mode rationale, remediation trigger model, recorder status caveat>
FORBIDDEN output patterns
- NEVER start with conversational preamble — the VERDICT block is the
FIRST line, always.
- NEVER use lowercase verdict values — emit
READY_TO_DEPLOY or
PREREQUISITES_MISSING.
- NEVER omit PRE_CHECKS — every pre-check must appear with
[PASS] or
[FAIL] and a specific reason for each failure.
- NEVER deploy a rule without verifying the configuration recorder is
RUNNING. A rule on a stopped recorder reports stale compliance.
- NEVER emit a CLI command with placeholder flags in a READY_TO_DEPLOY
plan — every field must be populated with actual values.
- NEVER omit the CONFIRM gate as the first STEPS entry.
- NEVER claim auto-remediation is active when
Automatic is not explicitly
true. The default is manual.
- NEVER deploy a custom Lambda rule without verifying the Lambda permission
for
config.amazonaws.com exists.
Perfect example output
RULE: s3-bucket-public-read-prohibited
VERDICT: READY_TO_DEPLOY
TARGET: s3-bucket-public-read-prohibited
PRE_CHECKS:
- [PASS] Configuration recorder active (recording = true, allSupported = true)
- [PASS] Delivery channel configured (S3 bucket: config-bucket-111111111111)
- [PASS] ManagedRuleIdentifier S3_BUCKET_PUBLIC_READ_PROHIBITED valid
- [PASS] Scope AWS::S3::Bucket is a supported resource type
- [PASS] Rule is configuration-change triggered (no MaximumExecutionFrequency needed)
- [PASS] IAM principal holds config:PutConfigRule
- [PASS] Rule count 12 + 1 = 13 <= 150 limit
STEPS:
1. CONFIRM: About to put-config-rule s3-bucket-public-read-prohibited in account 111111111111 region us-east-1. This will CREATE a new Config rule that detects S3 buckets allowing public read access. First evaluation in 1-30 min. Proceed? (yes/no)
2. aws configservice put-config-rule --config-rule '{"ConfigRuleName":"s3-bucket-public-read-prohibited","Description":"Detects S3 buckets that allow public read access","Source":{"Owner":"AWS","SourceIdentifier":"S3_BUCKET_PUBLIC_READ_PROHIBITED"},"Scope":{"ComplianceResourceTypes":["AWS::S3::Bucket"]},"ConfigRuleState":"ACTIVE"}'
POST_VERIFY:
- (pending execution)
- describe-config-rules returns the rule with ConfigRuleState ACTIVE
- get-compliance-summary shows Compliant:42 / NonCompliant:0 (after first evaluation, ~5 min)
EVALUATION: configuration-change:1-30min (will force via start-config-rules-evaluation)
COMPLIANCE: pending — first evaluation not complete
REMEDIATION: none (compliance reporting only)
NOTES:
- Evaluation mode: configuration-change triggered. Evaluates on S3 bucket
creation/update/delete. MaximumExecutionFrequency controls periodic
re-evaluation of unchanged resources (default 24h).
- To force immediate evaluation:
aws configservice start-config-rules-evaluation --config-rule-names s3-bucket-public-read-prohibited
- Consider attaching remediation (AWS-DisableS3BucketPublicReadWrite).
NEVER (top 5 — full list of 15 anti-patterns in references)
- NEVER deploy a Config rule without first verifying the configuration
recorder is running. A stopped recorder means ALL rules report stale
compliance — the rule appears active but evaluates nothing.
- NEVER assume
put-config-rule triggers immediate evaluation. Always run
start-config-rules-evaluation after creating a rule.
- NEVER assume remediation is automatic. Adding an SSM Automation document
does NOT auto-remediate unless
Automatic: true is explicitly set.
- NEVER deploy a custom Lambda rule without verifying the Lambda
resource-based permission for
config.amazonaws.com. Without it, Config
silently fails to invoke the function.
- NEVER use periodic evaluation for security-critical rules when
configuration-change evaluation is available. Periodic can take up to 24h;
configuration-change evaluates within minutes.
Expert heuristic: stale compliance vs real compliance
A Config rule showing "Compliant" means the rule's most recent evaluation
found resources compliant — which may be hours, days, or weeks ago if the
recorder is stopped or the rule hasn't evaluated recently.
Diagnostic steps:
describe-configuration-recorder-status — if recording: false, start it.
describe-config-rule-evaluation-status — check LastSuccessfulInvocationTime.
- Force evaluation:
start-config-rules-evaluation --config-rule-names <name>.
- Wait 1-30 minutes, then re-check compliance.
Full diagnostic decision tree and per-rule-type staleness indicators in
references/config-rule-catalog.md.
ALWAYS pair Config rule deployment with a recorder status check. A
correctly configured rule on a stopped recorder is a false sense of
security.
Pre-flight safety checks (run before any provisioning CLI)
- MANDATORY CONFIRMATION GATE before any state-changing operation.
- PutConfigRule overwrites the entire rule. Snapshot before modification:
aws configservice describe-config-rules --config-rule-names <name> --output json > /tmp/<name>-backup-$(date +%s).json
- For custom Lambda rules: verify resource-based policy includes
config.amazonaws.com permission. #1 cause of custom rule errors.
- For remediation: verify SSM document exists in-region AND Config
service-linked role has
ssm:StartAutomationExecution.
- For conformance packs: validate template YAML before deployment.
- Prefer configuration-change over periodic for security-critical checks.
Recent AWS features (2024-2026)
- Proactive Config rules (2024-2025): evaluate CloudFormation templates
BEFORE resource creation via CloudFormation hooks. Shifts from detective
to preventive compliance.
- Conformance pack templates from Git repositories (2024): deploy from
GitHub/CodeCommit without uploading template bodies. Enables
version-controlled compliance-as-code.
- Organization conformance packs (2024-2025): deploy across an entire
org from the management account with a single API call.
- Config rule coverage for 300+ resource types (2025): expanded support
including AppRunner, Cedar policies, Bedrock guardrails.
- Security Hub automated response (2025): trigger SSM Automation
directly from Config findings without custom Lambda. Reduces remediation
latency from minutes to seconds.
- Config data export to S3 with Parquet (2024): configuration snapshots
and compliance history in Parquet for Athena querying.
- Resource aggregation across regions (2024-2025): improved multi-region
aggregation with lower latency.
AWS documentation
Domain
AWS CloudOps / Config Rule Provisioning, Compliance Automation & Governance.
1---2name: config-rule-deployer3description: 'Provisions AWS Config rules with compliance coverage: managed rules (100+ AWS-managed like s3-bucket-public-read-prohibited, iam-user-no-policies), custom Lambda rules, rule scope, evaluation mode (config-change vs periodic), compliance reporting, Security Hub integration, SSM Automation remediation, conformance packs (bulk deployment), organization config rules (org-wide), configuration recorder and delivery channel setup, and proactive rules (evaluate before deployment via CloudFormation hooks). Runs pre-checks (recorder status, delivery channel, IAM, Lambda function existence, SSM document existence), emits put-config-rule / put-conformance-pack / put-organization-config-rule CLI behind CONFIRM gate, verifies compliance evaluation. Emits READY_TO_DEPLOY | PREREQUISITES_MISSING. Use for security baselines (CIS, PCI-DSS), tagging enforcement, drift detection, or automated remediation.'4license: Apache-2.05compatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline plan classification. Live-account operations use aws configservice put-config-rule, put-conformance-pack, put-organization-config-rule, describe-config-rules, describe-configuration-recorders, describe-delivery-channels, start-config-rules-evaluation, get-compliance-summary (AWS CLI v2, SSO or key-based credentials).6metadata:7 source: https://skillmd.com/skills/jhkchan/config-rule-deployer8 domain: aws-cloudops9 complexity: high10 requires_llm: 'true'11 phase: '1'12 supports_pipeline: 'true'13 entry_point: 'false'14 family: Governance15 task_type: deploy16 skill_class: capability17 lifecycle_status: active18 verdict_shape: READY_TO_DEPLOY | PREREQUISITES_MISSING19 version: 0.1.020 author: Jacky Chan — AWS Community Builder21 tags: aws-config, compliance, governance, deploy, config-rules, conformance-packs, remediation22 dependencies: aws-orchestrator23 keywords: AWS Config, config rules, managed rules, custom rules, Lambda evaluation, conformance packs, organization config rules, compliance, remediation, SSM Automation, Security Hub, configuration recorder, delivery channel, proactive rules, CloudFormation hooks, drift detection, CIS benchmark, PCI-DSS, tagging enforcement, put-config-rule, put-conformance-pack24 when_to_use: Creating AWS Config rules (managed, custom Lambda, organization-wide), deploying conformance packs for bulk compliance baselines (CIS, PCI-DSS, NIST), configuring SSM Automation remediation, integrating Config with Security Hub, setting up the configuration recorder and delivery channel, deploying proactive rules for CloudFormation pre-deployment evaluation, or auditing existing Config rule compliance coverage.25 activation_triggers: create config rule, deploy config rule, managed config rule, custom config rule, Lambda config rule, conformance pack, organization config rule, org config rule, config rule remediation, SSM Automation remediation, Security Hub integration, configuration recorder, delivery channel, proactive config rule, CloudFormation hooks, CIS benchmark config, PCI-DSS config rules, tagging enforcement rule, config compliance, put-config-rule26 invocation_schema: 'Input: either (a) a rule deployment intent (create managed, create custom, deploy conformance pack, deploy org rule) with target rule name, managed rule identifier or Lambda function ARN, resource scope, evaluation mode, and optional remediation, OR (b) a rule name for live-account update or compliance validation. Output: deterministic RULE/VERDICT/PRE_CHECKS/STEPS/POST_VERIFY block per operation, where VERDICT is one of READY_TO_DEPLOY, PREREQUISITES_MISSING.'27---2829# AWS Config Rule Deployer3031## What this skill does3233Provisions AWS Config rules with correct evaluation modes, resource34scopes, and remediation wiring. Runs deterministic pre-checks before any35state-changing CLI (is the configuration recorder running? does the36delivery channel exist? does the Lambda function exist for custom rules?37does the SSM Automation document exist for remediation? does the IAM38principal hold `config:PutConfigRule`?), emits the exact `put-config-rule`39/ `put-conformance-pack` / `put-organization-config-rule` CLI behind a40CONFIRM gate, and verifies compliance evaluation after apply. Every rule41plan surfaces the evaluation frequency (configuration-change triggered42vs periodic), the maximum evaluation frequency (1h/3h/6h/12h/24h), and43the remediation trigger model (automatic vs manual).4445## Quick navigation4647| Section | What it covers | When to read it |48|---|---|---|49| **§ Quick reference** | Verdict thresholds + pre-check priority order | Before any operation |50| **§ Mindset** | Why recorder status matters, evaluation modes, remediation triggers | Understanding the model |51| **§ Pre-flight** | Recorder/delivery channel/IAM gate | Before executing any CLI |52| **§ Process** | Per-operation planning: managed, custom, conformance, org, proactive | When choosing which operation |53| **§ Common patterns** | Managed/custom/conformance/remediation boilerplate | Boilerplate lookup |54| **§ Output format** | STRICT output contract with worked example | Formatting the response |55| **§ NEVER** | Top 5 anti-patterns | Review before deploy |56| `references/` | Full NEVER list, stale compliance diagnostics, expert heuristics, all pattern examples | Deep reference |5758## Quick reference — verdict thresholds5960| Verdict | Trigger condition | Action |61|---|---|---|62| `PREREQUISITES_MISSING` | One or more pre-checks failed (recorder stopped, delivery channel missing, Lambda not found, SSM doc not found, IAM missing) | List failures, do NOT execute |63| `READY_TO_DEPLOY` | All pre-checks passed; awaiting CONFIRM gate | Emit exact CLI sequence, wait for operator yes |6465**Priority order for pre-checks (all must pass for READY_TO_DEPLOY):**66671. **Configuration recorder** — `recording = true`, `allSupported = true`68 (or scoped types).692. **Delivery channel** — valid S3 bucket exists and accepts Config data.703. **Rule type validation** — managed rule identifier exists; custom rule71 has valid Lambda ARN.724. **Resource scope** — valid for the rule's evaluation type.735. **Evaluation mode** — config-change has valid resource types; periodic74 has valid MaximumExecutionFrequency (1h/3h/6h/12h/24h).756. **IAM permissions** — caller holds `config:PutConfigRule` and (for76 custom rules) `lambda:AddPermission`.777. **Lambda function policy** — for custom rules, `config.amazonaws.com`78 can invoke the function.798. **SSM document** — for remediation, document exists in-region and80 Config service role can assume it.819. **Security Hub** — if forwarding compliance, verify SH is enabled.8210. **Organization aggregator** — for org rules, verify authorization.8384**Config rule limits (2026):** max 150 rules/region/account (soft limit),8525 conformance packs/region, 150 org config rules/region. Template body86max 256 KB.8788## Mindset8990A Config rule has one job — evaluate resource compliance and optionally91trigger remediation. When any link breaks, the rule silently reports stale92compliance. Three AWS Config realities drive the mindset:9394- **The configuration recorder is the foundation.** If stopped or the95 delivery channel is broken, ALL rules report stale compliance. #1 Config96 blind spot: rules appear active but evaluate nothing.97- **Config rules evaluate asynchronously.** After `put-config-rule`, the98 rule does NOT evaluate immediately. Force with99 `start-config-rules-evaluation`. Even then, 1-30 min lag.100- **Remediation requires explicit opt-in.** Adding an SSM Automation101 document does NOT auto-remediate. Each non-compliant resource needs102 `start-remediation-execution` (manual) or `AutoRemediation = true`.103 Operators frequently deploy rules with remediation documents and assume104 auto-remediation is active — it isn't.105106## Pre-flight: Config rule metadata gate107108Run before classification. **Live-account pre-flight:**1091101. `aws configservice describe-configuration-recorders` — confirm111 `status.recording = true`. Capture `recordingGroup`.1122. `aws configservice describe-delivery-channels` — confirm valid S3 bucket.1133. `aws configservice describe-config-rules --config-rule-names <name>`114 — confirm rule exists (or doesn't). Capture state, source, scope.1154. For managed rules: verify `ManagedRuleIdentifier` is valid.1165. For custom rules: `aws lambda get-function` — verify function + permission117 for `config.amazonaws.com`.1186. For remediation: `aws ssm describe-document` — verify SSM doc exists.1197. For org rules: `aws organizations describe-organization` — verify120 management account or delegated admin.121122| Attribute | Effect on operation |123|---|---|124| Recorder stopped | ALL rules report stale compliance. PREREQUISITES_MISSING. |125| Delivery channel missing/bucket deleted | Config cannot store data. PREREQUISITES_MISSING. |126| `ConfigRuleState: DELETING` | Wait for completion before recreating. |127| Lambda function not found | Custom rule has nothing to invoke. PREREQUISITES_MISSING. |128| SSM document not found | Remediation cannot execute. Reports compliance only. |129| Rule scope includes unsupported type | Rule evaluates nothing — silent blind spot. |130131## Process — operation planning (apply in order)132133### Step 0: Expert knowledge — non-obvious AWS Config behaviors134135Key behaviors that change a plan if ignored (full detail in `references/`):136137- **Recorder must be RUNNING.** Stopped recorder = stale compliance for ALL138 rules. Most common Config blind spot.139- **PutConfigRule does NOT trigger immediate evaluation.** Force with140 `start-config-rules-evaluation`. Even forced, takes 1-30 min.141- **Remediation is NOT automatic by default.** Must set `Automatic: true`142 explicitly. Default is manual.143- **MaximumExecutionFrequency applies to BOTH periodic AND config-change144 rules** (controls re-evaluation of unchanged resources for the latter).145- **Conformance packs deploy via CloudFormation under the hood.** Template146 errors surface as CFN stack events, not Config API errors.147- **Organization config rules deploy from management account only.** Member148 accounts cannot modify or delete org rules.149- **Custom rules invoke Lambda synchronously.** Lambda timeout > 60s or150 errors → `EvaluationError`. Keep functions < 10s and idempotent.151- **Lambda permissions for Config are resource-based.** Function needs a152 permission statement allowing `config.amazonaws.com` to invoke.153- **Proactive rules use CloudFormation hooks** — evaluate BEFORE resource154 creation, preventing non-compliant deployments.155- **Config API calls cost money.** Each `put-config-rule` and156 `start-config-rules-evaluation` is billable. Large fleets (100+ rules,157 frequent evaluations) can exceed $1,000/month. Conformance packs amplify.158- **Config rule scope narrows evaluation.** A scope of159 `resourceTypes: ["AWS::S3::Bucket"]` evaluates only S3 buckets. Without160 a scope, the rule evaluates ALL supported types — potentially exceeding161 timeouts and Lambda cost for custom rules.162- **Tag-based scope filters by tags.** `tagKey: "Environment",163 tagValue: "prod"` evaluates only resources tagged `Environment=prod`.164 Useful for phased compliance rollouts.165- **SSM Automation documents must be in the SAME region** as the Config166 rule. Cross-region remediation is not supported.167- **Deletion is eventual.** `delete-config-rule` marks for deletion; rule168 may take up to 6 hours to fully delete. During this window, the rule169 continues to evaluate. `ConfigRuleState` shows `DELETING`.170171### Step 1: Pre-check gate — PREREQUISITES_MISSING if any check fails172173Run ALL pre-checks. If ANY fails, verdict is PREREQUISITES_MISSING with174failed checks enumerated. Do NOT execute.175176**For ALL operations:**1771. Recorder exists and `status.recording = true`.1782. Delivery channel exists with valid S3 bucket.1793. Rule name <= 128 chars, matches `^[a-zA-Z0-9-]+$`.1804. IAM principal holds `config:PutConfigRule` (and181 `config:PutConformancePack` or `config:PutOrganizationConfigRule`).1825. Total rule count + new <= 150 per region.183184**For managed rule:** `ManagedRuleIdentifier` exists in managed rules list.185Required input parameters provided.186187**For custom Lambda rule:** Lambda ARN exists. Function has resource-based188permission for `config.amazonaws.com`. IAM role has `config:PutEvaluations`.189Timeout <= 60s.190191**For conformance pack:** Template body valid YAML/JSON, <= 256 KB. All192referenced managed rules have valid identifiers. Total packs + new <= 25.193194**For organization config rule:** Account is management account or195delegated admin. Aggregator authorized. Metadata complete.196197**For remediation:** SSM Automation document exists in-region. Config198service-linked role has `ssm:StartAutomationExecution`. `AutoRemediation`199is an explicit choice, not the default.200201### Step 2: READY_TO_DEPLOY — emit deployment plan202203If all pre-checks pass, emit `VERDICT: READY_TO_DEPLOY` with the exact CLI204sequence and CONFIRM gate. The plan includes: exact CLI command with all205flags populated, expected evaluation lag, expected compliance status, and206remediation behavior (automatic vs manual).207208### Step 3: Execute behind CONFIRM gate209210- **MANDATORY CONFIRMATION GATE** before any state-changing CLI.211- Snapshot current rule config before modification.212- Execute the CLI.213- Force immediate evaluation:214 `aws configservice start-config-rules-evaluation --config-rule-names <name>`.215216### Step 4: Post-verification2172181. `describe-config-rules` returns expected rule configuration.2192. `get-compliance-summary` shows Compliant/NonCompliant counts (1-30 min).2203. For custom rules: `describe-config-rule-evaluation-status` shows221 recent `LastSuccessfulInvocationTime`.2224. For remediation: `describe-remediation-executions-status` shows223 remediation executions.2245. For conformance packs: `describe-conformance-pack-compliance`.225226## Common Config rule patterns (boilerplate)227228### Managed rule — S3 public read prohibited229230```bash231aws configservice put-config-rule \232 --config-rule '{233 "ConfigRuleName": "s3-bucket-public-read-prohibited",234 "Description": "Detects S3 buckets that allow public read access.",235 "Source": {"Owner": "AWS", "SourceIdentifier": "S3_BUCKET_PUBLIC_READ_PROHIBITED"},236 "Scope": {"ComplianceResourceTypes": ["AWS::S3::Bucket"]},237 "ConfigRuleState": "ACTIVE"238 }'239```240241### Managed rule with remediation (SSM Automation)242243```bash244# 1. Create the rule245aws configservice put-config-rule \246 --config-rule '{247 "ConfigRuleName": "s3-bucket-public-read-prohibited",248 "Source": {"Owner": "AWS", "SourceIdentifier": "S3_BUCKET_PUBLIC_READ_PROHIBITED"},249 "Scope": {"ComplianceResourceTypes": ["AWS::S3::Bucket"]}250 }'251252# 2. Attach remediation (auto-remediate)253aws configservice put-remediation-configurations \254 --remediation-configurations '[{255 "ConfigRuleName": "s3-bucket-public-read-prohibited",256 "TargetType": "SSM_DOCUMENT",257 "TargetId": "AWS-DisableS3BucketPublicReadWrite",258 "Automatic": true,259 "MaximumAutomaticAttempts": 3,260 "RetryAttemptSeconds": 600,261 "Parameters": {"S3BucketName": {"ResourceValue": {"Value": "RESOURCE_ID"}}}262 }]'263```264265### Custom Lambda rule — tag enforcement266267```bash268aws configservice put-config-rule \269 --config-rule '{270 "ConfigRuleName": "ec2-required-tags",271 "Description": "Ensures all EC2 instances have Environment, Owner, CostCenter tags.",272 "Source": {273 "Owner": "CUSTOM_LAMBDA",274 "SourceIdentifier": "arn:aws:lambda:us-east-1:111111111111:function:config-rule-required-tags",275 "SourceDetails": [{"EventSource": "aws.config", "MessageType": "ConfigurationItemChangeNotification"}]276 },277 "Scope": {"ComplianceResourceTypes": ["AWS::EC2::Instance"]},278 "InputParameters": "{\"requiredTags\": \"Environment,Owner,CostCenter\"}",279 "ConfigRuleState": "ACTIVE"280 }'281282# Lambda permission for Config invocation (REQUIRED)283aws lambda add-permission \284 --function-name config-rule-required-tags \285 --statement-id AllowConfigToInvoke \286 --action lambda:InvokeFunction \287 --principal config.amazonaws.com \288 --source-account 111111111111289```290291### Conformance pack — CIS AWS Foundations Benchmark292293```bash294aws configservice put-conformance-pack \295 --conformance-pack-name "cis-aws-foundations-benchmark" \296 --template-body '297Resources:298 IamNoInlinePolicyRule:299 Type: AWS::Config::ConfigRule300 Properties:301 ConfigRuleName: iam-no-inline-policy302 Source: {Owner: AWS, SourceIdentifier: IAM_NO_INLINE_POLICY_CHECK}303 Scope: {ComplianceResourceTypes: ["AWS::IAM::User"]}304 RootMfaEnabledRule:305 Type: AWS::Config::ConfigRule306 Properties:307 ConfigRuleName: root-mfa-enabled308 Source: {Owner: AWS, SourceIdentifier: ROOT_ACCOUNT_MFA_ENABLED}309 MaximumExecutionFrequency: One_Hour310'311```312313### Periodic rule — evaluate every 6 hours314315```bash316aws configservice put-config-rule \317 --config-rule '{318 "ConfigRuleName": "iam-password-policy-check",319 "Description": "Checks the account password policy meets minimum requirements.",320 "Source": {"Owner": "AWS", "SourceIdentifier": "IAM_PASSWORD_POLICY"},321 "MaximumExecutionFrequency": "Six_Hours",322 "ConfigRuleState": "ACTIVE"323 }'324```325326Account-level rules (not scoped to a resource type) MUST be periodic327because there is no resource change to trigger evaluation.328329### Organization config rule — org-wide managed rule330331```bash332aws configservice put-organization-config-rule \333 --organization-config-rule '{334 "OrganizationConfigRuleName": "org-s3-public-read-prohibited",335 "OrganizationManagedRuleMetadata": {336 "Description": "Org-wide: no S3 buckets with public read access.",337 "RuleIdentifier": "S3_BUCKET_PUBLIC_READ_PROHIBITED",338 "ResourceTypesScope": ["AWS::S3::Bucket"]339 },340 "ExcludedAccounts": []341 }'342```343344Must be deployed from the management account or delegated admin. Member345accounts cannot modify or delete org rules.346347Additional pattern (proactive rule via CloudFormation hooks) in348`references/config-rule-catalog.md`.349350## STRICT output contract351352### Required output structure353354Every response MUST begin with this block — no preamble, no conversational355opening:356357```text358RULE: <rule-name>359VERDICT: READY_TO_DEPLOY | PREREQUISITES_MISSING360TARGET: <rule-name>361PRE_CHECKS:362 - [PASS] <check description>363 - [FAIL] <check description> — <reason>364STEPS:365 1. CONFIRM: About to <operation> on Config rule <name> in account <account> region <region>. This will <consequence>. Proceed? (yes/no)366 2. <exact CLI command with every flag populated — no placeholders>367POST_VERIFY:368 - [PASS] <verification description>369 - [FAIL] <verification description> — <reason>370EVALUATION: <configuration-change:1-30min | periodic:Next_MaxFreq | pending>371COMPLIANCE: <Compliant:N / NonCompliant:N / pending — first evaluation not complete>372REMEDIATION: <none | manual:SSM-doc | auto:SSM-doc>373NOTES: <evaluation mode rationale, remediation trigger model, recorder status caveat>374```375376### FORBIDDEN output patterns377378- NEVER start with conversational preamble — the VERDICT block is the379 FIRST line, always.380- NEVER use lowercase verdict values — emit `READY_TO_DEPLOY` or381 `PREREQUISITES_MISSING`.382- NEVER omit PRE_CHECKS — every pre-check must appear with `[PASS]` or383 `[FAIL]` and a specific reason for each failure.384- NEVER deploy a rule without verifying the configuration recorder is385 RUNNING. A rule on a stopped recorder reports stale compliance.386- NEVER emit a CLI command with placeholder flags in a READY_TO_DEPLOY387 plan — every field must be populated with actual values.388- NEVER omit the CONFIRM gate as the first STEPS entry.389- NEVER claim auto-remediation is active when `Automatic` is not explicitly390 `true`. The default is manual.391- NEVER deploy a custom Lambda rule without verifying the Lambda permission392 for `config.amazonaws.com` exists.393394### Perfect example output395396```text397RULE: s3-bucket-public-read-prohibited398VERDICT: READY_TO_DEPLOY399TARGET: s3-bucket-public-read-prohibited400PRE_CHECKS:401 - [PASS] Configuration recorder active (recording = true, allSupported = true)402 - [PASS] Delivery channel configured (S3 bucket: config-bucket-111111111111)403 - [PASS] ManagedRuleIdentifier S3_BUCKET_PUBLIC_READ_PROHIBITED valid404 - [PASS] Scope AWS::S3::Bucket is a supported resource type405 - [PASS] Rule is configuration-change triggered (no MaximumExecutionFrequency needed)406 - [PASS] IAM principal holds config:PutConfigRule407 - [PASS] Rule count 12 + 1 = 13 <= 150 limit408STEPS:409 1. CONFIRM: About to put-config-rule s3-bucket-public-read-prohibited in account 111111111111 region us-east-1. This will CREATE a new Config rule that detects S3 buckets allowing public read access. First evaluation in 1-30 min. Proceed? (yes/no)410 2. aws configservice put-config-rule --config-rule '{"ConfigRuleName":"s3-bucket-public-read-prohibited","Description":"Detects S3 buckets that allow public read access","Source":{"Owner":"AWS","SourceIdentifier":"S3_BUCKET_PUBLIC_READ_PROHIBITED"},"Scope":{"ComplianceResourceTypes":["AWS::S3::Bucket"]},"ConfigRuleState":"ACTIVE"}'411POST_VERIFY:412 - (pending execution)413 - describe-config-rules returns the rule with ConfigRuleState ACTIVE414 - get-compliance-summary shows Compliant:42 / NonCompliant:0 (after first evaluation, ~5 min)415EVALUATION: configuration-change:1-30min (will force via start-config-rules-evaluation)416COMPLIANCE: pending — first evaluation not complete417REMEDIATION: none (compliance reporting only)418NOTES:419 - Evaluation mode: configuration-change triggered. Evaluates on S3 bucket420 creation/update/delete. MaximumExecutionFrequency controls periodic421 re-evaluation of unchanged resources (default 24h).422 - To force immediate evaluation:423 aws configservice start-config-rules-evaluation --config-rule-names s3-bucket-public-read-prohibited424 - Consider attaching remediation (AWS-DisableS3BucketPublicReadWrite).425```426427## NEVER (top 5 — full list of 15 anti-patterns in references)428429- NEVER deploy a Config rule without first verifying the configuration430 recorder is running. A stopped recorder means ALL rules report stale431 compliance — the rule appears active but evaluates nothing.432- NEVER assume `put-config-rule` triggers immediate evaluation. Always run433 `start-config-rules-evaluation` after creating a rule.434- NEVER assume remediation is automatic. Adding an SSM Automation document435 does NOT auto-remediate unless `Automatic: true` is explicitly set.436- NEVER deploy a custom Lambda rule without verifying the Lambda437 resource-based permission for `config.amazonaws.com`. Without it, Config438 silently fails to invoke the function.439- NEVER use periodic evaluation for security-critical rules when440 configuration-change evaluation is available. Periodic can take up to 24h;441 configuration-change evaluates within minutes.442443## Expert heuristic: stale compliance vs real compliance444445A Config rule showing "Compliant" means the rule's most recent evaluation446found resources compliant — which may be hours, days, or weeks ago if the447recorder is stopped or the rule hasn't evaluated recently.448449**Diagnostic steps:**4501. `describe-configuration-recorder-status` — if `recording: false`, start it.4512. `describe-config-rule-evaluation-status` — check `LastSuccessfulInvocationTime`.4523. Force evaluation: `start-config-rules-evaluation --config-rule-names <name>`.4534. Wait 1-30 minutes, then re-check compliance.454455Full diagnostic decision tree and per-rule-type staleness indicators in456`references/config-rule-catalog.md`.457458ALWAYS pair Config rule deployment with a recorder status check. A459correctly configured rule on a stopped recorder is a false sense of460security.461462## Pre-flight safety checks (run before any provisioning CLI)463464- **MANDATORY CONFIRMATION GATE** before any state-changing operation.465- **PutConfigRule overwrites the entire rule.** Snapshot before modification:466 `aws configservice describe-config-rules --config-rule-names <name> --output json > /tmp/<name>-backup-$(date +%s).json`467- For custom Lambda rules: verify resource-based policy includes468 `config.amazonaws.com` permission. #1 cause of custom rule errors.469- For remediation: verify SSM document exists in-region AND Config470 service-linked role has `ssm:StartAutomationExecution`.471- For conformance packs: validate template YAML before deployment.472- Prefer configuration-change over periodic for security-critical checks.473474## Recent AWS features (2024-2026)475476- **Proactive Config rules (2024-2025):** evaluate CloudFormation templates477 BEFORE resource creation via CloudFormation hooks. Shifts from detective478 to preventive compliance.479- **Conformance pack templates from Git repositories (2024):** deploy from480 GitHub/CodeCommit without uploading template bodies. Enables481 version-controlled compliance-as-code.482- **Organization conformance packs (2024-2025):** deploy across an entire483 org from the management account with a single API call.484- **Config rule coverage for 300+ resource types (2025):** expanded support485 including AppRunner, Cedar policies, Bedrock guardrails.486- **Security Hub automated response (2025):** trigger SSM Automation487 directly from Config findings without custom Lambda. Reduces remediation488 latency from minutes to seconds.489- **Config data export to S3 with Parquet (2024):** configuration snapshots490 and compliance history in Parquet for Athena querying.491- **Resource aggregation across regions (2024-2025):** improved multi-region492 aggregation with lower latency.493494## AWS documentation495496- **AWS Config Developer Guide** — https://docs.aws.amazon.com/config/latest/developerguide/WhatIsConfig.html497- **AWS Config Managed Rules** — https://docs.aws.amazon.com/config/latest/developerguide/managed-rules-by-aws-config.html498- **Custom Lambda Rules** — https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_develop-rules_lambda-functions.html499- **Conformance Packs** — https://docs.aws.amazon.com/config/latest/developerguide/conformance-packs.html500- **Organization Config Rules** — https://docs.aws.amazon.com/config/latest/developerguide/organization-config-rules-overview.html501- **Remediation (SSM Automation)** — https://docs.aws.amazon.com/config/latest/developerguide/remediation.html502- **Proactive Rules (CloudFormation Hooks)** — https://docs.aws.amazon.com/config/latest/developerguide/proactive-rules.html503- **AWS Config API Reference** — https://docs.aws.amazon.com/config/latest/APIReference/504505## Domain506507AWS CloudOps / Config Rule Provisioning, Compliance Automation & Governance.