Evaluate selector

Overview

The Evaluate Selector filter enables you to evaluate the contents of a specified selector expression, and return a boolean result. A selector is a special syntax that enables API Gateway configuration settings to be evaluated and expanded at runtime.

This filter enables you to evaluate a specified selector expression and make a decision in a policy based on whether the expression value fails or passes. For example, you could use the following expression to check if the user belongs to a particular group that allows the user to access a particular resource:

This expression checks if the memberOf attribute retrieved for the first user contains the specified value (in this case, membership of a particular group). If the expression matches, the filter passes.

Alternatively, you could use the following selector expression to check if the user email address is valid:

This expression checks if the mail attribute retrieved for the first user contains the specified value (in this case, a particular email address). If the expression matches, the filter passes.

For more details on selectors, see Select configuration values at runtime in the API Gateway Policy Developer Guide.

Configuration

Configure the following settings:

Name:
Enter a descriptive name for this filter to display in a policy.

Expression:
Enter the selector expression to be evaluated. Defaults to the following selector expression:

Related Links