Class AccountRootPrincipal

All Implemented Interfaces:
IAssumeRolePrincipal, IComparablePrincipal, IGrantable, IPrincipal, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.121.0 (build d7af9b9)", date="2025-12-18T18:20:11.415Z") @Stability(Stable) public class AccountRootPrincipal extends AccountPrincipal
Use the AWS account into which a stack is deployed as the principal entity in a policy.

Example:

 // Adds to IAM user's policy (not resource policy)
 User user;
 TableV2 table = TableV2.Builder.create(this, "Table")
         .partitionKey(Attribute.builder().name("pk").type(AttributeType.STRING).build())
         .build();
 // Automatically adds to table's resource policy (same account)
 table.grantReadData(new AccountRootPrincipal());
 table.grantReadData(user);
 
  • Constructor Details

    • AccountRootPrincipal

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

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

      @Stability(Stable) public AccountRootPrincipal()
  • Method Details

    • toString

      @Stability(Stable) @NotNull public String toString()
      Returns a string representation of an object.
      Overrides:
      toString in class AccountPrincipal