@Generated(value="jsii-pacmak/1.58.0 (build f8ba112)", date="2022-05-27T16:27:55.463Z") public class UnknownPrincipal extends software.amazon.jsii.JsiiObject implements IPrincipal
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.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.iam.*; import software.constructs.*; Construct construct; UnknownPrincipal unknownPrincipal = UnknownPrincipal.Builder.create() .resource(construct) .build();
Modifier and Type | Class and Description |
---|---|
static class |
UnknownPrincipal.Builder
A fluent builder for
UnknownPrincipal . |
IPrincipal.Jsii$Default, IPrincipal.Jsii$Proxy
Modifier | Constructor and Description |
---|---|
protected |
UnknownPrincipal(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
UnknownPrincipal(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.Boolean |
addToPolicy(PolicyStatement statement)
Add to the policy of this principal.
|
AddToPrincipalPolicyResult |
addToPrincipalPolicy(PolicyStatement statement)
Add to the policy of this principal.
|
java.lang.String |
getAssumeRoleAction()
When this Principal is used in an AssumeRole policy, the action to use.
|
IPrincipal |
getGrantPrincipal()
The principal to grant permissions to.
|
PrincipalPolicyFragment |
getPolicyFragment()
Return the policy fragment that identifies this principal in a Policy.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPrincipalAccount
protected UnknownPrincipal(software.amazon.jsii.JsiiObjectRef objRef)
protected UnknownPrincipal(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public java.lang.Boolean addToPolicy(PolicyStatement statement)
addToPolicy
in interface IPrincipal
statement
- This parameter is required.public AddToPrincipalPolicyResult addToPrincipalPolicy(PolicyStatement statement)
addToPrincipalPolicy
in interface IPrincipal
statement
- This parameter is required.public java.lang.String getAssumeRoleAction()
getAssumeRoleAction
in interface IPrincipal
public IPrincipal getGrantPrincipal()
getGrantPrincipal
in interface IGrantable
public PrincipalPolicyFragment getPolicyFragment()
getPolicyFragment
in interface IPrincipal