@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:39.784Z") @Stability(value=Stable) 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 |
|---|---|
protected |
PrincipalPolicyFragment(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
PrincipalPolicyFragment(software.amazon.jsii.JsiiObjectRef objRef) |
|
PrincipalPolicyFragment(Map<String,List<String>> principalJson) |
|
PrincipalPolicyFragment(Map<String,List<String>> principalJson,
Map<String,Object> conditions) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,Object> |
getConditions()
The conditions under which the policy is in effect.
|
Map<String,List<String>> |
getPrincipalJson()
JSON of the "Principal" section in a policy statement.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected PrincipalPolicyFragment(software.amazon.jsii.JsiiObjectRef objRef)
protected PrincipalPolicyFragment(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public PrincipalPolicyFragment(@NotNull
Map<String,List<String>> principalJson,
@Nullable
Map<String,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.@Stability(value=Stable) @NotNull public Map<String,Object> getConditions()
See the IAM documentation. conditions that need to be applied to this policy
Copyright © 2022. All rights reserved.