Skip to main content

patch_baselines

Creates, updates, deletes, gets or lists a patch_baselines resource.

Overview

Namepatch_baselines
TypeResource
Idaws.ssm.patch_baselines

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
approval_rulesobjectA set of rules defining the approval rules for a patch baseline.
approved_patchesarrayA list of explicitly approved patches for the baseline.
approved_patches_compliance_levelstringReturns the specified compliance severity level for approved patches in the patch baseline. (CRITICAL, HIGH, MEDIUM, LOW, INFORMATIONAL, UNSPECIFIED)
approved_patches_enable_non_securitybooleanIndicates 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.
available_security_updates_compliance_statusstringIndicates the compliance status of managed nodes for which security-related patches are available but were not approved. This preference is specified when the CreatePatchBaseline or UpdatePatchBaseline commands are run. Applies to Windows Server managed nodes only. (COMPLIANT, NON_COMPLIANT)
baseline_idstringThe ID of the retrieved patch baseline. (pattern: <code>^[a-zA-Z0-9_-:/]{20,128}$</code>)
created_datestring (date-time)The date the patch baseline was created.
descriptionstringA description of the patch baseline.
global_filtersobjectA set of patch filters, typically used for approval rules.
modified_datestring (date-time)The date the patch baseline was last modified.
namestringThe name of the patch baseline. (pattern: <code>^[a-zA-Z0-9_-.]{3,128}$</code>)
operating_systemstringReturns the operating system specified for the patch baseline. (WINDOWS, AMAZON_LINUX, AMAZON_LINUX_2, AMAZON_LINUX_2022, UBUNTU, REDHAT_ENTERPRISE_LINUX, SUSE, CENTOS, ORACLE_LINUX, DEBIAN, MACOS, RASPBIAN, ROCKY_LINUX, ALMA_LINUX, AMAZON_LINUX_2023)
patch_groupsarrayPatch groups included in the patch baseline.
rejected_patchesarrayA list of explicitly rejected patches for the baseline.
rejected_patches_actionstringThe action specified to take on patches included in the RejectedPatches 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. (ALLOW_AS_DEPENDENCY, BLOCK)
sourcesarrayInformation about the patches to use to update the managed nodes, including target operating systems and source repositories. Applies to Linux managed nodes only.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_patch_baselineselectregionRetrieves information about a patch baseline.
describe_patch_baselinesselectregionLists the patch baselines in your Amazon Web Services account.
create_patch_baselineinsertregionCreates a patch baseline. For information about valid key-value pairs in PatchFilters for each supported operating system type, see PatchFilter.
update_patch_baselineupdateregion, BaselineIdModifies an existing patch baseline. Fields not specified in the request are left unchanged. For information about valid key-value pairs in PatchFilters for each supported operating system type, see PatchFilter.
delete_patch_baselinedeleteregionDeletes a patch baseline.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Retrieves information about a patch baseline.

SELECT
approval_rules,
approved_patches,
approved_patches_compliance_level,
approved_patches_enable_non_security,
available_security_updates_compliance_status,
baseline_id,
created_date,
description,
global_filters,
modified_date,
name,
operating_system,
patch_groups,
rejected_patches,
rejected_patches_action,
sources
FROM aws.ssm.patch_baselines
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a patch baseline. For information about valid key-value pairs in PatchFilters for each supported operating system type, see PatchFilter.

INSERT INTO aws.ssm.patch_baselines (
OperatingSystem,
Name,
GlobalFilters,
ApprovalRules,
ApprovedPatches,
ApprovedPatchesComplianceLevel,
ApprovedPatchesEnableNonSecurity,
RejectedPatches,
RejectedPatchesAction,
Description,
Sources,
AvailableSecurityUpdatesComplianceStatus,
ClientToken,
Tags,
region
)
SELECT
'{{ OperatingSystem }}',
'{{ Name }}',
'{{ GlobalFilters }}',
'{{ ApprovalRules }}',
'{{ ApprovedPatches }}',
'{{ ApprovedPatchesComplianceLevel }}',
{{ ApprovedPatchesEnableNonSecurity }},
'{{ RejectedPatches }}',
'{{ RejectedPatchesAction }}',
'{{ Description }}',
'{{ Sources }}',
'{{ AvailableSecurityUpdatesComplianceStatus }}',
'{{ ClientToken }}',
'{{ Tags }}',
'{{ region }}'
RETURNING
baseline_id
;

UPDATE examples

Modifies an existing patch baseline. Fields not specified in the request are left unchanged. For information about valid key-value pairs in PatchFilters for each supported operating system type, see PatchFilter.

UPDATE aws.ssm.patch_baselines
SET
BaselineId = '{{ BaselineId }}',
Name = '{{ Name }}',
GlobalFilters = '{{ GlobalFilters }}',
ApprovalRules = '{{ ApprovalRules }}',
ApprovedPatches = '{{ ApprovedPatches }}',
ApprovedPatchesComplianceLevel = '{{ ApprovedPatchesComplianceLevel }}',
ApprovedPatchesEnableNonSecurity = {{ ApprovedPatchesEnableNonSecurity }},
RejectedPatches = '{{ RejectedPatches }}',
RejectedPatchesAction = '{{ RejectedPatchesAction }}',
Description = '{{ Description }}',
Sources = '{{ Sources }}',
AvailableSecurityUpdatesComplianceStatus = '{{ AvailableSecurityUpdatesComplianceStatus }}',
Replace = {{ Replace }}
WHERE
region = '{{ region }}' --required
AND BaselineId = '{{ BaselineId }}' --required
RETURNING
approval_rules,
approved_patches,
approved_patches_compliance_level,
approved_patches_enable_non_security,
available_security_updates_compliance_status,
baseline_id,
created_date,
description,
global_filters,
modified_date,
name,
operating_system,
rejected_patches,
rejected_patches_action,
sources;

DELETE examples

Deletes a patch baseline.

DELETE FROM aws.ssm.patch_baselines
WHERE region = '{{ region }}' --required
;