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

    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.