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 = '{{ region }}' 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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.imagebuilder.lifecycle_policies
WHERE
Identifier = '{{ arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

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

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