@Generated(value="jsii-pacmak/1.63.2 (build a8a8833)", date="2022-08-09T19:16:32.768Z") public class AccountPrincipal extends ArnPrincipal
Example:
DatabaseCluster cluster = DatabaseCluster.Builder.create(this, "Cluster") .vpc(vpc) .instanceType(InstanceType.R5_LARGE) .iamAuthentication(true) .build(); Role role = Role.Builder.create(this, "DBRole").assumedBy(new AccountPrincipal(this.account)).build(); cluster.grantConnect(role);
IAssumeRolePrincipal.Jsii$Default
IComparablePrincipal.Jsii$Default
Modifier | Constructor and Description |
---|---|
protected |
AccountPrincipal(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
AccountPrincipal(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getAccountId()
AWS account ID (i.e.
|
java.lang.String |
getPrincipalAccount()
The AWS account ID of this principal.
|
java.lang.String |
toString()
Returns a string representation of an object.
|
dedupeString, getArn, getPolicyFragment, inOrganization
addToAssumeRolePolicy, addToPolicy, addToPrincipalPolicy, getAssumeRoleAction, getGrantPrincipal, toJSON, withConditions, withSessionTags
protected AccountPrincipal(software.amazon.jsii.JsiiObjectRef objRef)
protected AccountPrincipal(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public java.lang.String toString()
toString
in class ArnPrincipal
public java.lang.Object getAccountId()
public java.lang.String getPrincipalAccount()
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.
getPrincipalAccount
in interface IPrincipal
getPrincipalAccount
in class PrincipalBase