Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Use DeleteConfigRule with an AWS SDK or CLI

Focus mode
Use DeleteConfigRule with an AWS SDK or CLI - AWS Config

The following code examples show how to use DeleteConfigRule.

CLI
AWS CLI

To delete an AWS Config rule

The following command deletes an AWS Config rule named MyConfigRule:

aws configservice delete-config-rule --config-rule-name MyConfigRule
Python
SDK for Python (Boto3)
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

class ConfigWrapper: """ Encapsulates AWS Config functions. """ def __init__(self, config_client): """ :param config_client: A Boto3 AWS Config client. """ self.config_client = config_client def delete_config_rule(self, rule_name): """ Delete the specified rule. :param rule_name: The name of the rule to delete. """ try: self.config_client.delete_config_rule(ConfigRuleName=rule_name) logger.info("Deleted rule %s.", rule_name) except ClientError: logger.exception("Couldn't delete rule %s.", rule_name) raise
  • For API details, see DeleteConfigRule in AWS SDK for Python (Boto3) API Reference.

AWS CLI

To delete an AWS Config rule

The following command deletes an AWS Config rule named MyConfigRule:

aws configservice delete-config-rule --config-rule-name MyConfigRule

For a complete list of AWS SDK developer guides and code examples, see Using AWS Config with an AWS SDK. This topic also includes information about getting started and details about previous SDK versions.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.