Index policies
A policy is a set of rules that describes how to manage an index. You can work with policies using the OpenSearch Index State Management (ISM)
In a policy, you define:
-
States the index can be in. You can name states according to your preference. Each policy must have at least one state.
-
Actions to perform when the index enters a particular state. Actions are performed in the order they are listed.
In Managed Service for OpenSearch, in addition to standard OpenSearch actions
, you can also modify the index codec. -
Transitions are conditions for the index to switch to a different state. Transitions are checked in the order they are listed.
For example, you can set up a policy that will make the index read_only in 30 days and delete it in 90 days. You can also configure a policy that notifies you when the index is deleted.
Each policy must have at least one state. Actions and transitions are optional. If no transition conditions are specified, the index will switch states unconditionally the moment the check takes place.
Once a policy is created and linked to the index, the ISM plugin creates a job that checks the index transition conditions and performs the policy actions. By default, the job is performed every 5 minutes.
For more information about policies, see the OpenSearch documentation