@Generated(value="jsii-pacmak/1.50.0 (build d1830a4)", date="2022-01-04T15:39:10.044Z") @Stability(value=Experimental) public class PrincipalWithConditions extends PrincipalBase
For more information about conditions, see: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html
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.*;
Object conditions;
IPrincipal principal;
PrincipalWithConditions principalWithConditions = new PrincipalWithConditions(principal, Map.of(
"conditionsKey", conditions));
software.amazon.jsii.JsiiObject.InitializationModeIAssumeRolePrincipal.Jsii$Default| Modifier | Constructor and Description |
|---|---|
|
PrincipalWithConditions(IPrincipal principal,
Map<String,Object> conditions) |
protected |
PrincipalWithConditions(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
PrincipalWithConditions(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCondition(String key,
Object value)
(experimental) Add a condition to the principal.
|
void |
addConditions(Map<String,Object> conditions)
(experimental) Adds multiple conditions to the principal.
|
Boolean |
addToPolicy(PolicyStatement statement)
(experimental) Add to the policy of this principal.
|
AddToPrincipalPolicyResult |
addToPrincipalPolicy(PolicyStatement statement)
(experimental) Add to the policy of this principal.
|
String |
getAssumeRoleAction()
(experimental) When this Principal is used in an AssumeRole policy, the action to use.
|
Map<String,Object> |
getConditions()
(experimental) The conditions under which the policy is in effect.
|
PrincipalPolicyFragment |
getPolicyFragment()
(experimental) Return the policy fragment that identifies this principal in a Policy.
|
String |
getPrincipalAccount()
(experimental) The AWS account ID of this principal.
|
Map<String,List<String>> |
toJSON()
(experimental) JSON-ify the principal.
|
String |
toString()
(experimental) Returns a string representation of an object.
|
addToAssumeRolePolicy, getGrantPrincipal, withConditions, withSessionTagsjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected PrincipalWithConditions(software.amazon.jsii.JsiiObjectRef objRef)
protected PrincipalWithConditions(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental)
public PrincipalWithConditions(@NotNull
IPrincipal principal,
@NotNull
Map<String,Object> conditions)
principal - This parameter is required.conditions - This parameter is required.@Stability(value=Experimental)
public void addCondition(@NotNull
String key,
@NotNull
Object value)
key - This parameter is required.value - This parameter is required.@Stability(value=Experimental)
public void addConditions(@NotNull
Map<String,Object> conditions)
Values from the conditions parameter will overwrite existing values with the same operator and key.
conditions - This parameter is required.@Stability(value=Experimental) @NotNull public Boolean addToPolicy(@NotNull PolicyStatement statement)
addToPolicy in interface IPrincipaladdToPolicy in class PrincipalBasestatement - This parameter is required.@Stability(value=Experimental) @NotNull public AddToPrincipalPolicyResult addToPrincipalPolicy(@NotNull PolicyStatement statement)
addToPrincipalPolicy in interface IPrincipaladdToPrincipalPolicy in class PrincipalBasestatement - This parameter is required.@Stability(value=Experimental) @NotNull public Map<String,List<String>> toJSON()
Used when JSON.stringify() is called
toJSON in class PrincipalBase@Stability(value=Experimental) @NotNull public String toString()
toString in class PrincipalBase@Stability(value=Experimental) @NotNull public String getAssumeRoleAction()
getAssumeRoleAction in interface IPrincipalgetAssumeRoleAction in class PrincipalBase@Stability(value=Experimental) @NotNull public Map<String,Object> getConditions()
@Stability(value=Experimental) @NotNull public PrincipalPolicyFragment getPolicyFragment()
getPolicyFragment in interface IPrincipalgetPolicyFragment in class PrincipalBase@Stability(value=Experimental) @Nullable public String getPrincipalAccount()
Can be undefined when the account is not known (for example, for service principals). Can be a Token - in that case, it's assumed to be AWS::AccountId.
getPrincipalAccount in interface IPrincipalgetPrincipalAccount in class PrincipalBaseCopyright © 2022. All rights reserved.