Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions,
see Getting Started with Amazon Web Services in China
(PDF).
Use DescribeConfigRuleEvaluationStatus
with an Amazon SDK or CLI
The following code examples show how to use DescribeConfigRuleEvaluationStatus
.
- CLI
-
- Amazon CLI
-
To get status information for an Amazon Config rule
The following command returns the status information for an Amazon Config rule named MyConfigRule
:
aws configservice describe-config-rule-evaluation-status --config-rule-names MyConfigRule
Output:
{
"ConfigRulesEvaluationStatus": [
{
"ConfigRuleArn": "arn:aws:config:us-east-1:123456789012:config-rule/config-rule-abcdef",
"FirstActivatedTime": 1450311703.844,
"ConfigRuleId": "config-rule-abcdef",
"LastSuccessfulInvocationTime": 1450314643.156,
"ConfigRuleName": "MyConfigRule"
}
]
}
- PowerShell
-
- Tools for PowerShell
-
Example 1: This sample returns the status information for the given config rules.
Get-CFGConfigRuleEvaluationStatus -ConfigRuleName root-account-mfa-enabled, vpc-flow-logs-enabled
Output:
ConfigRuleArn : arn:aws:config:eu-west-1:123456789012:config-rule/config-rule-kvq1wk
ConfigRuleId : config-rule-kvq1wk
ConfigRuleName : root-account-mfa-enabled
FirstActivatedTime : 8/27/2019 8:05:17 AM
FirstEvaluationStarted : True
LastErrorCode :
LastErrorMessage :
LastFailedEvaluationTime : 1/1/0001 12:00:00 AM
LastFailedInvocationTime : 1/1/0001 12:00:00 AM
LastSuccessfulEvaluationTime : 12/13/2019 8:12:03 AM
LastSuccessfulInvocationTime : 12/13/2019 8:12:03 AM
ConfigRuleArn : arn:aws:config:eu-west-1:123456789012:config-rule/config-rule-z1s23b
ConfigRuleId : config-rule-z1s23b
ConfigRuleName : vpc-flow-logs-enabled
FirstActivatedTime : 8/14/2019 6:23:44 AM
FirstEvaluationStarted : True
LastErrorCode :
LastErrorMessage :
LastFailedEvaluationTime : 1/1/0001 12:00:00 AM
LastFailedInvocationTime : 1/1/0001 12:00:00 AM
LastSuccessfulEvaluationTime : 12/13/2019 7:12:01 AM
LastSuccessfulInvocationTime : 12/13/2019 7:12:01 AM
For a complete list of Amazon SDK developer guides and code examples, see
Using Amazon Config with an Amazon SDK.
This topic also includes information about getting started and details about previous SDK versions.