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.103.1 (build bef2dea)", date="2024-10-05T03:43:41.016Z") @Stability(Stable) public class RuleScope extends software.amazon.jsii.JsiiObject
Determines which resources trigger an evaluation of an AWS Config rule.

Example:

 // Lambda function containing logic that evaluates compliance with the rule.
 Function evalComplianceFn = Function.Builder.create(this, "CustomFunction")
         .code(AssetCode.fromInline("exports.handler = (event) => console.log(event);"))
         .handler("index.handler")
         .runtime(Runtime.NODEJS_18_X)
         .build();
 // A custom rule that runs on configuration changes of EC2 instances
 CustomRule customRule = CustomRule.Builder.create(this, "Custom")
         .configurationChanges(true)
         .lambdaFunction(evalComplianceFn)
         .ruleScope(RuleScope.fromResource(ResourceType.EC2_INSTANCE))
         .build();
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    RuleScope(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    RuleScope(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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
    fromTag(String key, String value)
    restricts scope of changes to a specific tag.
    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.
    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

      @Stability(Stable) @NotNull public static RuleScope fromTag(@NotNull String key)
      restricts scope of changes to a specific tag.

      Parameters:
      key - This parameter is required.
    • getKey

      @Stability(Stable) @Nullable public String getKey()
      tag key applied to resources that will trigger evaluation of a rule.
    • getResourceId

      @Stability(Stable) @Nullable public String getResourceId()
      ID of the only AWS resource that will trigger evaluation of a rule.
    • getResourceTypes

      @Stability(Stable) @Nullable public List<ResourceType> getResourceTypes()
      Resource types that will trigger evaluation of a rule.
    • getValue

      @Stability(Stable) @Nullable public String getValue()
      tag value applied to resources that will trigger evaluation of a rule.