Class PrincipalPolicyFragment
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.iam.PrincipalPolicyFragment
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-22T02:24:02.815Z")
@Stability(Stable)
public class PrincipalPolicyFragment
extends software.amazon.jsii.JsiiObject
A collection of the fields in a PolicyStatement that can be used to identify a principal.
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));
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Constructor Summary
ModifierConstructorDescriptionPrincipalPolicyFragment
(Map<String, List<String>> principalJson) protected
PrincipalPolicyFragment
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
PrincipalPolicyFragment
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionThe conditions under which the policy is in effect.JSON of the "Principal" section in a policy statement.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.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
PrincipalPolicyFragment
protected PrincipalPolicyFragment(software.amazon.jsii.JsiiObjectRef objRef) -
PrincipalPolicyFragment
protected PrincipalPolicyFragment(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
PrincipalPolicyFragment
@Stability(Stable) public PrincipalPolicyFragment(@NotNull Map<String, List<String>> principalJson, @Nullable Map<String, Object> conditions) - Parameters:
principalJson
- JSON of the "Principal" section in a policy statement. This parameter is required.conditions
- The conditions under which the policy is in effect.
-
PrincipalPolicyFragment
- Parameters:
principalJson
- JSON of the "Principal" section in a policy statement. This parameter is required.
-
-
Method Details
-
getConditions
The conditions under which the policy is in effect.See the IAM documentation. conditions that need to be applied to this policy
-
getPrincipalJson
JSON of the "Principal" section in a policy statement.
-