Class AnyPrincipal
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.iam.PrincipalBase
software.amazon.awscdk.services.iam.ArnPrincipal
software.amazon.awscdk.services.iam.AnyPrincipal
- All Implemented Interfaces:
IAssumeRolePrincipal
,IComparablePrincipal
,IGrantable
,IPrincipal
,software.amazon.jsii.JsiiSerializable
- Direct Known Subclasses:
Anyone
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:29:57.222Z")
@Stability(Stable)
public class AnyPrincipal
extends ArnPrincipal
A principal representing all AWS identities in all accounts.
Some services behave differently when you specify Principal: '*'
or Principal: { AWS: "*" }
in their resource policy.
AnyPrincipal
renders to Principal: { AWS: "*" }
. This is correct
most of the time, but in cases where you need the other principal,
use StarPrincipal
instead.
Example:
Topic topic = new Topic(this, "Topic"); TopicPolicy topicPolicy = TopicPolicy.Builder.create(this, "TopicPolicy") .topics(List.of(topic)) .build(); topicPolicy.document.addStatements(PolicyStatement.Builder.create() .actions(List.of("sns:Subscribe")) .principals(List.of(new AnyPrincipal())) .resources(List.of(topic.getTopicArn())) .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
AnyPrincipal
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
AnyPrincipal
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
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, getPrincipalAccount, 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
-
AnyPrincipal
protected AnyPrincipal(software.amazon.jsii.JsiiObjectRef objRef) -
AnyPrincipal
protected AnyPrincipal(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
AnyPrincipal
@Stability(Stable) public AnyPrincipal()
-
-
Method Details
-
toString
Returns a string representation of an object.- Overrides:
toString
in classArnPrincipal
-