Class ArnPrincipal
Specify a principal by the Amazon Resource Name (ARN).
Inherited Members
Namespace: Amazon.CDK.AWS.IAM
Assembly: Amazon.CDK.AWS.IAM.dll
Syntax (csharp)
public class ArnPrincipal : PrincipalBase, IAssumeRolePrincipal, IComparablePrincipal, IPrincipal, IGrantable
Syntax (vb)
Public Class ArnPrincipal
Inherits PrincipalBase
Implements IAssumeRolePrincipal, IComparablePrincipal, IPrincipal, IGrantable
Remarks
You can specify AWS accounts, IAM users, Federated SAML users, IAM roles, and specific assumed-role sessions. You cannot specify IAM groups or instance profiles as principals
See: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html
ExampleMetadata: infused
Examples
NetworkLoadBalancer networkLoadBalancer1;
NetworkLoadBalancer networkLoadBalancer2;
new VpcEndpointService(this, "EndpointService", new VpcEndpointServiceProps {
VpcEndpointServiceLoadBalancers = new [] { networkLoadBalancer1, networkLoadBalancer2 },
AcceptanceRequired = true,
AllowedPrincipals = new [] { new ArnPrincipal("arn:aws:iam::123456789012:root") }
});
Synopsis
Constructors
ArnPrincipal(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
ArnPrincipal(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
ArnPrincipal(String) |
Properties
Arn | Amazon Resource Name (ARN) of the principal entity (i.e. arn:aws:iam::123456789012:user/user-name). |
PolicyFragment | Return the policy fragment that identifies this principal in a Policy. |
Methods
DedupeString() | Return whether or not this principal is equal to the given principal. |
InOrganization(String) | A convenience method for adding a condition that the principal is part of the specified AWS Organization. |
ToString() | Returns a string representation of an object. |
Constructors
ArnPrincipal(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected ArnPrincipal(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
ArnPrincipal(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected ArnPrincipal(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
ArnPrincipal(String)
public ArnPrincipal(string arn)
Parameters
- arn System.String
Amazon Resource Name (ARN) of the principal entity (i.e. arn:aws:iam::123456789012:user/user-name).
Properties
Arn
Amazon Resource Name (ARN) of the principal entity (i.e. arn:aws:iam::123456789012:user/user-name).
public virtual string Arn { get; }
Property Value
System.String
PolicyFragment
Return the policy fragment that identifies this principal in a Policy.
public override PrincipalPolicyFragment PolicyFragment { get; }
Property Value
Overrides
Methods
DedupeString()
Return whether or not this principal is equal to the given principal.
public override string DedupeString()
Returns
System.String
Overrides
InOrganization(String)
A convenience method for adding a condition that the principal is part of the specified AWS Organization.
public virtual PrincipalBase InOrganization(string organizationId)
Parameters
- organizationId System.String
Returns
ToString()
Returns a string representation of an object.
public override string ToString()
Returns
System.String