lifecycle_policies
Creates, updates, deletes or gets a lifecycle_policy
resource or lists lifecycle_policies
in a region
Overview
Name | lifecycle_policies |
Type | Resource |
Description | Amazon OpenSearchServerless lifecycle policy resource |
Id | aws.opensearchserverless.lifecycle_policies |
Fields
Name | Datatype | Description |
---|---|---|
name | string | The name of the policy |
type | string | The type of lifecycle policy |
description | string | The description of the policy |
policy | string | The JSON policy document that is the content for the policy |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | Type, Name, Policy, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.opensearchserverless.lifecycle_policies (
Name,
Type,
Policy,
region
)
SELECT
'{{ Name }}',
'{{ Type }}',
'{{ Policy }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.opensearchserverless.lifecycle_policies (
Name,
Type,
Description,
Policy,
region
)
SELECT
'{{ Name }}',
'{{ Type }}',
'{{ Description }}',
'{{ Policy }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: lifecycle_policy
props:
- name: Name
value: '{{ Name }}'
- name: Type
value: '{{ Type }}'
- name: Description
value: '{{ Description }}'
- name: Policy
value: '{{ Policy }}'
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