@Generated(value="jsii-pacmak/1.73.0 (build 6faeda3)",
date="2023-01-25T18:28:57.821Z")
public class PrincipalPolicyFragment
extends software.amazon.jsii.JsiiObject
This consists of the JSON used in the "Principal" field, and optionally a set of "Condition"s that need to be applied to the policy.
Generally, a principal looks like:
{ '<TYPE>': ['ID', 'ID', ...] }
And this is also the type of the field principalJson
. However, there is a
special type of principal that is just the string '*', which is treated
differently by some services. To represent that principal, principalJson
should contain { 'LiteralString': ['*'] }
.
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; PrincipalPolicyFragment principalPolicyFragment = new PrincipalPolicyFragment(Map.of( "principalJsonKey", List.of("principalJson")), Map.of( "conditionsKey", conditions));
Modifier | Constructor and Description |
---|---|
|
PrincipalPolicyFragment(java.util.Map<java.lang.String,java.util.List<java.lang.String>> principalJson,
java.util.Map<java.lang.String,java.lang.Object> conditions) |
protected |
PrincipalPolicyFragment(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
PrincipalPolicyFragment(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
getConditions()
The conditions under which the policy is in effect.
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getPrincipalJson()
JSON of the "Principal" section in a policy statement.
|
protected PrincipalPolicyFragment(software.amazon.jsii.JsiiObjectRef objRef)
protected PrincipalPolicyFragment(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public PrincipalPolicyFragment(java.util.Map<java.lang.String,java.util.List<java.lang.String>> principalJson, java.util.Map<java.lang.String,java.lang.Object> conditions)
principalJson
- JSON of the "Principal" section in a policy statement. This parameter is required.conditions
- The conditions under which the policy is in effect.public java.util.Map<java.lang.String,java.lang.Object> getConditions()
See the IAM documentation. conditions that need to be applied to this policy
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getPrincipalJson()