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(object) | Specify AWS account ID as the principal entity in a policy to delegate authority to the account. |
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(object)
Specify AWS account ID as the principal entity in a policy to delegate authority to the account.
public AccountPrincipal(object accountId)
Parameters
- accountId object
AWS account ID (i.e. '123456789012').
Remarks
ExampleMetadata: infused
Properties
AccountId
AWS account ID (i.e. '123456789012').
public virtual object AccountId { get; }
Property Value
Remarks
ExampleMetadata: infused
PrincipalAccount
The AWS account ID of this principal.
public override string? PrincipalAccount { get; }
Property Value
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
Overrides
Remarks
ExampleMetadata: infused