java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.bedrockagentcore.PolicyBase
All Implemented Interfaces:
IPolicyRef, IEnvironmentAware, IResource, IPolicy, IGrantable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable
Direct Known Subclasses:
Policy

@Generated(value="jsii-pacmak/1.139.0 (build 26a6b54)", date="2026-09-10T17:51:40.338Z") @Stability(Stable) public abstract class PolicyBase extends Resource implements IPolicy
Abstract base class for a Policy.

Contains methods and attributes valid for Policies either created with CDK or imported.

  • Constructor Details

    • PolicyBase

      protected PolicyBase(software.amazon.jsii.JsiiObjectRef objRef)
    • PolicyBase

      protected PolicyBase(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • PolicyBase

      @Stability(Stable) protected PolicyBase(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable ResourceProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props -
    • PolicyBase

      @Stability(Stable) protected PolicyBase(@NotNull software.constructs.Construct scope, @NotNull String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
  • Method Details

    • grant

      @Stability(Stable) @NotNull public Grant grant(@NotNull IGrantable grantee, @NotNull String... actions)
      Grants IAM actions to the IAM Principal.

      [disable-awslint:no-grants]

      Specified by:
      grant in interface IPolicy
      Parameters:
      grantee -
      • The IAM principal to grant permissions to.
      This parameter is required.
      actions -
      • The actions to grant.
      This parameter is required.
      Returns:
      An IAM Grant object representing the granted permissions
    • grantRead

      @Stability(Stable) @NotNull public Grant grantRead(@NotNull IGrantable grantee)
      Grants read permissions on the Policy (data plane).

      This grants runtime read access to policy configuration. Use this for monitoring, audit, or read-only administrative roles that need to inspect policy definitions and Cedar statements at runtime.

      IMPORTANT: This does NOT grant permissions to create/update/delete the Policy resource itself. Those are control plane operations performed by CloudFormation during cdk deploy, not by your application at runtime.

      [disable-awslint:no-grants]

      Specified by:
      grantRead in interface IPolicy
      Parameters:
      grantee -
      • The IAM principal to grant read permissions to.
      This parameter is required.
      Returns:
      An IAM Grant object representing the granted permissions
    • metric

      @Stability(Stable) @NotNull public Metric metric(@NotNull String metricName, @Nullable MetricOptions props)
      Return the given named metric for this policy.

      By default, the metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

      Specified by:
      metric in interface IPolicy
      Parameters:
      metricName - The name of the metric. This parameter is required.
      props - Optional metric configuration.
    • metric

      @Stability(Stable) @NotNull public Metric metric(@NotNull String metricName)
      Return the given named metric for this policy.

      By default, the metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

      Specified by:
      metric in interface IPolicy
      Parameters:
      metricName - The name of the metric. This parameter is required.
    • metricEvaluationLatency

      @Stability(Stable) @NotNull public Metric metricEvaluationLatency(@Nullable MetricOptions props)
      Return a metric measuring the evaluation latency for this policy.

      This metric represents the time taken to evaluate this specific policy.

      Specified by:
      metricEvaluationLatency in interface IPolicy
      Parameters:
      props - Optional metric configuration.
    • metricEvaluationLatency

      @Stability(Stable) @NotNull public Metric metricEvaluationLatency()
      Return a metric measuring the evaluation latency for this policy.

      This metric represents the time taken to evaluate this specific policy.

      Specified by:
      metricEvaluationLatency in interface IPolicy
    • metricEvaluations

      @Stability(Stable) @NotNull public Metric metricEvaluations(@Nullable MetricOptions props)
      Return a metric containing the total number of evaluations for this policy.

      This metric tracks how many times this policy has been evaluated.

      Specified by:
      metricEvaluations in interface IPolicy
      Parameters:
      props - Optional metric configuration.
    • metricEvaluations

      @Stability(Stable) @NotNull public Metric metricEvaluations()
      Return a metric containing the total number of evaluations for this policy.

      This metric tracks how many times this policy has been evaluated.

      Specified by:
      metricEvaluations in interface IPolicy
    • getGrantPrincipal

      @Stability(Stable) @NotNull public abstract IPrincipal getGrantPrincipal()
      The principal to grant permissions to.
      Specified by:
      getGrantPrincipal in interface IGrantable
    • getPolicyArn

      @Stability(Stable) @NotNull public abstract String getPolicyArn()
      The ARN of the policy resource.
      Specified by:
      getPolicyArn in interface IPolicy
    • getPolicyEngine

      @Stability(Stable) @NotNull public abstract IPolicyEngine getPolicyEngine()
      The policy engine this policy belongs to.
      Specified by:
      getPolicyEngine in interface IPolicy
    • getPolicyId

      @Stability(Stable) @NotNull public abstract String getPolicyId()
      The ID of the policy.
      Specified by:
      getPolicyId in interface IPolicy
    • getPolicyName

      @Stability(Stable) @NotNull public abstract String getPolicyName()
      The name of the policy.
      Specified by:
      getPolicyName in interface IPolicy
    • getPolicyRef

      @Stability(Stable) @NotNull public PolicyReference getPolicyRef()
      A reference to this Policy resource.
      Specified by:
      getPolicyRef in interface IPolicyRef
    • getDescription

      @Stability(Stable) @Nullable public abstract String getDescription()
      The description of the policy.
      Specified by:
      getDescription in interface IPolicy
    • getValidationMode

      @Stability(Stable) @Nullable public abstract PolicyValidationMode getValidationMode()
      The validation mode for the policy.
      Specified by:
      getValidationMode in interface IPolicy