AWS SDK for .NET Documentation
ConditionFactory Class
AmazonAmazon.Auth.AccessControlPolicyConditionFactory Did this page help you?   Yes   No    Tell us about it...
A factory for creating conditions to be used in the policy.
Declaration Syntax
C#
public class ConditionFactory
Members
All MembersMethodsFields



IconMemberDescription
CURRENT_TIME_CONDITION_KEY
Condition key for the current time.

This condition key should only be used with ConditionFactory..::..DateComparisonType enum.


EPOCH_TIME_CONDITION_KEY
Condition key for the current time, in epoch seconds.

This condition key should only be used with ConditionFactory..::..NumericComparisonType enum. objects.


Equals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
GetHashCode()()()()
Serves as a hash function for a particular type.
(Inherited from Object.)
GetType()()()()
Gets the type of the current instance.
(Inherited from Object.)
NewCannedACLCondition(S3CannedACL)
Constructs a new access policy condition that compares an Amazon S3 canned ACL with the canned ACL specified by an incoming request.

You can use this condition to ensure that any objects uploaded to an Amazon S3 bucket have a specific canned ACL set.


NewCondition(ConditionFactory..::..ArnComparisonType, String, String)
Constructs a new access control policy condition that compares ARNs (Amazon Resource Names).

NewCondition(String, Boolean)
Constructs a new access policy condition that performs a boolean comparison.

NewCondition(ConditionFactory..::..DateComparisonType, DateTime)
Constructs a new access policy condition that compares the current time (on the AWS servers) to the specified date.

NewCondition(ConditionFactory..::..IpAddressComparisonType, String)
Constructs a new access policy condition that compares the source IP address of the incoming request to an AWS service against the specified CIDR range. When the condition evaluates to true (i.e. when the incoming source IP address is within the CIDR range or not) depends on the specified IpAddressComparisonType.

NewCondition(ConditionFactory..::..NumericComparisonType, String, String)
Constructs a new access policy condition that compares two numbers.

NewCondition(ConditionFactory..::..StringComparisonType, String, String)
Constructs a new access control policy condition that compares two strings.

NewEndpointCondition(String)
Constructs a new access policy condition that compares the requested endpoint used to subscribe to an Amazon SNS topic with the specified endpoint pattern. The endpoint pattern may optionally contain the multi-character wildcard (*) or the single-character wildcard (?).

For example, this condition can restrict subscriptions to a topic to email addresses in a certain domain ("*@my-company.com").

CopyC#
Policy policy = new Policy("MyTopicPolicy");
policy.WithStatements(new Statement(Statement.StatementEffect.Allow)
       .WithPrincipals(new Principal("*")).WithActionIdentifiers(SNSActionIdentifiers.Subscribe)
       .WithResources(new Resource(myTopicArn))
       .WithConditions(ConditionFactory.NewEndpointCondition("*@my-company.com")));

NewIpAddressCondition(String)
Constructs a new access policy condition that compares the source IP address of the incoming request to an AWS service against the specified CIDR range. The condition evaluates to true (meaning the policy statement containing it will be applied) if the incoming source IP address is within that range.

To achieve the opposite effect (i.e. cause the condition to evaluate to true when the incoming source IP is not in the specified CIDR range) use the alternate constructor form and specify IpAddressComparisonType.NotIpAddress.


NewProtocolCondition(String)
Constructs a new AWS access control policy condition that allows an access control statement to restrict subscriptions to an Amazon SNS topic based on the protocol being used for the subscription. For example, this condition can restrict subscriptions to a topic to endpoints using HTTPS to ensure that messages are securely delivered.

NewSecureTransportCondition()()()()
Constructs a new access control policy condition that tests if the incoming request was sent over a secure transport (HTTPS).

NewSourceArnCondition(String)
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.

CopyC#
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)));

REFERRER_CONDITION_KEY
Condition key for the referrer specified by a request.

This condition key should only be used with ConditionFactory..::..StringComparisonType objects.


S3_CANNED_ACL_CONDITION_KEY
Condition key for the canned ACL specified by a request.

This condition key may only be used with ConditionFactory..::..StringComparisonType enum.


S3_COPY_SOURCE_CONDITION_KEY
Condition key for the source object specified by a request to copy an object.

This condition key may only be used with ConditionFactory..::..StringComparisonType enum.


S3_DELIMITER_CONDITION_KEY
Condition key for the delimiter specified by a request.

This condition key may only be used with ConditionFactory..::..StringComparisonType enum.


S3_LOCATION_CONSTRAINT_CONDITION_KEY
Condition key for the location constraint specified by a request.

This condition key may only be used with ConditionFactory..::..StringComparisonType enum.


S3_MAX_KEYS_CONDITION_KEY
Condition key for the max keys specified by a request.

This condition key may only be used with ConditionFactory..::..StringComparisonType enum.


S3_METADATA_DIRECTIVE_CONDITION_KEY
Condition key for the metadata directive specified by a request to copy an object.

This condition key may only be used with ConditionFactory..::..StringComparisonType enum.


S3_PREFIX_CONDITION_KEY
Condition key for the prefix specified by a request.

This condition key may only be used with ConditionFactory..::..StringComparisonType enum.


S3_VERSION_ID_CONDITION_KEY
Condition key for the version ID of an object version specified by a request.

This condition key may only be used with ConditionFactory..::..StringComparisonType enum.


SECURE_TRANSPORT_CONDITION_KEY
Condition key for whether or not an incoming request is using a secure transport to make the request (i.e. HTTPS instead of HTTP).

This condition key should only be used with the boolean overload of NewCondition.


SNS_ENDPOINT_CONDITION_KEY
Condition key for The URL, e-mail address, or ARN from a Subscribe request or a previously confirmed subscription. Use with string conditions to restrict access to specific endpoints (e.g., *@mycompany.com).

This condition key may only be used with ConditionFactory..::..StringComparisonType enum.


SNS_PROTOCOL_CONDITION_KEY
Condition key for the protocol value from a Subscribe request or a previously confirmed subscription. Use with string conditions to restrict publication to specific delivery protocols (e.g., HTTPS).

This condition key may only be used with ConditionFactory..::..StringComparisonType enum.


SOURCE_ARN_CONDITION_KEY
Condition key for the Amazon Resource Name (ARN) of the source specified in a request. The source ARN indicates which resource is affecting the resource listed in your policy. For example, an SNS topic is the source ARN when publishing messages from the topic to an SQS queue.

This condition key should only be used with ConditionFactory..::..ArnComparisonType enum.


SOURCE_IP_CONDITION_KEY
Condition key for the source IP from which a request originates.

This condition key should only be used with ConditionFactory..::..IpAddressComparisonType enum.


ToString()()()()
Returns a string that represents the current object.
(Inherited from Object.)
USER_AGENT_CONDITION_KEY
Condition key for the user agent included in a request.

This condition key should only be used with ConditionFactory..::..StringComparisonType enum.


Inheritance Hierarchy
Object
ConditionFactory

Assembly: AWSSDK (Module: AWSSDK) Version: 1.5.60.0 (1.5.60.0)