Class UnknownPrincipal
A principal for use in resources that need to have a role but it's unknown.
Inheritance
Namespace: Amazon.CDK.AWS.IAM
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class UnknownPrincipal : DeputyBase, IPrincipal, IGrantable
Syntax (vb)
Public Class UnknownPrincipal
Inherits DeputyBase
Implements IPrincipal, IGrantable
Remarks
Some resources have roles associated with them which they assume, such as Lambda Functions, CodeBuild projects, StepFunctions machines, etc.
When those resources are imported, their actual roles are not always imported with them. When that happens, we use an instance of this class instead, which will add user warnings when statements are attempted to be added to it.
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;
using Constructs;
Construct construct;
var unknownPrincipal = new UnknownPrincipal(new UnknownPrincipalProps {
Resource = construct
});
Synopsis
Constructors
UnknownPrincipal(IUnknownPrincipalProps) | |
UnknownPrincipal(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
UnknownPrincipal(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
AssumeRoleAction | When this Principal is used in an AssumeRole policy, the action to use. |
GrantPrincipal | The principal to grant permissions to. |
PolicyFragment | Return the policy fragment that identifies this principal in a Policy. |
Methods
AddToPolicy(PolicyStatement) | Add to the policy of this principal. |
AddToPrincipalPolicy(PolicyStatement) | Add to the policy of this principal. |
Constructors
UnknownPrincipal(IUnknownPrincipalProps)
UnknownPrincipal(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected UnknownPrincipal(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
UnknownPrincipal(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected UnknownPrincipal(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
AssumeRoleAction
When this Principal is used in an AssumeRole policy, the action to use.
public virtual string AssumeRoleAction { get; }
Property Value
System.String
GrantPrincipal
The principal to grant permissions to.
public virtual IPrincipal GrantPrincipal { get; }
Property Value
PolicyFragment
Return the policy fragment that identifies this principal in a Policy.
public virtual PrincipalPolicyFragment PolicyFragment { get; }
Property Value
Methods
AddToPolicy(PolicyStatement)
Add to the policy of this principal.
public virtual bool AddToPolicy(PolicyStatement statement)
Parameters
- statement PolicyStatement
Returns
System.Boolean
AddToPrincipalPolicy(PolicyStatement)
Add to the policy of this principal.
public virtual IAddToPrincipalPolicyResult AddToPrincipalPolicy(PolicyStatement statement)
Parameters
- statement PolicyStatement
Returns