Class AccountPrincipal
Specify AWS account ID as the principal entity in a policy to delegate authority to the account.
Inherited Members
Namespace: Amazon.CDK.AWS.IAM
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class AccountPrincipal : ArnPrincipal, IAssumeRolePrincipal, IComparablePrincipal, IPrincipal, IGrantable
Syntax (vb)
Public Class AccountPrincipal
Inherits ArnPrincipal
Implements IAssumeRolePrincipal, IComparablePrincipal, IPrincipal, IGrantable
Remarks
ExampleMetadata: infused
Examples
var cluster = new DatabaseCluster(this, "Cluster", new DatabaseClusterProps {
Vpc = vpc,
InstanceType = InstanceType.R5_LARGE,
IamAuthentication = true
});
var role = new Role(this, "DBRole", new RoleProps { AssumedBy = new AccountPrincipal(Account) });
// Use one of the following statements to grant the role the necessary permissions
cluster.GrantConnect(role); // Grant the role neptune-db:* access to the DB
cluster.Grant(role, "neptune-db:ReadDataViaQuery", "neptune-db:WriteDataViaQuery");
Synopsis
Constructors
AccountPrincipal(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
AccountPrincipal(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
AccountPrincipal(Object) |
Properties
AccountId | AWS account ID (i.e. '123456789012'). |
PrincipalAccount | The AWS account ID of this principal. |
Methods
ToString() | Returns a string representation of an object. |
Constructors
AccountPrincipal(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected AccountPrincipal(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
AccountPrincipal(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected AccountPrincipal(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
AccountPrincipal(Object)
public AccountPrincipal(object accountId)
Parameters
- accountId System.Object
AWS account ID (i.e. '123456789012').
Properties
AccountId
AWS account ID (i.e. '123456789012').
public virtual object AccountId { get; }
Property Value
System.Object
PrincipalAccount
The AWS account ID of this principal.
public override string PrincipalAccount { get; }
Property Value
System.String
Overrides
Remarks
Can be undefined when the account is not known (for example, for service principals). Can be a Token - in that case, it's assumed to be AWS::AccountId.
Methods
ToString()
Returns a string representation of an object.
public override string ToString()
Returns
System.String