Skip to main content

patch_baselines

Creates, updates, deletes or gets a patch_baseline resource or lists patch_baselines in a region

Overview

Namepatch_baselines
TypeResource
DescriptionResource Type definition for AWS::SSM::PatchBaseline
Idaws.ssm.patch_baselines

Fields

NameDatatypeDescription
idstringThe ID of the patch baseline.
default_baselinebooleanSet the baseline as default baseline. Only registering to default patch baseline is allowed.
operating_systemstringDefines the operating system the patch baseline applies to. The Default value is WINDOWS.
descriptionstringThe description of the patch baseline.
approval_rulesobjectA set of rules defining the approval rules for a patch baseline.
sourcesarrayInformation about the patches to use to update the instances, including target operating systems and source repository. Applies to Linux instances only.
namestringThe name of the patch baseline.
rejected_patchesarrayA list of explicitly rejected patches for the baseline.
approved_patchesarrayA list of explicitly approved patches for the baseline.
rejected_patches_actionstringThe action for Patch Manager to take on patches included in the RejectedPackages list.
patch_groupsarrayPatchGroups is used to associate instances with a specific patch baseline
approved_patches_compliance_levelstringDefines the compliance level for approved patches. This means that if an approved patch is reported as missing, this is the severity of the compliance violation. The default value is UNSPECIFIED.
approved_patches_enable_non_securitybooleanIndicates whether the list of approved patches includes non-security updates that should be applied to the instances. The default value is 'false'. Applies to Linux instances only.
global_filtersobjectA set of global filters used to include patches in the baseline.
tagsarrayOptional metadata that you assign to a resource. Tags enable you to categorize a resource in different ways.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTName, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all patch_baselines in a region.

SELECT
region,
id,
default_baseline,
operating_system,
description,
approval_rules,
sources,
name,
rejected_patches,
approved_patches,
rejected_patches_action,
patch_groups,
approved_patches_compliance_level,
approved_patches_enable_non_security,
global_filters,
tags
FROM aws.ssm.patch_baselines
WHERE region = 'us-east-1';

Gets all properties from an individual patch_baseline.

SELECT
region,
id,
default_baseline,
operating_system,
description,
approval_rules,
sources,
name,
rejected_patches,
approved_patches,
rejected_patches_action,
patch_groups,
approved_patches_compliance_level,
approved_patches_enable_non_security,
global_filters,
tags
FROM aws.ssm.patch_baselines
WHERE region = 'us-east-1' AND data__Identifier = '<Id>';

INSERT example

Use the following StackQL query and manifest file to create a new patch_baseline resource, using stack-deploy.

/*+ create */
INSERT INTO aws.ssm.patch_baselines (
Name,
region
)
SELECT
'{{ Name }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.ssm.patch_baselines
WHERE data__Identifier = '<Id>'
AND region = 'us-east-1';

Permissions

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

Create

ssm:CreatePatchBaseline,
ssm:RegisterPatchBaselineForPatchGroup,
ssm:AddTagsToResource,
ssm:RemoveTagsFromResource,
ssm:ListTagsForResource,
ssm:GetDefaultPatchBaseline,
ssm:RegisterDefaultPatchBaseline

Delete

ssm:DeletePatchBaseline,
ssm:GetPatchBaseline,
ssm:DeregisterPatchBaselineForPatchGroup

List

ssm:DescribePatchBaselines,
ssm:GetDefaultPatchBaseline,
ssm:GetPatchBaseline,
ssm:ListTagsForResource

Read

ssm:GetDefaultPatchBaseline,
ssm:GetPatchBaseline,
ssm:ListTagsForResource

Update

ssm:UpdatePatchBaseline,
ssm:DeregisterPatchBaselineForPatchGroup,
ssm:AddTagsToResource,
ssm:RemoveTagsFromResource,
ssm:ListTagsForResource,
ssm:GetDefaultPatchBaseline,
ssm:RegisterDefaultPatchBaseline