Class AccountRootPrincipal
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
software.amazon.awscdk.services.iam.AccountRootPrincipal
- All Implemented Interfaces:
IAssumeRolePrincipal
,IComparablePrincipal
,IGrantable
,IPrincipal
,software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)",
date="2024-10-05T03:43:44.360Z")
@Stability(Stable)
public class AccountRootPrincipal
extends AccountPrincipal
Use the AWS account into which a stack is deployed as the principal entity in a policy.
Example:
Bucket bucket = new Bucket(this, "MyBucket"); AddToResourcePolicyResult result = bucket.addToResourcePolicy( PolicyStatement.Builder.create() .actions(List.of("s3:GetObject")) .resources(List.of(bucket.arnForObjects("file.txt"))) .principals(List.of(new AccountRootPrincipal())) .build());
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.iam.IAssumeRolePrincipal
IAssumeRolePrincipal.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.iam.IComparablePrincipal
IComparablePrincipal.Jsii$Default
-
Constructor Summary
ModifierConstructorDescriptionprotected
AccountRootPrincipal
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
AccountRootPrincipal
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Methods inherited from class software.amazon.awscdk.services.iam.AccountPrincipal
getAccountId, getPrincipalAccount
Methods inherited from class software.amazon.awscdk.services.iam.ArnPrincipal
dedupeString, getArn, getPolicyFragment, inOrganization
Methods inherited from class software.amazon.awscdk.services.iam.PrincipalBase
addToAssumeRolePolicy, addToPolicy, addToPrincipalPolicy, getAssumeRoleAction, getGrantPrincipal, toJSON, withConditions, withSessionTags
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
AccountRootPrincipal
protected AccountRootPrincipal(software.amazon.jsii.JsiiObjectRef objRef) -
AccountRootPrincipal
protected AccountRootPrincipal(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
AccountRootPrincipal
@Stability(Stable) public AccountRootPrincipal()
-
-
Method Details
-
toString
Returns a string representation of an object.- Overrides:
toString
in classAccountPrincipal
-