Class AccountRootPrincipal

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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:29:57.219Z") @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