@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:39.714Z") @Stability(value=Stable) 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());
software.amazon.jsii.JsiiObject.InitializationModeIAssumeRolePrincipal.Jsii$DefaultIComparablePrincipal.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 |
|---|---|
String |
toString()
Returns a string representation of an object.
|
dedupeString, getArn, getPolicyFragment, inOrganizationaddToAssumeRolePolicy, addToPolicy, addToPrincipalPolicy, getAssumeRoleAction, getGrantPrincipal, getPrincipalAccount, toJSON, withConditions, withSessionTagsprotected AnyPrincipal(software.amazon.jsii.JsiiObjectRef objRef)
protected AnyPrincipal(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable) public AnyPrincipal()
@Stability(value=Stable) @NotNull public String toString()
toString in class ArnPrincipalCopyright © 2022. All rights reserved.