Class UnknownPrincipal

All Implemented Interfaces:
IGrantable, IPrincipal,

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-12T19:34:03.004Z") @Stability(Stable) public class UnknownPrincipal extends implements IPrincipal
A principal for use in resources that need to have a role but it's unknown.

Some resources have roles associated with them which they assume, such as Lambda Functions, CodeBuild projects, StepFunctions machines, etc.

When those resources are imported, their actual roles are not always imported with them. When that happens, we use an instance of this class instead, which will add user warnings when statements are attempted to be added to it.


 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.constructs.*;
 Construct construct;
 UnknownPrincipal unknownPrincipal = UnknownPrincipal.Builder.create()
  • Constructor Details

    • UnknownPrincipal

      protected UnknownPrincipal( objRef)
    • UnknownPrincipal

      protected UnknownPrincipal( initializationMode)
    • UnknownPrincipal

      @Stability(Stable) public UnknownPrincipal(@NotNull UnknownPrincipalProps props)
      props - This parameter is required.
  • Method Details

    • addToPolicy

      @Stability(Stable) @NotNull public Boolean addToPolicy(@NotNull PolicyStatement statement)
      Add to the policy of this principal.

      statement - This parameter is required.
    • addToPrincipalPolicy

      @Stability(Stable) @NotNull public AddToPrincipalPolicyResult addToPrincipalPolicy(@NotNull PolicyStatement statement)
      Add to the policy of this principal.

      Specified by:
      addToPrincipalPolicy in interface IPrincipal
      statement - This parameter is required.
    • getAssumeRoleAction

      @Stability(Stable) @NotNull public String getAssumeRoleAction()
      When this Principal is used in an AssumeRole policy, the action to use.
      Specified by:
      getAssumeRoleAction in interface IPrincipal
    • getGrantPrincipal

      @Stability(Stable) @NotNull public IPrincipal getGrantPrincipal()
      The principal to grant permissions to.
      Specified by:
      getGrantPrincipal in interface IGrantable
    • getPolicyFragment

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