Class AccountPrincipal
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.iam.PrincipalBase
software.amazon.awscdk.services.iam.ArnPrincipal
software.amazon.awscdk.services.iam.AccountPrincipal
- All Implemented Interfaces:
IAssumeRolePrincipal,IComparablePrincipal,IGrantable,IPrincipal,software.amazon.jsii.JsiiSerializable
- Direct Known Subclasses:
AccountRootPrincipal
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:29:57.219Z")
@Stability(Stable)
public class AccountPrincipal
extends ArnPrincipal
Specify AWS account ID as the principal entity in a policy to delegate authority to the account.
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);
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.iam.IAssumeRolePrincipal
IAssumeRolePrincipal.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.iam.IComparablePrincipal
IComparablePrincipal.Jsii$Default -
Constructor Summary
ConstructorsModifierConstructorDescriptionAccountPrincipal(Object accountId) protectedAccountPrincipal(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedAccountPrincipal(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionAWS account ID (i.e.The AWS account ID of this principal.toString()Returns a string representation of an object.Methods inherited from class software.amazon.awscdk.services.iam.ArnPrincipal
dedupeString, getArn, getPolicyFragment, inOrganizationMethods inherited from class software.amazon.awscdk.services.iam.PrincipalBase
addToAssumeRolePolicy, addToPolicy, addToPrincipalPolicy, getAssumeRoleAction, getGrantPrincipal, toJSON, withConditions, withSessionTagsMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
AccountPrincipal
protected AccountPrincipal(software.amazon.jsii.JsiiObjectRef objRef) -
AccountPrincipal
protected AccountPrincipal(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
AccountPrincipal
- Parameters:
accountId- AWS account ID (i.e. 123456789012). This parameter is required.
-
-
Method Details
-
toString
Returns a string representation of an object.- Overrides:
toStringin classArnPrincipal
-
getAccountId
AWS account ID (i.e. 123456789012). -
getPrincipalAccount
The AWS account ID of this principal.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.
- Specified by:
getPrincipalAccountin interfaceIPrincipal- Overrides:
getPrincipalAccountin classPrincipalBase
-