Class PrincipalPolicyFragment
A collection of the fields in a PolicyStatement that can be used to identify a principal.
Inheritance
Namespace: Amazon.CDK.AWS.IAM
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class PrincipalPolicyFragment : DeputyBase
Syntax (vb)
Public Class PrincipalPolicyFragment
Inherits DeputyBase
Remarks
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': ['
'] }.
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.IAM;
var conditions;
var principalPolicyFragment = new PrincipalPolicyFragment(new Dictionary<string, string[]> {
{ "principalJsonKey", new [] { "principalJson" } }
}, new Dictionary<string, object> {
{ "conditionsKey", conditions }
});
Synopsis
Constructors
PrincipalPolicyFragment(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
PrincipalPolicyFragment(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
PrincipalPolicyFragment(IDictionary<String, String[]>, IDictionary<String, Object>) |
Properties
Conditions | The conditions under which the policy is in effect. |
PrincipalJson | JSON of the "Principal" section in a policy statement. |
Constructors
PrincipalPolicyFragment(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected PrincipalPolicyFragment(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
PrincipalPolicyFragment(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected PrincipalPolicyFragment(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
PrincipalPolicyFragment(IDictionary<String, String[]>, IDictionary<String, Object>)
public PrincipalPolicyFragment(IDictionary<string, string[]> principalJson, IDictionary<string, object> conditions = null)
Parameters
- principalJson System.Collections.Generic.IDictionary<System.String, System.String[]>
JSON of the "Principal" section in a policy statement.
- conditions System.Collections.Generic.IDictionary<System.String, System.Object>
The conditions under which the policy is in effect.
Properties
Conditions
The conditions under which the policy is in effect.
public virtual IDictionary<string, object> Conditions { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Remarks
See the IAM documentation. conditions that need to be applied to this policy
PrincipalJson
JSON of the "Principal" section in a policy statement.
public virtual IDictionary<string, string[]> PrincipalJson { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String[]>