Show / Hide Table of Contents

Class CustomRule

A new custom rule.

Inheritance
object
Resource
CustomRule
Implements
IRule
IResource
IConstruct
IDependable
IEnvironmentAware
Inherited Members
Resource.IsOwnedResource(IConstruct)
Resource.IsResource(IConstruct)
Resource.ApplyRemovalPolicy(RemovalPolicy)
Resource.GeneratePhysicalName()
Resource.GetResourceArnAttribute(string, IArnComponents)
Resource.GetResourceNameAttribute(string)
Resource.Env
Resource.PhysicalName
Resource.Stack
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

string

Remarks

Attribute: true

ConfigRuleComplianceType

The compliance status of the rule.

public virtual string ConfigRuleComplianceType { get; }
Property Value

string

Remarks

Attribute: true

ConfigRuleId

The id of the rule.

public virtual string ConfigRuleId { get; }
Property Value

string

Remarks

Attribute: true

ConfigRuleName

The name of the rule.

public virtual string ConfigRuleName { get; }
Property Value

string

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

string

Remarks

Resource: AWS::Config::ConfigRule

ExampleMetadata: infused

RuleScope

A new custom rule.

protected virtual RuleScope? RuleScope { get; set; }
Property Value

RuleScope

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
scope Construct
id string
configRuleName string

the name of the rule.

Returns

IRule

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

Rule

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

Rule

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

Rule

Remarks

Resource: AWS::Config::ConfigRule

ExampleMetadata: infused

Implements

IRule
IResource
Constructs.IConstruct
Constructs.IDependable
IEnvironmentAware
Back to top Generated by DocFX