Class CustomRule
A new custom rule.
Inherited Members
Namespace: Amazon.CDK.AWS.Config
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CustomRule : Resource, IRule, IResource, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Class CustomRule Inherits Resource Implements IRule, IResource, IConstruct, IDependable, IEnvironmentAware
Remarks
Resource: AWS::Config::ConfigRule
ExampleMetadata: infused
Examples
Function fn;
string samplePolicyText;
new ManagedRule(this, "ManagedRule", new ManagedRuleProps {
Identifier = ManagedRuleIdentifiers.API_GW_XRAY_ENABLED,
EvaluationModes = EvaluationMode.DETECTIVE_AND_PROACTIVE
});
new CustomRule(this, "CustomRule", new CustomRuleProps {
LambdaFunction = fn,
EvaluationModes = EvaluationMode.PROACTIVE
});
new CustomPolicy(this, "CustomPolicy", new CustomPolicyProps {
PolicyText = samplePolicyText,
EvaluationModes = EvaluationMode.DETECTIVE
});
Synopsis
Constructors
| CustomRule(Construct, string, ICustomRuleProps) | A new custom rule. |
Properties
| ConfigRuleArn | The arn of the rule. |
| ConfigRuleComplianceType | The compliance status of the rule. |
| ConfigRuleId | The id of the rule. |
| ConfigRuleName | The name of the rule. |
| IsCustomWithChanges | A new custom rule. |
| IsManaged | A new custom rule. |
| PROPERTY_INJECTION_ID | Uniquely identifies this class. |
| RuleScope | A new custom rule. |
Methods
| FromConfigRuleName(Construct, string, string) | Imports an existing rule. |
| OnComplianceChange(string, IOnEventOptions?) | Defines an EventBridge event rule which triggers for rule compliance events. |
| OnEvent(string, IOnEventOptions?) | Defines an EventBridge event rule which triggers for rule events. |
| OnReEvaluationStatus(string, IOnEventOptions?) | Defines an EventBridge event rule which triggers for rule re-evaluation status events. |
Constructors
CustomRule(Construct, string, ICustomRuleProps)
A new custom rule.
public CustomRule(Construct scope, string id, ICustomRuleProps props)
Parameters
- scope Construct
- id string
- props ICustomRuleProps
Remarks
Resource: AWS::Config::ConfigRule
ExampleMetadata: infused
Examples
Function fn;
string samplePolicyText;
new ManagedRule(this, "ManagedRule", new ManagedRuleProps {
Identifier = ManagedRuleIdentifiers.API_GW_XRAY_ENABLED,
EvaluationModes = EvaluationMode.DETECTIVE_AND_PROACTIVE
});
new CustomRule(this, "CustomRule", new CustomRuleProps {
LambdaFunction = fn,
EvaluationModes = EvaluationMode.PROACTIVE
});
new CustomPolicy(this, "CustomPolicy", new CustomPolicyProps {
PolicyText = samplePolicyText,
EvaluationModes = EvaluationMode.DETECTIVE
});
Properties
ConfigRuleArn
The arn of the rule.
public virtual string ConfigRuleArn { get; }
Property Value
Remarks
Attribute: true
ConfigRuleComplianceType
The compliance status of the rule.
public virtual string ConfigRuleComplianceType { get; }
Property Value
Remarks
Attribute: true
ConfigRuleId
The id of the rule.
public virtual string ConfigRuleId { get; }
Property Value
Remarks
Attribute: true
ConfigRuleName
The name of the rule.
public virtual string ConfigRuleName { get; }
Property Value
Remarks
Attribute: true
IsCustomWithChanges
A new custom rule.
protected virtual bool? IsCustomWithChanges { get; set; }
Property Value
bool?
Remarks
Resource: AWS::Config::ConfigRule
ExampleMetadata: infused
Examples
Function fn;
string samplePolicyText;
new ManagedRule(this, "ManagedRule", new ManagedRuleProps {
Identifier = ManagedRuleIdentifiers.API_GW_XRAY_ENABLED,
EvaluationModes = EvaluationMode.DETECTIVE_AND_PROACTIVE
});
new CustomRule(this, "CustomRule", new CustomRuleProps {
LambdaFunction = fn,
EvaluationModes = EvaluationMode.PROACTIVE
});
new CustomPolicy(this, "CustomPolicy", new CustomPolicyProps {
PolicyText = samplePolicyText,
EvaluationModes = EvaluationMode.DETECTIVE
});
IsManaged
A new custom rule.
protected virtual bool? IsManaged { get; set; }
Property Value
bool?
Remarks
Resource: AWS::Config::ConfigRule
ExampleMetadata: infused
Examples
Function fn;
string samplePolicyText;
new ManagedRule(this, "ManagedRule", new ManagedRuleProps {
Identifier = ManagedRuleIdentifiers.API_GW_XRAY_ENABLED,
EvaluationModes = EvaluationMode.DETECTIVE_AND_PROACTIVE
});
new CustomRule(this, "CustomRule", new CustomRuleProps {
LambdaFunction = fn,
EvaluationModes = EvaluationMode.PROACTIVE
});
new CustomPolicy(this, "CustomPolicy", new CustomPolicyProps {
PolicyText = samplePolicyText,
EvaluationModes = EvaluationMode.DETECTIVE
});
PROPERTY_INJECTION_ID
Uniquely identifies this class.
public static string PROPERTY_INJECTION_ID { get; }
Property Value
Remarks
Resource: AWS::Config::ConfigRule
ExampleMetadata: infused
RuleScope
A new custom rule.
protected virtual RuleScope? RuleScope { get; set; }
Property Value
Remarks
Resource: AWS::Config::ConfigRule
ExampleMetadata: infused
Examples
Function fn;
string samplePolicyText;
new ManagedRule(this, "ManagedRule", new ManagedRuleProps {
Identifier = ManagedRuleIdentifiers.API_GW_XRAY_ENABLED,
EvaluationModes = EvaluationMode.DETECTIVE_AND_PROACTIVE
});
new CustomRule(this, "CustomRule", new CustomRuleProps {
LambdaFunction = fn,
EvaluationModes = EvaluationMode.PROACTIVE
});
new CustomPolicy(this, "CustomPolicy", new CustomPolicyProps {
PolicyText = samplePolicyText,
EvaluationModes = EvaluationMode.DETECTIVE
});
Methods
FromConfigRuleName(Construct, string, string)
Imports an existing rule.
public static IRule FromConfigRuleName(Construct scope, string id, string configRuleName)
Parameters
Returns
Remarks
Resource: AWS::Config::ConfigRule
ExampleMetadata: infused
OnComplianceChange(string, IOnEventOptions?)
Defines an EventBridge event rule which triggers for rule compliance events.
public virtual Rule OnComplianceChange(string id, IOnEventOptions? options = null)
Parameters
- id string
- options IOnEventOptions
Returns
Remarks
Resource: AWS::Config::ConfigRule
ExampleMetadata: infused
OnEvent(string, IOnEventOptions?)
Defines an EventBridge event rule which triggers for rule events.
public virtual Rule OnEvent(string id, IOnEventOptions? options = null)
Parameters
- id string
- options IOnEventOptions
Returns
Remarks
Use
rule.addEventPattern(pattern) to specify a filter.
OnReEvaluationStatus(string, IOnEventOptions?)
Defines an EventBridge event rule which triggers for rule re-evaluation status events.
public virtual Rule OnReEvaluationStatus(string id, IOnEventOptions? options = null)
Parameters
- id string
- options IOnEventOptions
Returns
Remarks
Resource: AWS::Config::ConfigRule
ExampleMetadata: infused