Class CfnResourcePolicy

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, IResourcePolicyRef, IEnvironmentAware, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.140.0 (build 79fd58c)", date="2026-09-30T11:04:52.404Z") @Stability(Stable) public class CfnResourcePolicy extends CfnResource implements IInspectable, IResourcePolicyRef
Resource type definition for AWS::EventsV2::ResourcePolicy, the resource policy of an Amazon EventBridge event bus.

This manages only the resource policy named "default", which the bus owner writes. It does not manage the policy named "AWS_RAM", which AWS Resource Access Manager owns on behalf of the bus owner. If the bus already has a default policy, creating this resource fails. Deleting this resource removes all permissions granted by it. An explicit Deny in this policy takes precedence over an Allow in the "AWS_RAM" policy, so deleting this resource can widen access. Set DeletionPolicy: Retain if the policy carries a Deny that you rely on. Required permissions: events:PutResourcePolicy, events:GetResourcePolicy, and events:DeleteResourcePolicy. Listing resources of this type also requires events:ListEventBuses and events:ListResourcePolicies.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.eventsv2.*;
 Object policyDocument;
 CfnResourcePolicy cfnResourcePolicy = CfnResourcePolicy.Builder.create(this, "MyCfnResourcePolicy")
         .eventBusArn("eventBusArn")
         .policyDocument(policyDocument)
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnResourcePolicy

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

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

      @Stability(Stable) public CfnResourcePolicy(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnResourcePolicyProps props)
      Create a new AWS::EventsV2::ResourcePolicy.

      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • isCfnResourcePolicy

      @Stability(Stable) @NotNull public static Boolean isCfnResourcePolicy(@NotNull Object x)
      Checks whether the given object is a CfnResourcePolicy.

      Parameters:
      x - This parameter is required.
    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrRevisionId

      @Stability(Stable) @NotNull public String getAttrRevisionId()
      The revision identifier the service assigned to the stored policy.

      The identifier changes on every successful write.

    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getCfnPropertyNames

      @Stability(Stable) @NotNull protected Map<String,String> getCfnPropertyNames()
      Overrides:
      getCfnPropertyNames in class CfnResource
    • getResourcePolicyRef

      @Stability(Stable) @NotNull public ResourcePolicyReference getResourcePolicyRef()
      A reference to a ResourcePolicy resource.
      Specified by:
      getResourcePolicyRef in interface IResourcePolicyRef
    • getEventBusArn

      @Stability(Stable) @NotNull public String getEventBusArn()
      The Amazon Resource Name (ARN) of the event bus whose resource policy this is.
    • setEventBusArn

      @Stability(Stable) public void setEventBusArn(@NotNull String value)
      The Amazon Resource Name (ARN) of the event bus whose resource policy this is.
    • getPolicyDocument

      @Stability(Stable) @NotNull public Object getPolicyDocument()
      The resource policy document, as a JSON object.
    • setPolicyDocument

      @Stability(Stable) public void setPolicyDocument(@NotNull Object value)
      The resource policy document, as a JSON object.