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.

AWS access control policy conditions are contained in Amazon.Auth.AccessControlPolicy.Statement objects, and affect when a statement is applied. For example, a statement that allows access to an Amazon SQS queue could use a condition to only apply the effect of that statement for requests that are made before a certain date, or that originate from a range of IP addresses.

Multiple conditions can be included in a single statement, and all conditions must evaluate to true in order for the statement to take effect.

The set of conditions is D in the statement "A has permission to do B to C where D applies."

A condition is composed of three parts: Condition Key The condition key declares which value of a request to pull in and compare against when a policy is evaluated by AWS. For example, using Amazon.Auth.AccessControlPolicy.ConditionFactory.SOURCE_IP_CONDITION_KEY will cause AWS to pull in the current request's source IP as the first value to compare against every time your policy is evaluated. Comparison Type This is a static value used as the second value in the comparison when your policy is evaluated. Depending on the comparison type, this value can optionally use wildcards. See the documentation for individual comparison types for more information. Comparison Value This is a static value used as the second value in the comparison when your policy is evaluated. Depending on the comparison type, this value can optionally use wildcards. See the documentation for individual comparison types for more information.

Inheritance Hierarchy

System.Object
  Amazon.Auth.AccessControlPolicy.Condition

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

Syntax

C#
public class Condition

The Condition type exposes the following members

Constructors

Properties

NameTypeDescription
Public Property ConditionKey System.String

Gets and Sets the name of the condition key involved in this condition. Condition keys are predefined values supported by AWS that provide input to a condition's evaluation, such as the current time, or the IP address of the incoming request.

Your policy is evaluated for each incoming request, and condition keys specify what information to pull out of those incoming requests and plug into the conditions in your policy.

Public Property Type System.String

Gets the type of this condition.

Public Property Values System.String[]

Gets and Sets the values specified for this access control policy condition. For example, in a condition that compares the incoming IP address of a request to a specified range of IP addresses, the range of IP addresses is the single value in the condition.

Most conditions accept only one value, but multiple values are possible.

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

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