Interface IRole

All Superinterfaces:
software.constructs.IConstruct, software.constructs.IDependable, IEnvironmentAware, IGrantable, IIdentity, IPrincipal, IResource, IRoleRef, software.amazon.jsii.JsiiSerializable
All Known Subinterfaces:
IRole.Jsii$Default
All Known Implementing Classes:
IRole.Jsii$Proxy, LazyRole, Role

@Generated(value="jsii-pacmak/1.118.0 (build 02eec31)", date="2025-11-04T09:27:42.948Z") @Stability(Stable) public interface IRole extends software.amazon.jsii.JsiiSerializable, IIdentity, IRoleRef
A Role object.
  • Method Details

    • getRoleArn

      @Stability(Stable) @NotNull String getRoleArn()
      Returns the ARN of this role.
    • getRoleName

      @Stability(Stable) @NotNull String getRoleName()
      Returns the name of this role.
    • grant

      @Stability(Stable) @NotNull Grant grant(@NotNull IPrincipal grantee, @NotNull String... actions)
      Grant the actions defined in actions to the identity Principal on this resource.

      Parameters:
      grantee - This parameter is required.
      actions - This parameter is required.
    • grantAssumeRole

      @Stability(Stable) @NotNull Grant grantAssumeRole(@NotNull IPrincipal grantee)
      Grant permissions to the given principal to assume this role.

      Parameters:
      grantee - This parameter is required.
    • grantPassRole

      @Stability(Stable) @NotNull Grant grantPassRole(@NotNull IPrincipal grantee)
      Grant permissions to the given principal to pass this role.

      Parameters:
      grantee - This parameter is required.
    • getNode

      @Stability(Stable) @NotNull software.constructs.Node getNode()
      The tree node.
      Specified by:
      getNode in interface software.constructs.IConstruct
    • getEnv

      @Stability(Stable) @NotNull ResourceEnvironment getEnv()
      The environment this resource belongs to.

      For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

      For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.

      Specified by:
      getEnv in interface IEnvironmentAware