Class AccountRootPrincipal
Use the AWS account into which a stack is deployed as the principal entity in a policy.
Inherited Members
Namespace: Amazon.CDK.AWS.IAM
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class AccountRootPrincipal : AccountPrincipal, IAssumeRolePrincipal, IComparablePrincipal, IPrincipal, IGrantable
Syntax (vb)
Public Class AccountRootPrincipal Inherits AccountPrincipal Implements IAssumeRolePrincipal, IComparablePrincipal, IPrincipal, IGrantable
Remarks
ExampleMetadata: infused
Examples
// Adds to IAM user's policy (not resource policy)
User user;
var table = new TableV2(this, "Table", new TablePropsV2 {
PartitionKey = new Attribute { Name = "pk", Type = AttributeType.STRING }
});
// Automatically adds to table's resource policy (same account)
table.GrantReadData(new AccountRootPrincipal());
table.GrantReadData(user);
Synopsis
Constructors
| AccountRootPrincipal() | Use the AWS account into which a stack is deployed as the principal entity in a policy. |
Methods
| ToString() | Returns a string representation of an object. |
Constructors
AccountRootPrincipal()
Use the AWS account into which a stack is deployed as the principal entity in a policy.
public AccountRootPrincipal()
Remarks
ExampleMetadata: infused
Examples
// Adds to IAM user's policy (not resource policy)
User user;
var table = new TableV2(this, "Table", new TablePropsV2 {
PartitionKey = new Attribute { Name = "pk", Type = AttributeType.STRING }
});
// Automatically adds to table's resource policy (same account)
table.GrantReadData(new AccountRootPrincipal());
table.GrantReadData(user);
Methods
ToString()
Returns a string representation of an object.
public override string ToString()
Returns
Overrides
Remarks
ExampleMetadata: infused