Condition operators are available though the Operator
class. First import it along with the Statement
:
.. tabs:: .. code-tab:: ts // for use without AWS CDK use the iam-floyd package import { Operator, Statement } from 'iam-floyd'; // for use with CDK use the cdk-iam-floyd package import { Operator, Statement } from 'cdk-iam-floyd'; .. code-tab:: js // for use without AWS CDK use the iam-floyd package const { Operator, Statement } = require('iam-floyd'); // for use with CDK use the cdk-iam-floyd package const { Operator, Statement } = require('cdk-iam-floyd');
Operators can be simple strings such as StringEquals
or get complex with modifiers such as ForAnyValue
or IfExists
. For simple operators you can use the static properties of the Operator
class:
.. example:: conditions-operator-simple
Complex operators can be generated by instantiating the Operator
class and calling its methods:
.. example:: conditions-operator-all-values
.. example:: conditions-operator-any-value
.. example:: conditions-operator-if-exists