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() | |
AnyPrincipal(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
AnyPrincipal(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
ToString() | Returns a string representation of an object. |
Constructors
AnyPrincipal()
public AnyPrincipal()
AnyPrincipal(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected AnyPrincipal(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
AnyPrincipal(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected AnyPrincipal(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
ToString()
Returns a string representation of an object.
public override string ToString()
Returns
System.String