Class RuleScope
Determines which resources trigger an evaluation of an AWS Config rule.
Inheritance
Namespace: Amazon.CDK.AWS.Config
Assembly: Amazon.CDK.AWS.Config.dll
Syntax (csharp)
public class RuleScope : DeputyBase
Syntax (vb)
Public Class RuleScope
Inherits DeputyBase
Remarks
ExampleMetadata: infused
Examples
Function evalComplianceFn;
var sshRule = new ManagedRule(this, "SSH", new ManagedRuleProps {
Identifier = ManagedRuleIdentifiers.EC2_SECURITY_GROUPS_INCOMING_SSH_DISABLED,
RuleScope = RuleScope.FromResource(ResourceType.EC2_SECURITY_GROUP, "sg-1234567890abcdefgh")
});
var customRule = new CustomRule(this, "Lambda", new CustomRuleProps {
LambdaFunction = evalComplianceFn,
ConfigurationChanges = true,
RuleScope = RuleScope.FromResources(new [] { ResourceType.CLOUDFORMATION_STACK, ResourceType.S3_BUCKET })
});
var tagRule = new CustomRule(this, "CostCenterTagRule", new CustomRuleProps {
LambdaFunction = evalComplianceFn,
ConfigurationChanges = true,
RuleScope = RuleScope.FromTag("Cost Center", "MyApp")
});
Synopsis
Constructors
RuleScope(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
RuleScope(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
Key | tag key applied to resources that will trigger evaluation of a rule. |
ResourceId | ID of the only AWS resource that will trigger evaluation of a rule. |
ResourceTypes | Resource types that will trigger evaluation of a rule. |
Value | tag value applied to resources that will trigger evaluation of a rule. |
Methods
FromResource(ResourceType, String) | restricts scope of changes to a specific resource type or resource identifier. |
FromResources(ResourceType[]) | restricts scope of changes to specific resource types. |
FromTag(String, String) | restricts scope of changes to a specific tag. |
Constructors
RuleScope(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected RuleScope(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
RuleScope(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected RuleScope(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
Key
tag key applied to resources that will trigger evaluation of a rule.
public virtual string Key { get; }
Property Value
System.String
ResourceId
ID of the only AWS resource that will trigger evaluation of a rule.
public virtual string ResourceId { get; }
Property Value
System.String
ResourceTypes
Resource types that will trigger evaluation of a rule.
public virtual ResourceType[] ResourceTypes { get; }
Property Value
Value
tag value applied to resources that will trigger evaluation of a rule.
public virtual string Value { get; }
Property Value
System.String
Methods
FromResource(ResourceType, String)
restricts scope of changes to a specific resource type or resource identifier.
public static RuleScope FromResource(ResourceType resourceType, string resourceId = null)
Parameters
- resourceType ResourceType
- resourceId System.String
Returns
FromResources(ResourceType[])
restricts scope of changes to specific resource types.
public static RuleScope FromResources(ResourceType[] resourceTypes)
Parameters
- resourceTypes ResourceType[]
Returns
FromTag(String, String)
restricts scope of changes to a specific tag.
public static RuleScope FromTag(string key, string value = null)
Parameters
- key System.String
- value System.String
Returns