Class RuleScope
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.config.RuleScope
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:48.629Z")
@Stability(Stable)
public class RuleScope
extends software.amazon.jsii.JsiiObject
Determines which resources trigger an evaluation of an AWS Config rule.
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();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic RuleScope
fromResource
(ResourceType resourceType) restricts scope of changes to a specific resource type or resource identifier.static RuleScope
fromResource
(ResourceType resourceType, String resourceId) restricts scope of changes to a specific resource type or resource identifier.static RuleScope
fromResources
(List<? extends ResourceType> resourceTypes) restricts scope of changes to specific resource types.static RuleScope
restricts scope of changes to a specific tag.static RuleScope
restricts scope of changes to a specific tag.getKey()
tag key applied to resources that will trigger evaluation of a rule.ID of the only AWS resource that will trigger evaluation of a rule.Resource types that will trigger evaluation of a rule.getValue()
tag value applied to resources that will trigger evaluation of a rule.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
RuleScope
protected RuleScope(software.amazon.jsii.JsiiObjectRef objRef) -
RuleScope
protected RuleScope(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
-
Method Details
-
fromResource
@Stability(Stable) @NotNull public static RuleScope fromResource(@NotNull ResourceType resourceType, @Nullable String resourceId) restricts scope of changes to a specific resource type or resource identifier.- Parameters:
resourceType
- This parameter is required.resourceId
-
-
fromResource
@Stability(Stable) @NotNull public static RuleScope fromResource(@NotNull ResourceType resourceType) restricts scope of changes to a specific resource type or resource identifier.- Parameters:
resourceType
- This parameter is required.
-
fromResources
@Stability(Stable) @NotNull public static RuleScope fromResources(@NotNull List<? extends ResourceType> resourceTypes) restricts scope of changes to specific resource types.- Parameters:
resourceTypes
- This parameter is required.
-
fromTag
@Stability(Stable) @NotNull public static RuleScope fromTag(@NotNull String key, @Nullable String value) restricts scope of changes to a specific tag.- Parameters:
key
- This parameter is required.value
-
-
fromTag
restricts scope of changes to a specific tag.- Parameters:
key
- This parameter is required.
-
getKey
tag key applied to resources that will trigger evaluation of a rule. -
getResourceId
ID of the only AWS resource that will trigger evaluation of a rule. -
getResourceTypes
Resource types that will trigger evaluation of a rule. -
getValue
tag value applied to resources that will trigger evaluation of a rule.
-