Skip to content

aws.imagebuilder.get_lifecycle_policy

Example SQL Queries

SELECT * FROM
aws.imagebuilder.get_lifecycle_policy
WHERE
"lifecycle_policy_arn" = 'VALUE';

Description

Get details for the specified image lifecycle policy.

Table Definition

Column NameColumn Data Type
lifecycle_policy_arn Required Input Column

Specifies the Amazon Resource Name (ARN) of the image lifecycle policy resource to get.

VARCHAR
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

lifecycle_policy

The ARN of the image lifecycle policy resource that was returned.

STRUCT(
"arn" VARCHAR,
"name" VARCHAR,
"description" VARCHAR,
"status" VARCHAR,
"execution_role" VARCHAR,
"resource_type" VARCHAR,
"policy_details" STRUCT(
"action" STRUCT(
"type" VARCHAR,
"include_resources" STRUCT(
"amis" BOOLEAN,
"snapshots" BOOLEAN,
"containers" BOOLEAN
)
),
"filter" STRUCT(
"type" VARCHAR,
"value" BIGINT,
"unit" VARCHAR,
"retain_at_least" BIGINT
),
"exclusion_rules" STRUCT(
"tag_map" MAP(VARCHAR, VARCHAR),
"amis" STRUCT(
"is_public" BOOLEAN,
"regions" VARCHAR[],
"shared_accounts" VARCHAR[],
"last_launched" STRUCT(
"value" BIGINT,
"unit" VARCHAR
),
"tag_map" MAP(VARCHAR, VARCHAR)
)
)
)[],
"resource_selection" STRUCT(
"recipes" STRUCT(
"name" VARCHAR,
"semantic_version" VARCHAR
)[],
"tag_map" MAP(VARCHAR, VARCHAR)
),
"date_created" TIMESTAMP_S,
"date_updated" TIMESTAMP_S,
"date_last_run" TIMESTAMP_S,
"tags" MAP(VARCHAR, VARCHAR)
)
Show child fields
lifecycle_policy.arn

The Amazon Resource Name (ARN) of the lifecycle policy resource.

lifecycle_policy.date_created

The timestamp when Image Builder created the lifecycle policy resource.

lifecycle_policy.date_last_run

The timestamp for the last time Image Builder ran the lifecycle policy.

lifecycle_policy.date_updated

The timestamp when Image Builder updated the lifecycle policy resource.

lifecycle_policy.description

Optional description for the lifecycle policy.

lifecycle_policy.execution_role

The name or Amazon Resource Name (ARN) of the IAM role that Image Builder uses to run the lifecycle policy. This is a custom role that you create.

lifecycle_policy.name

The name of the lifecycle policy.

lifecycle_policy.policy_details[]
Show child fields
lifecycle_policy.policy_details[].action

Configuration details for the policy action.

Show child fields
lifecycle_policy.policy_details[].action.include_resources

Specifies the resources that the lifecycle policy applies to.

Show child fields
lifecycle_policy.policy_details[].action.include_resources.amis

Specifies whether the lifecycle action should apply to distributed AMIs.

lifecycle_policy.policy_details[].action.include_resources.containers

Specifies whether the lifecycle action should apply to distributed containers.

lifecycle_policy.policy_details[].action.include_resources.snapshots

Specifies whether the lifecycle action should apply to snapshots associated with distributed AMIs.

lifecycle_policy.policy_details[].action.type

Specifies the lifecycle action to take.

lifecycle_policy.policy_details[].exclusion_rules

Additional rules to specify resources that should be exempt from policy actions.

Show child fields
lifecycle_policy.policy_details[].exclusion_rules.amis

Lists configuration values that apply to AMIs that Image Builder should exclude from the lifecycle action.

Show child fields
lifecycle_policy.policy_details[].exclusion_rules.amis.is_public

Configures whether public AMIs are excluded from the lifecycle action.

lifecycle_policy.policy_details[].exclusion_rules.amis.last_launched

Specifies configuration details for Image Builder to exclude the most recent resources from lifecycle actions.

Show child fields
lifecycle_policy.policy_details[].exclusion_rules.amis.last_launched.unit

Defines the unit of time that the lifecycle policy uses to calculate elapsed time since the last instance launched from the AMI. For example: days, weeks, months, or years.

lifecycle_policy.policy_details[].exclusion_rules.amis.last_launched.value

The integer number of units for the time period. For example 6 (months).

lifecycle_policy.policy_details[].exclusion_rules.amis.regions[]
lifecycle_policy.policy_details[].exclusion_rules.amis.shared_accounts[]
lifecycle_policy.policy_details[].exclusion_rules.amis.tag_map

Lists tags that should be excluded from lifecycle actions for the AMIs that have them.

lifecycle_policy.policy_details[].exclusion_rules.tag_map

Contains a list of tags that Image Builder uses to skip lifecycle actions for Image Builder image resources that have them.

lifecycle_policy.policy_details[].filter

Specifies the resources that the lifecycle policy applies to.

Show child fields
lifecycle_policy.policy_details[].filter.retain_at_least

For age-based filters, this is the number of resources to keep on hand after the lifecycle DELETE action is applied. Impacted resources are only deleted if you have more than this number of resources. If you have fewer resources than this number, the impacted resource is not deleted.

lifecycle_policy.policy_details[].filter.type

Filter resources based on either age or count.

lifecycle_policy.policy_details[].filter.unit

Defines the unit of time that the lifecycle policy uses to determine impacted resources. This is required for age-based rules.

lifecycle_policy.policy_details[].filter.value

The number of units for the time period or for the count. For example, a value of 6 might refer to six months or six AMIs.

For count-based filters, this value represents the minimum number of resources to keep on hand. If you have fewer resources than this number, the resource is excluded from lifecycle actions.

lifecycle_policy.resource_selection

Resource selection criteria used to run the lifecycle policy.

Show child fields
lifecycle_policy.resource_selection.recipes[]
Show child fields
lifecycle_policy.resource_selection.recipes[].name

The name of an Image Builder recipe that the lifecycle policy uses for resource selection.

lifecycle_policy.resource_selection.recipes[].semantic_version

The version of the Image Builder recipe specified by the name field.

lifecycle_policy.resource_selection.tag_map

A list of tags that are used as selection criteria for the Image Builder image resources that the lifecycle policy applies to.

lifecycle_policy.resource_type

The type of resources the lifecycle policy targets.

lifecycle_policy.status

Indicates whether the lifecycle policy resource is enabled.

lifecycle_policy.tags

To help manage your lifecycle policy resources, you can assign your own metadata to each resource in the form of tags. Each tag consists of a key and an optional value, both of which you define.