Skip to main content

lifecycle_policies

Creates, updates, deletes or gets a lifecycle_policy resource or lists lifecycle_policies in a region

Overview

Namelifecycle_policies
TypeResource
DescriptionAmazon OpenSearchServerless lifecycle policy resource
Idaws.opensearchserverless.lifecycle_policies

Fields

NameDatatypeDescription
namestringThe name of the policy
typestringThe type of lifecycle policy
descriptionstringThe description of the policy
policystringThe JSON policy document that is the content for the policy
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTType, Name, Policy, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all lifecycle_policies in a region.

SELECT
region,
name,
type,
description,
policy
FROM aws.opensearchserverless.lifecycle_policies
WHERE region = 'us-east-1';

Gets all properties from an individual lifecycle_policy.

SELECT
region,
name,
type,
description,
policy
FROM aws.opensearchserverless.lifecycle_policies
WHERE region = 'us-east-1' AND data__Identifier = '<Type>|<Name>';

INSERT example

Use the following StackQL query and manifest file to create a new lifecycle_policy resource, using stack-deploy.

/*+ create */
INSERT INTO aws.opensearchserverless.lifecycle_policies (
Name,
Type,
Policy,
region
)
SELECT
'{{ Name }}',
'{{ Type }}',
'{{ Policy }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.opensearchserverless.lifecycle_policies
WHERE data__Identifier = '<Type|Name>'
AND region = 'us-east-1';

Permissions

To operate on the lifecycle_policies resource, the following permissions are required:

Create

aoss:CreateLifecyclePolicy

Read

aoss:BatchGetLifecyclePolicy

Update

aoss:UpdateLifecyclePolicy,
aoss:BatchGetLifecyclePolicy

Delete

aoss:DeleteLifecyclePolicy

List

aoss:ListLifecyclePolicies