

# Rule

A single deny rule. The rule matches a package when all of its conditions are true. When several rules match, the strongest enforcement mode wins.

## Contents
<a name="API_Rule_Contents"></a>

 ** denyWhen **   <a name="continuum-Type-Rule-denyWhen"></a>
The conditions that must all be true for the rule to match.  
Type: [DenyWhen](API_DenyWhen.md) object  
Required: Yes

 ** enforcementMode **   <a name="continuum-Type-Rule-enforcementMode"></a>
What happens when the rule matches. ENFORCE denies the package. AUDIT records the match and allows the package.  
Type: String  
Valid Values: `AUDIT | ENFORCE`   
Required: Yes

 ** ruleId **   <a name="continuum-Type-Rule-ruleId"></a>
The identifier of the rule, unique within the policy. Policy exceptions and decision evidence refer to rules by this ID.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 128.  
Required: Yes

## See Also
<a name="API_Rule_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/continuum-2022-07-26/Rule) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/continuum-2022-07-26/Rule) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/continuum-2022-07-26/Rule) 