@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:39.713Z") @Stability(value=Stable) 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();
// 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");
software.amazon.jsii.JsiiObject.InitializationModeIAssumeRolePrincipal.Jsii$DefaultIComparablePrincipal.Jsii$Default| Modifier | Constructor and Description |
|---|---|
protected |
AccountPrincipal(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
AccountPrincipal(software.amazon.jsii.JsiiObjectRef objRef) |
|
AccountPrincipal(Object accountId) |
| Modifier and Type | Method and Description |
|---|---|
Object |
getAccountId()
AWS account ID (i.e.
|
String |
getPrincipalAccount()
The AWS account ID of this principal.
|
String |
toString()
Returns a string representation of an object.
|
dedupeString, getArn, getPolicyFragment, inOrganizationaddToAssumeRolePolicy, addToPolicy, addToPrincipalPolicy, getAssumeRoleAction, getGrantPrincipal, toJSON, withConditions, withSessionTagsprotected AccountPrincipal(software.amazon.jsii.JsiiObjectRef objRef)
protected AccountPrincipal(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public AccountPrincipal(@NotNull
Object accountId)
accountId - AWS account ID (i.e. 123456789012). This parameter is required.@Stability(value=Stable) @NotNull public String toString()
toString in class ArnPrincipal@Stability(value=Stable) @NotNull public Object getAccountId()
@Stability(value=Stable) @Nullable public 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 IPrincipalgetPrincipalAccount in class PrincipalBaseCopyright © 2022. All rights reserved.