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
DescriptionResource schema for AWS::ImageBuilder::LifecyclePolicy
Idawscc.imagebuilder.lifecycle_policies

Fields

NameDatatypeDescription
arnstringThe Amazon Resource Name (ARN) of the lifecycle policy.
namestringThe name of the lifecycle policy.
descriptionstringThe description of the lifecycle policy.
statusstringThe status of the lifecycle policy.
execution_rolestringThe execution role of the lifecycle policy.
resource_typestringThe resource type of the lifecycle policy.
policy_detailsarrayThe policy details of the lifecycle policy.
resource_selectionobjectThe resource selection of the lifecycle policy.
tagsobjectThe tags associated with the lifecycle policy.
regionstringAWS region.

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

Methods

NameResourceAccessible byRequired Params
create_resourcelifecycle_policiesINSERTName, ExecutionRole, ResourceType, PolicyDetails, ResourceSelection, 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,
arn,
name,
description,
status,
execution_role,
resource_type,
policy_details,
resource_selection,
tags
FROM awscc.imagebuilder.lifecycle_policies
WHERE
region = 'us-east-1' AND
Identifier = '{{ arn }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.imagebuilder.lifecycle_policies (
Name,
ExecutionRole,
ResourceType,
PolicyDetails,
ResourceSelection,
region
)
SELECT
'{{ name }}',
'{{ execution_role }}',
'{{ resource_type }}',
'{{ policy_details }}',
'{{ resource_selection }}',
'{{ region }}';

UPDATE example

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

/*+ update */
UPDATE awscc.imagebuilder.lifecycle_policies
SET PatchDocument = string('{{ {
"Description": description,
"Status": status,
"ExecutionRole": execution_role,
"ResourceType": resource_type,
"PolicyDetails": policy_details,
"ResourceSelection": resource_selection,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';

DELETE example

/*+ delete */
DELETE FROM awscc.imagebuilder.lifecycle_policies
WHERE
Identifier = '{{ arn }}' AND
region = 'us-east-1';

Permissions

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

iam:PassRole,
imagebuilder:CreateLifecyclePolicy,
imagebuilder:GetLifecyclePolicy,
imagebuilder:TagResource