Class UnknownPrincipal
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.iam.UnknownPrincipal
- All Implemented Interfaces:
IGrantable
,IPrincipal
,software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.106.0 (build e852934)",
date="2025-02-12T12:32:03.977Z")
@Stability(Stable)
public class UnknownPrincipal
extends software.amazon.jsii.JsiiObject
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.
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();
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.iam.IPrincipal
IPrincipal.Jsii$Default, IPrincipal.Jsii$Proxy
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
UnknownPrincipal
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
UnknownPrincipal
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionaddToPolicy
(PolicyStatement statement) Add to the policy of this principal.addToPrincipalPolicy
(PolicyStatement statement) Add to the policy of this principal.When this Principal is used in an AssumeRole policy, the action to use.The principal to grant permissions to.Return the policy fragment that identifies this principal in a Policy.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.awscdk.services.iam.IPrincipal
getPrincipalAccount
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
UnknownPrincipal
protected UnknownPrincipal(software.amazon.jsii.JsiiObjectRef objRef) -
UnknownPrincipal
protected UnknownPrincipal(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
UnknownPrincipal
- Parameters:
props
- This parameter is required.
-
-
Method Details
-
addToPolicy
Add to the policy of this principal.- Parameters:
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 interfaceIPrincipal
- Parameters:
statement
- This parameter is required.
-
getAssumeRoleAction
When this Principal is used in an AssumeRole policy, the action to use.- Specified by:
getAssumeRoleAction
in interfaceIPrincipal
-
getGrantPrincipal
The principal to grant permissions to.- Specified by:
getGrantPrincipal
in interfaceIGrantable
-
getPolicyFragment
Return the policy fragment that identifies this principal in a Policy.- Specified by:
getPolicyFragment
in interfaceIPrincipal
-