Class AnyPrincipal
A principal representing all AWS identities in all accounts.
public class AnyPrincipal : ArnPrincipal, IAssumeRolePrincipal, IComparablePrincipal, IPrincipal, IGrantable
- Inheritance
-
AnyPrincipal
- Implements
- Derived
- Inherited Members
Examples
var topic = new Topic(this, "Topic");
var topicPolicy = new TopicPolicy(this, "TopicPolicy", new TopicPolicyProps {
Topics = new [] { topic }
});
topicPolicy.Document.AddStatements(new PolicyStatement(new PolicyStatementProps {
Actions = new [] { "sns:Subscribe" },
Principals = new [] { new AnyPrincipal() },
Resources = new [] { topic.TopicArn }
}));
Remarks
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.
ExampleMetadata: infused
Constructors
AnyPrincipal()
public AnyPrincipal()
Methods
ToString()
Returns a string representation of an object.
public override string ToString()