Use RegisterDefaultPatchBaseline with a CLI - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use RegisterDefaultPatchBaseline with a CLI

The following code examples show how to use RegisterDefaultPatchBaseline.

CLI
AWS CLI

To set the default patch baseline

The following register-default-patch-baseline example registers the specified custom patch baseline as the default patch baseline for the operating system type that it supports.

aws ssm register-default-patch-baseline \ --baseline-id "pb-abc123cf9bEXAMPLE"

Output:

{ "BaselineId":"pb-abc123cf9bEXAMPLE" }

The following register-default-patch-baseline example registers the default patch baseline provided by AWS for CentOS as the default patch baseline.

aws ssm register-default-patch-baseline \ --baseline-id "arn:aws:ssm:us-east-2:733109147000:patchbaseline/pb-0574b43a65ea646ed"

Output:

{ "BaselineId":"pb-abc123cf9bEXAMPLE" }

For more information, see About Predefined and Custom Patch Baselines in the AWS Systems Manager User Guide.

PowerShell
Tools for PowerShell

Example 1: This example registers a patch baseline as the default patch baseline.

Register-SSMDefaultPatchBaseline -BaselineId "pb-03da896ca3b68b639"

Output:

pb-03da896ca3b68b639