Class CanonicalUserPrincipal

All Implemented Interfaces:
IAssumeRolePrincipal, IComparablePrincipal, IGrantable, IPrincipal,

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-12T19:34:02.894Z") @Stability(Stable) public class CanonicalUserPrincipal extends PrincipalBase
A policy principal for canonicalUserIds - useful for S3 bucket policies that use Origin Access identities.



for more details.


 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 CanonicalUserPrincipal canonicalUserPrincipal = new CanonicalUserPrincipal("canonicalUserId");
  • Constructor Details

    • CanonicalUserPrincipal

      protected CanonicalUserPrincipal( objRef)
    • CanonicalUserPrincipal

      protected CanonicalUserPrincipal( initializationMode)
    • CanonicalUserPrincipal

      @Stability(Stable) public CanonicalUserPrincipal(@NotNull String canonicalUserId)
      canonicalUserId - unique identifier assigned by AWS for every account. This parameter is required.
  • Method Details

    • dedupeString

      @Stability(Stable) @Nullable public String dedupeString()
      Return whether or not this principal is equal to the given principal.
      Specified by:
      dedupeString in interface IComparablePrincipal
      Specified by:
      dedupeString in class PrincipalBase
    • toString

      @Stability(Stable) @NotNull public String toString()
      Returns a string representation of an object.
      toString in class PrincipalBase
    • getCanonicalUserId

      @Stability(Stable) @NotNull public String getCanonicalUserId()
      unique identifier assigned by AWS for every account.

      root user and IAM users for an account all see the same ID. (i.e. 79a59df900b949e55d96a1e698fbacedfd6e09d98eacf8f8d5218e7cd47ef2be)

    • getPolicyFragment

      @Stability(Stable) @NotNull public PrincipalPolicyFragment getPolicyFragment()
      Return the policy fragment that identifies this principal in a Policy.
      Specified by:
      getPolicyFragment in interface IPrincipal
      Specified by:
      getPolicyFragment in class PrincipalBase