Skip to content

aws.ssm.get_deployable_patch_snapshot_for_instance

Example SQL Queries

SELECT * FROM
aws.ssm.get_deployable_patch_snapshot_for_instance
WHERE
"instance_id" = 'VALUE'
AND "snapshot_id" = 'VALUE';

Description

Retrieves the current snapshot for the patch baseline the managed node uses. This API is primarily used by the AWS-RunPatchBaseline Systems Manager document (SSM document).

If you run the command locally, such as with the Command Line Interface (CLI), the system attempts to use your local Amazon Web Services credentials and the operation fails. To avoid this, you can run the command in the Amazon Web Services Systems Manager console. Use Run Command, a capability of Amazon Web Services Systems Manager, with an SSM document that enables you to target a managed node with a script or command. For example, run the command using the AWS-RunShellScript document or the AWS-RunPowerShellScript document.

Table Definition

Column NameColumn Data Type
instance_id Required Input Column

The managed node ID.

VARCHAR
snapshot_id Required Input Column

The user-defined snapshot ID.

VARCHAR
baseline_override Input Column

Defines the basic information about a patch baseline override.

STRUCT(
"operating_system" VARCHAR,
"global_filters" STRUCT(
"patch_filters" STRUCT(
"key" VARCHAR,
"values" VARCHAR[]
)[]
),
"approval_rules" STRUCT(
"patch_rules" STRUCT(
"patch_filter_group" STRUCT(
"patch_filters" STRUCT(
"key" VARCHAR,
"values" VARCHAR[]
)[]
),
"compliance_level" VARCHAR,
"approve_after_days" BIGINT,
"approve_until_date" VARCHAR,
"enable_non_security" BOOLEAN
)[]
),
"approved_patches" VARCHAR[],
"approved_patches_compliance_level" VARCHAR,
"rejected_patches" VARCHAR[],
"rejected_patches_action" VARCHAR,
"approved_patches_enable_non_security" BOOLEAN,
"sources" STRUCT(
"name" VARCHAR,
"products" VARCHAR[],
"configuration" VARCHAR
)[]
)
Show child fields
baseline_override.approval_rules

A set of rules defining the approval rules for a patch baseline.

Show child fields
baseline_override.approval_rules.patch_rules[]
Show child fields
baseline_override.approval_rules.patch_rules[].approve_after_days

The number of days after the release date of each patch matched by the rule that the patch is marked as approved in the patch baseline. For example, a value of 7 means that patches are approved seven days after they are released.

This parameter is marked as not required, but your request must include a value for either ApproveAfterDays or ApproveUntilDate.

Not supported for Debian Server or Ubuntu Server.

baseline_override.approval_rules.patch_rules[].approve_until_date

The cutoff date for auto approval of released patches. Any patches released on or before this date are installed automatically.

Enter dates in the format YYYY-MM-DD. For example, 2021-12-31.

This parameter is marked as not required, but your request must include a value for either ApproveUntilDate or ApproveAfterDays.

Not supported for Debian Server or Ubuntu Server.

baseline_override.approval_rules.patch_rules[].compliance_level

A compliance severity level for all approved patches in a patch baseline.

baseline_override.approval_rules.patch_rules[].enable_non_security

For managed nodes identified by the approval rule filters, enables a patch baseline to apply non-security updates available in the specified repository. The default value is false. Applies to Linux managed nodes only.

baseline_override.approval_rules.patch_rules[].patch_filter_group

The patch filter group that defines the criteria for the rule.

Show child fields
baseline_override.approval_rules.patch_rules[].patch_filter_group.patch_filters[]
Show child fields
baseline_override.approval_rules.patch_rules[].patch_filter_group.patch_filters[].key

The key for the filter.

Run the DescribePatchProperties command to view lists of valid keys for each operating system type.

baseline_override.approval_rules.patch_rules[].patch_filter_group.patch_filters[].values[]
baseline_override.approved_patches[]
baseline_override.approved_patches_compliance_level

Defines the compliance level for approved patches. When an approved patch is reported as missing, this value describes the severity of the compliance violation.

baseline_override.approved_patches_enable_non_security

Indicates whether the list of approved patches includes non-security updates that should be applied to the managed nodes. The default value is false. Applies to Linux managed nodes only.

baseline_override.global_filters

A set of patch filters, typically used for approval rules.

Show child fields
baseline_override.global_filters.patch_filters[]
Show child fields
baseline_override.global_filters.patch_filters[].key

The key for the filter.

Run the DescribePatchProperties command to view lists of valid keys for each operating system type.

baseline_override.global_filters.patch_filters[].values[]
baseline_override.operating_system

The operating system rule used by the patch baseline override.

baseline_override.rejected_patches[]
baseline_override.rejected_patches_action

The action for Patch Manager to take on patches included in the RejectedPackages list. A patch can be allowed only if it is a dependency of another package, or blocked entirely along with packages that include it as a dependency.

baseline_override.sources[]
Show child fields
baseline_override.sources[].configuration

The value of the yum repo configuration. For example:

[main]

name=MyCustomRepository

baseurl=https://my-custom-repository

enabled=1

For information about other options available for your yum repository configuration, see dnf.conf(5).

baseline_override.sources[].name

The name specified to identify the patch source.

baseline_override.sources[].products[]
_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.

_aws_region Input Column

The AWS region to use.

VARCHAR
product

Returns the specific operating system (for example Windows Server 2012 or Amazon Linux 2015.09) on the managed node for the specified patch snapshot.

VARCHAR
snapshot_download_url

A pre-signed Amazon Simple Storage Service (Amazon S3) URL that can be used to download the patch snapshot.

VARCHAR