Class AccountRootPrincipal

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

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-05T03:43:44.360Z") @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:

 Bucket bucket = new Bucket(this, "MyBucket");
 AddToResourcePolicyResult result = bucket.addToResourcePolicy(
 PolicyStatement.Builder.create()
         .actions(List.of("s3:GetObject"))
         .resources(List.of(bucket.arnForObjects("file.txt")))
         .principals(List.of(new AccountRootPrincipal()))
         .build());
 
  • 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