@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)",
date="2023-03-22T19:35:50.798Z")
public class RuleScope
extends software.amazon.jsii.JsiiObject
Example:
Function evalComplianceFn; ManagedRule sshRule = ManagedRule.Builder.create(this, "SSH") .identifier(ManagedRuleIdentifiers.EC2_SECURITY_GROUPS_INCOMING_SSH_DISABLED) .ruleScope(RuleScope.fromResource(ResourceType.EC2_SECURITY_GROUP, "sg-1234567890abcdefgh")) .build(); CustomRule customRule = CustomRule.Builder.create(this, "Lambda") .lambdaFunction(evalComplianceFn) .configurationChanges(true) .ruleScope(RuleScope.fromResources(List.of(ResourceType.CLOUDFORMATION_STACK, ResourceType.S3_BUCKET))) .build(); CustomRule tagRule = CustomRule.Builder.create(this, "CostCenterTagRule") .lambdaFunction(evalComplianceFn) .configurationChanges(true) .ruleScope(RuleScope.fromTag("Cost Center", "MyApp")) .build();
Modifier | Constructor and Description |
---|---|
protected |
RuleScope(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
RuleScope(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
static RuleScope |
fromResource(ResourceType resourceType)
restricts scope of changes to a specific resource type or resource identifier.
|
static RuleScope |
fromResource(ResourceType resourceType,
java.lang.String resourceId)
restricts scope of changes to a specific resource type or resource identifier.
|
static RuleScope |
fromResources(java.util.List<? extends ResourceType> resourceTypes)
restricts scope of changes to specific resource types.
|
static RuleScope |
fromTag(java.lang.String key)
restricts scope of changes to a specific tag.
|
static RuleScope |
fromTag(java.lang.String key,
java.lang.String value)
restricts scope of changes to a specific tag.
|
java.lang.String |
getKey()
tag key applied to resources that will trigger evaluation of a rule.
|
java.lang.String |
getResourceId()
ID of the only AWS resource that will trigger evaluation of a rule.
|
java.util.List<ResourceType> |
getResourceTypes()
Resource types that will trigger evaluation of a rule.
|
java.lang.String |
getValue()
tag value applied to resources that will trigger evaluation of a rule.
|
protected RuleScope(software.amazon.jsii.JsiiObjectRef objRef)
protected RuleScope(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public static RuleScope fromResource(ResourceType resourceType, java.lang.String resourceId)
resourceType
- This parameter is required.resourceId
- public static RuleScope fromResource(ResourceType resourceType)
resourceType
- This parameter is required.public static RuleScope fromResources(java.util.List<? extends ResourceType> resourceTypes)
resourceTypes
- This parameter is required.public static RuleScope fromTag(java.lang.String key, java.lang.String value)
key
- This parameter is required.value
- public static RuleScope fromTag(java.lang.String key)
key
- This parameter is required.public java.lang.String getKey()
public java.lang.String getResourceId()
public java.util.List<ResourceType> getResourceTypes()
public java.lang.String getValue()