Class AccountPrincipal
Specify AWS account ID as the principal entity in a policy to delegate authority to the account.
public class AccountPrincipal : ArnPrincipal, IAssumeRolePrincipal, IComparablePrincipal, IPrincipal, IGrantable
- Inheritance
-
AccountPrincipal
- Implements
- Derived
- Inherited Members
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) });
cluster.GrantConnect(role);
Remarks
ExampleMetadata: infused
Constructors
AccountPrincipal(object)
public AccountPrincipal(object accountId)
Parameters
accountId
objectAWS account ID (i.e. 123456789012).
Properties
AccountId
AWS account ID (i.e. 123456789012).
public virtual object AccountId { get; }
Property Value
PrincipalAccount
The AWS account ID of this principal.
public override string? PrincipalAccount { get; }
Property Value
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()