Class AnyPrincipal
A principal representing all AWS identities in all accounts.
Inherited Members
Namespace: Amazon.CDK.AWS.IAM
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class AnyPrincipal : ArnPrincipal, IAssumeRolePrincipal, IComparablePrincipal, IPrincipal, IGrantable
Syntax (vb)
Public Class AnyPrincipal Inherits ArnPrincipal Implements IAssumeRolePrincipal, IComparablePrincipal, IPrincipal, IGrantable
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
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 }
}));
Synopsis
Constructors
| AnyPrincipal() | A principal representing all AWS identities in all accounts. |
Methods
| ToString() | Returns a string representation of an object. |
Constructors
AnyPrincipal()
A principal representing all AWS identities in all accounts.
public AnyPrincipal()
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
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 }
}));
Methods
ToString()
Returns a string representation of an object.
public override string ToString()
Returns
Overrides
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