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

Methods

NameAccessible byRequired Params
create_resourceINSERTName, ExecutionRole, ResourceType, PolicyDetails, ResourceSelection, 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,
arn,
name,
description,
status,
execution_role,
resource_type,
policy_details,
resource_selection,
tags
FROM aws.imagebuilder.lifecycle_policies
WHERE region = 'us-east-1';

Gets all properties from an individual lifecycle_policy.

SELECT
region,
arn,
name,
description,
status,
execution_role,
resource_type,
policy_details,
resource_selection,
tags
FROM aws.imagebuilder.lifecycle_policies
WHERE region = 'us-east-1' AND data__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 aws.imagebuilder.lifecycle_policies (
Name,
ExecutionRole,
ResourceType,
PolicyDetails,
ResourceSelection,
region
)
SELECT
'{{ Name }}',
'{{ ExecutionRole }}',
'{{ ResourceType }}',
'{{ PolicyDetails }}',
'{{ ResourceSelection }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.imagebuilder.lifecycle_policies
WHERE data__Identifier = '<Arn>'
AND region = 'us-east-1';

Permissions

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

Create

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

Update

iam:PassRole,
imagebuilder:GetLifecyclePolicy,
imagebuilder:UpdateLifecyclePolicy

Read

imagebuilder:GetLifecyclePolicy

Delete

imagebuilder:GetLifecyclePolicy,
imagebuilder:DeleteLifecyclePolicy,
imagebuilder:UnTagResource

List

imagebuilder:ListLifecyclePolicies