Show / Hide Table of Contents

Class AccountPrincipal

Specify AWS account ID as the principal entity in a policy to delegate authority to the account.

Inheritance
object
PrincipalBase
ArnPrincipal
AccountPrincipal
AccountRootPrincipal
Implements
IAssumeRolePrincipal
IComparablePrincipal
IPrincipal
IGrantable
Inherited Members
ArnPrincipal.DedupeString()
ArnPrincipal.InOrganization(string)
ArnPrincipal.Arn
ArnPrincipal.PolicyFragment
PrincipalBase.AddToAssumeRolePolicy(PolicyDocument)
PrincipalBase.AddToPolicy(PolicyStatement)
PrincipalBase.AddToPrincipalPolicy(PolicyStatement)
PrincipalBase.ToJSON()
PrincipalBase.WithConditions(IDictionary<string, object>)
PrincipalBase.WithSessionTags()
PrincipalBase.AssumeRoleAction
PrincipalBase.GrantPrincipal
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

object

Remarks

ExampleMetadata: infused

PrincipalAccount

The AWS account ID of this principal.

public override string? PrincipalAccount { get; }
Property Value

string

Overrides
PrincipalBase.PrincipalAccount
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

string

Overrides
ArnPrincipal.ToString()
Remarks

ExampleMetadata: infused

Implements

IAssumeRolePrincipal
IComparablePrincipal
IPrincipal
IGrantable
Back to top Generated by DocFX