AWS opensearch-service documentation change
Summary
Updated documentation for data lifecycle policies with improved explanations, added console UI instructions, restructured sections (merged 'Creating' and 'Viewing' sections), and enhanced CLI examples
Security assessment
Changes focus on documentation clarity, user workflow improvements, and added console instructions. No mention of security vulnerabilities, patches, or new security controls. The 'Required permissions' section remains informational about existing IAM requirements without introducing new security features.
Diff
diff --git a/opensearch-service/latest/developerguide/serverless-lifecycle.md b/opensearch-service/latest/developerguide/serverless-lifecycle.md index bc88b3464..8bd472b17 100644 --- a//opensearch-service/latest/developerguide/serverless-lifecycle.md +++ b//opensearch-service/latest/developerguide/serverless-lifecycle.md @@ -5 +5 @@ -Data lifecycle policiesPermissions requiredPolicy precedencePolicy syntaxCreating data lifecycle policies (AWS CLI)Viewing data lifecycle policiesUpdating data lifecycle policiesDeleting data lifecycle policies +Data lifecycle policiesRequired permissionsPolicy precedencePolicy syntaxCreating data lifecycle policiesUpdating data lifecycle policiesDeleting data lifecycle policies @@ -9 +9 @@ Data lifecycle policiesPermissions requiredPolicy precedencePolicy syntaxCreatin -A data lifecycle policy for an Amazon OpenSearch Serverless _time series_ collection determines the lifespan of the data in that collection. OpenSearch Serverless retains the data for the period of time that you configure. +A data lifecycle policy in Amazon OpenSearch Serverless defines how long OpenSearch Serverless retains data in a time series collection. For example, you can set a policy to retain log data for 30 days before OpenSearch Serverless deletes it. @@ -11 +11 @@ A data lifecycle policy for an Amazon OpenSearch Serverless _time series_ collec -You can configure a separate data lifecycle policy for each index of each _time series_ collection in your AWS account. OpenSearch Serverless retains documents in indexes for, at minimum, the retention period you configure in the policy. It then automatically deletes them on a best-effort basis, typically within 48 hours or 10% of the retention period, whichever is longer. +You can configure a separate policy for each index within each time series collection in your AWS account. OpenSearch Serverless retains documents for at least the duration that you specify in the policy. It then deletes the documents automatically on a best-effort basis, typically within 48 hours or 10% of the retention period, whichever is longer. @@ -13 +13 @@ You can configure a separate data lifecycle policy for each index of each _time -Only _time series_ collections support data lifecycle policies. They are not supported by _search_ or _vector search_ collections. +Only time series collections support data lifecycle policies. Search and vector search collections do not. @@ -19 +19 @@ Only _time series_ collections support data lifecycle policies. They are not sup - * Permissions required + * Required permissions @@ -25,3 +25 @@ Only _time series_ collections support data lifecycle policies. They are not sup - * Creating data lifecycle policies (AWS CLI) - - * Viewing data lifecycle policies + * Creating data lifecycle policies @@ -38 +36 @@ Only _time series_ collections support data lifecycle policies. They are not sup -In a data lifecycle policy, you specify a series of _rules_. The data lifecycle policy lets you manage the retention period of data associated to indexes or collections that match these rules. These rules define the retention period for data in an index or group of indexes. Each rule consists of a resource type (`index`), a retention period, and a list of resources (indexes) that the retention period applies to. +In a data lifecycle policy, you specify a series of rules. The data lifecycle policy lets you manage the retention period of data associated to indexes or collections that match these rules. These rules define the retention period for data in an index or group of indexes. Each rule consists of a resource type (`index`), a retention period, and a list of resources (indexes) that the retention period applies to. @@ -95 +93 @@ In the following sample policy rule, OpenSearch Serverless indefinitely retains -## Permissions required +## Required permissions @@ -182 +180,5 @@ Element | Description -The following are some examples: +In the following example, the first rule applies to all indexes under the `autoparts-inventory` pattern (`index/autoparts-inventory/*`) and requires data to be retained for at least 20 days before any actions, such as deletion or archiving, can occur. + +The second rule targets indexes matching the `auto*/gear` pattern (`index/auto*/gear`), setting a minimum retention period of 24 hours. + +The third rule applies specifically to the `tires` index and has no minimum retention period, meaning that data in this index can be deleted or archived immediately or based on other criteria. These rules help manage the retention of index data with varying retention times or no retention restrictions. @@ -211 +213,33 @@ The following are some examples: -## Creating data lifecycle policies (AWS CLI) +## Creating data lifecycle policies + +To create a data lifecycle policy, you define rules that manage the retention and deletion of your data based on specified criteria. + +###### To create a data lifecycle policy + + 1. Sign in to the Amazon OpenSearch Service console at [https://console.aws.amazon.com/aos/home](https://console.aws.amazon.com/aos/home). + + 2. In the left navigation pane, choose **Data lifecycle policies**. + + 3. Choose **Create data lifecycle policy**. + + 4. Enter a descriptive name for the policy. + + 5. For **Data lifecycle** , choose **Add** and select the collections and indexes for the policy. + +Start by choosing the collections to which the indexes belong. Then, either choose the index from the list or enter an index pattern. To select all collections as sources, enter an asterisk (`*`). + + 6. For **Data retention** , you can either choose to retain the data indefinitely, or deselect **Unlimited (never delete)** and specify a time period after which OpenSearch Serverless automatically deletes the data from Amazon S3. + + 7. Choose **Save** , then **Create**. + + + + +To create a data lifecycle policy using the AWS CLI, use the [create-lifecycle-policy](https://docs.aws.amazon.com/cli/latest/reference/opensearchserverless/create-lifecycle-policy.html) command with the following options: + + * `--name` – The name of the policy. + + * `--type` – The type of policy. Currently, the only available value is `retention`. + + * `--policy` – The data lifecycle policy. This parameter accepts both inline policies and .json files. You must encode inline policies as a JSON escaped string. To provide the policy in a file, use the format `--policy file://`my-policy`.json`. + @@ -213 +246,0 @@ The following are some examples: -To create a data lifecycle policy using the OpenSearch Serverless API operations, use the [CreateLifecyclePolicy](https://docs.aws.amazon.com/opensearch-service/latest/ServerlessAPIReference/API_CreateLifecyclePolicy.html) command. This command accepts both inline policies and .json files. Inline policies must be encoded as a JSON escaped string. @@ -215 +247,0 @@ To create a data lifecycle policy using the OpenSearch Serverless API operations -The following request creates a data lifecycle policy: @@ -223,3 +255 @@ The following request creates a data lifecycle policy: -To provide the policy in a JSON file, use the format `--policy file://`my-policy`.json` - -## Viewing data lifecycle policies +## Updating data lifecycle policies @@ -227 +257 @@ To provide the policy in a JSON file, use the format `--policy file://`my-policy -Before you create a collection, you might want to preview the existing data lifecycle policies in your account to see which one has a resource pattern that matches your collection's name. The following [ListLifecyclePolicies](https://docs.aws.amazon.com/opensearch-service/latest/ServerlessAPIReference/API_ListLifecyclePolicies.html) request lists all data lifecycle policies in your account: +To update a data lifecycle policy, you can modify existing rules to reflect changes in your data retention or deletion requirements. This allows you to adapt your policies as your data management needs evolve. @@ -228,0 +259 @@ Before you create a collection, you might want to preview the existing data life +There might be a few minutes of lag time between when you update the policy and when OpenSearch Serverless starts to enforce the new retention periods. @@ -230 +261 @@ Before you create a collection, you might want to preview the existing data life - aws opensearchserverless list-lifecycle-policies --type retention +###### To update a data lifecycle policy @@ -232 +263 @@ Before you create a collection, you might want to preview the existing data life -The request returns information about all configured data lifecycle policies. To view the pattern rules defined in the one specific policy, find the policy information in the contents of the `lifecyclePolicySummaries` element in the response. Note the `name` and `type` of this policy and use these properties in a [BatchGetLifecyclePolicy](https://docs.aws.amazon.com/opensearch-service/latest/ServerlessAPIReference/API_BatchGetLifecyclePolicy.html) request to receive a response with the following policy details: + 1. Sign in to the Amazon OpenSearch Service console at [https://console.aws.amazon.com/aos/home](https://console.aws.amazon.com/aos/home). @@ -233,0 +265 @@ The request returns information about all configured data lifecycle policies. To + 2. In the left navigation pane, choose **Data lifecycle policies**. @@ -235,11 +267 @@ The request returns information about all configured data lifecycle policies. To - { - "lifecyclePolicySummaries": [ - { - "type": "retention", - "name": "my-policy", - "policyVersion": "MTY2MzY5MTY1MDA3Ml8x", - "createdDate": 1663691650072, - "lastModifiedDate": 1663691650072 - } - ] - } + 3. Select the data lifecycle policy that you want to update, then choose **Edit**. @@ -247 +269 @@ The request returns information about all configured data lifecycle policies. To -To limit the results to policies that contain specific collections or indexes, you can include resource filters: + 4. Modify the policy using the visual editor or the JSON editor. @@ -248,0 +271 @@ To limit the results to policies that contain specific collections or indexes, y + 5. Choose **Save**. @@ -250 +272,0 @@ To limit the results to policies that contain specific collections or indexes, y - aws opensearchserverless list-lifecycle-policies --type retention --resources "index/autoparts-inventory/*" @@ -252 +273,0 @@ To limit the results to policies that contain specific collections or indexes, y -To view detailed information about a specific policy, use the [BatchGetLifecyclePolicy](https://docs.aws.amazon.com/opensearch-service/latest/ServerlessAPIReference/API_BatchGetLifecyclePolicy.html) command. @@ -254 +274,0 @@ To view detailed information about a specific policy, use the [BatchGetLifecycle -## Updating data lifecycle policies @@ -256 +276 @@ To view detailed information about a specific policy, use the [BatchGetLifecycle -When you modify a data lifecycle policy, all associated collections are impacted. To update a data lifecycle policy in the OpenSearch Serverless console, expand **Data lifecycle policies** , select the policy to modify, and choose **Edit**. Make your changes and choose **Save**. +To update a data lifecycle policy using the AWS CLI, use the [update-lifecycle-policy](https://docs.aws.amazon.com/cli/latest/reference/opensearchserverless/update-lifecycle-policy.html) command. @@ -258 +278 @@ When you modify a data lifecycle policy, all associated collections are impacted -To update a data lifecycle policy using the OpenSearch Serverless API, use the [UpdateLifecyclePolicy](https://docs.aws.amazon.com/opensearch-service/latest/ServerlessAPIReference/API_UpdateLifecyclePolicy.html) command. You must include a policy version in the request. You can retrieve the policy version by using the `ListLifecyclePolicies` or `BatchGetLifecyclePolicy` commands. Including the most recent policy version ensures that you don't inadvertently override a change made by someone else. +You must include the `--policy-version` parameter in the request. You can retrieve the policy version by using the [list-lifecycle-policies](https://docs.aws.amazon.com/cli/latest/reference/opensearchserverless/list-lifecycle-policies.html) or [batch-get-lifecycle-policy](https://docs.aws.amazon.com/cli/latest/reference/opensearchserverless/batch-get-lifecycle-policy.html) commands. We recommend including the most recent policy version to prevent accidentally overwriting changes made by others. @@ -260 +280 @@ To update a data lifecycle policy using the OpenSearch Serverless API, use the [ -The following request updates a data lifecycle policy with a new policy JSON document: +The following request updates a data lifecycle policy with a new policy JSON document. @@ -269,2 +288,0 @@ The following request updates a data lifecycle policy with a new policy JSON doc -There might be a few minutes of lag time between when you update the policy and when the new retention periods are enforced. - @@ -273 +291,7 @@ There might be a few minutes of lag time between when you update the policy and -When you delete a data lifecycle policy, it no longer applies to any matching indexes. To delete a policy in the OpenSearch Serverless console, select the policy and choose **Delete**. +When you delete a data lifecycle policy, OpenSearch Serverless no longer enforces it on any matching indexes. + +###### To delete a data lifecycle policy + + 1. Sign in to the Amazon OpenSearch Service console at [https://console.aws.amazon.com/aos/home](https://console.aws.amazon.com/aos/home). + + 2. In the left navigation pane, choose **Data lifecycle policies**. @@ -275 +299 @@ When you delete a data lifecycle policy, it no longer applies to any matching in -You can also use the [DeleteLifecyclePolicy](https://docs.aws.amazon.com/opensearch-service/latest/ServerlessAPIReference/API_DeleteLifecyclePolicy.html) command: + 3. Select the policy that you want to delete, then choose **Delete** and confirm deletion. @@ -278 +302,8 @@ You can also use the [DeleteLifecyclePolicy](https://docs.aws.amazon.com/opensea - aws opensearchserverless delete-lifecycle-policy --name my-policy --type retention + + +To delete a data lifecycle policy using the AWS CLI, use the [delete-lifecycle-policy](https://docs.aws.amazon.com/cli/latest/reference/opensearchserverless/delete-lifecycle-policy.html) command. + + + aws opensearchserverless delete-lifecycle-policy \ + --name my-policy \ + --type retention