AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Constructs a new access policy condition that compares the Amazon Resource Name (ARN) of the source of an AWS resource that is modifying another AWS resource with the specified pattern.

For example, the source ARN could be an Amazon SNS topic ARN that is sending messages to an Amazon SQS queue. In that case, the SNS topic ARN would be compared the ARN pattern specified here.

The endpoint pattern may optionally contain the multi-character wildcard * (*) or the single-character wildcard (?). Each of the six colon-delimited components of the ARN is checked separately and each can include a wildcard.

Policy policy = new Policy("MyQueuePolicy");
policy.WithStatements(new Statement(Statement.StatementEffect.Allow)
    .WithPrincipals(new Principal("*")).WithActionIdentifiers(SQSActionIdentifiers.SendMessage)
    .WithResources(new Resource(myQueueArn))
    .WithConditions(ConditionFactory.NewSourceArnCondition(myTopicArn)));
             

Namespace: Amazon.Auth.AccessControlPolicy
Assembly: AWSSDK.Core.dll
Version: 3.x.y.z

Syntax

C#
public Condition NewSourceArnCondition(
         String arnPattern
)
Parameters
arnPattern
Type: System.String

The ARN pattern against which the source ARN will be compared. Each of the six colon-delimited components of the ARN is checked separately and each can include a wildcard.

Return Value
Type: Condition
A new access control policy condition that compares the ARN of the source specified in an incoming request with the ARN pattern specified here.

Version Information

.NET Standard:
Supported in: 1.3

.NET Framework:
Supported in: 4.5, 4.0, 3.5

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms

Unity:
Supported Versions: 4.6 and above
Supported Platforms: Android, iOS, Standalone