@Generated(value="jsii-pacmak/1.58.0 (build f8ba112)", date="2022-05-27T16:27:55.332Z") public class AnyPrincipal extends ArnPrincipal
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());
IAssumeRolePrincipal.Jsii$Default
IComparablePrincipal.Jsii$Default
Modifier | Constructor and Description |
---|---|
|
AnyPrincipal() |
protected |
AnyPrincipal(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
AnyPrincipal(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
toString()
Returns a string representation of an object.
|
dedupeString, getArn, getPolicyFragment, inOrganization
addToAssumeRolePolicy, addToPolicy, addToPrincipalPolicy, getAssumeRoleAction, getGrantPrincipal, getPrincipalAccount, toJSON, withConditions, withSessionTags
protected AnyPrincipal(software.amazon.jsii.JsiiObjectRef objRef)
protected AnyPrincipal(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public AnyPrincipal()
public java.lang.String toString()
toString
in class ArnPrincipal