@Generated(value="jsii-pacmak/1.63.2 (build a8a8833)", date="2022-08-08T20:48:14.009Z") @Stability(value=Stable) 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.InitializationMode
IAssumeRolePrincipal.Jsii$Default
IComparablePrincipal.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)
Add a condition to the principal.
|
void |
addConditions(Map<String,Object> conditions)
Adds multiple conditions to the principal.
|
Boolean |
addToPolicy(PolicyStatement statement)
Add to the policy of this principal.
|
AddToPrincipalPolicyResult |
addToPrincipalPolicy(PolicyStatement statement)
Add to the policy of this principal.
|
protected String |
appendDedupe(String append)
Append the given string to the wrapped principal's dedupe string (if available).
|
String |
dedupeString()
Return whether or not this principal is equal to the given principal.
|
String |
getAssumeRoleAction()
When this Principal is used in an AssumeRole policy, the action to use.
|
Map<String,Object> |
getConditions()
The conditions under which the policy is in effect.
|
PrincipalPolicyFragment |
getPolicyFragment()
Return the policy fragment that identifies this principal in a Policy.
|
String |
getPrincipalAccount()
The AWS account ID of this principal.
|
Map<String,List<String>> |
toJSON()
JSON-ify the principal.
|
String |
toString()
Returns a string representation of an object.
|
addToAssumeRolePolicy, getGrantPrincipal, withConditions, withSessionTags
protected PrincipalWithConditions(software.amazon.jsii.JsiiObjectRef objRef)
protected PrincipalWithConditions(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable) public PrincipalWithConditions(@NotNull IPrincipal principal, @NotNull Map<String,Object> conditions)
principal
- This parameter is required.conditions
- This parameter is required.@Stability(value=Stable) public void addCondition(@NotNull String key, @NotNull Object value)
key
- This parameter is required.value
- This parameter is required.@Stability(value=Stable) 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=Stable) @NotNull public Boolean addToPolicy(@NotNull PolicyStatement statement)
addToPolicy
in class PrincipalBase
statement
- This parameter is required.@Stability(value=Stable) @NotNull public AddToPrincipalPolicyResult addToPrincipalPolicy(@NotNull PolicyStatement statement)
addToPrincipalPolicy
in interface IPrincipal
addToPrincipalPolicy
in class PrincipalBase
statement
- This parameter is required.@Stability(value=Stable) @Nullable protected String appendDedupe(@NotNull String append)
append
- This parameter is required.@Stability(value=Stable) @Nullable public String dedupeString()
dedupeString
in interface IComparablePrincipal
dedupeString
in class PrincipalBase
@Stability(value=Stable) @NotNull public Map<String,List<String>> toJSON()
Used when JSON.stringify() is called
toJSON
in class PrincipalBase
@Stability(value=Stable) @NotNull public String toString()
toString
in class PrincipalBase
@Stability(value=Stable) @NotNull public String getAssumeRoleAction()
getAssumeRoleAction
in interface IPrincipal
getAssumeRoleAction
in class PrincipalBase
@Stability(value=Stable) @NotNull public Map<String,Object> getConditions()
@Stability(value=Stable) @NotNull public PrincipalPolicyFragment getPolicyFragment()
getPolicyFragment
in interface IPrincipal
getPolicyFragment
in class PrincipalBase
@Stability(value=Stable) @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 IPrincipal
getPrincipalAccount
in class PrincipalBase
Copyright © 2022. All rights reserved.