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
Idawscc.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.

For more information, see AWS::OpenSearchServerless::LifecyclePolicy.

Methods

NameResourceAccessible byRequired Params
create_resourcelifecycle_policiesINSERTType, Name, Policy, region
delete_resourcelifecycle_policiesDELETEIdentifier, region
update_resourcelifecycle_policiesUPDATEIdentifier, PatchDocument, region
list_resourceslifecycle_policies_list_onlySELECTregion
get_resourcelifecycle_policiesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual lifecycle_policy.

SELECT
region,
name,
type,
description,
policy
FROM awscc.opensearchserverless.lifecycle_policies
WHERE
region = 'us-east-1' AND
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 awscc.opensearchserverless.lifecycle_policies (
Name,
Type,
Policy,
region
)
SELECT
'{{ name }}',
'{{ type }}',
'{{ policy }}',
'{{ region }}';

UPDATE example

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

/*+ update */
UPDATE awscc.opensearchserverless.lifecycle_policies
SET PatchDocument = string('{{ {
"Description": description,
"Policy": policy
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ type }}|{{ name }}';

DELETE example

/*+ delete */
DELETE FROM awscc.opensearchserverless.lifecycle_policies
WHERE
Identifier = '{{ type }}|{{ name }}' AND
region = 'us-east-1';

Permissions

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

aoss:CreateLifecyclePolicy