@Generated(value="jsii-pacmak/1.50.0 (build d1830a4)", date="2022-01-04T15:39:09.927Z") @Stability(value=Experimental) 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$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()
(experimental) Returns a string representation of an object.
|
getArn, getPolicyFragmentaddToAssumeRolePolicy, addToPolicy, addToPrincipalPolicy, getAssumeRoleAction, getGrantPrincipal, getPrincipalAccount, toJSON, withConditions, withSessionTagsjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected AnyPrincipal(software.amazon.jsii.JsiiObjectRef objRef)
protected AnyPrincipal(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental) public AnyPrincipal()
@Stability(value=Experimental) @NotNull public String toString()
toString in class ArnPrincipalCopyright © 2022. All rights reserved.