我注册补丁基线与补丁组由AWS CLI和我得到一个错误,在主题中提到。
用于创建修补程序基线的命令如下:
baselineid=$(aws ssm create-patch-baseline --name "Test-NonProd-Baseline" --operating-system "WINDOWS" --tags "Key=Environment,Value=Production" --approval-rules "PatchRules=[{PatchFilterGroup={PatchFilters=[{Key=MSRC_SEVERITY,Values=[Critical,Important]},{Key=CLASSIFICATION,Values=[SecurityUpdates,Updates,ServicePacks,UpdateRollups,CriticalUpdates]}]},ApproveAfterDays=7}]" --description "Baseline containing all updates approved for production systems" --query BaselineId)然后,我使用上面的id向修补程序组注册补丁基线,如下所示
aws ssm register-patch-baseline-for-patch-group --baseline-id $baselineid --patch-group "Group A"不幸的是,我得到了下面的错误:
An error occurred (ValidationException) when calling the RegisterPatchBaselineForPatchGroup operation: 1 validation error detected: Value '"pb-08a507ce98777b410"' at 'baselineId' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-zA-Z0-9_\-:/]{20,128}$.注意:即使我在"$baslineid“旁边使用双引号,我也会得到相同的错误。
变量$baselineid有一个有效值,请参见下面的内容:
[ec2-user@ip-172-31-40-59 ~]$ echo $baselineid
"pb-08a507ce98777b410"想了解什么是问题,当我得到一个合法的价值,以及如何解决它。
发布于 2020-06-26 14:49:14
您也许可以在第二个命令中使用它,基本上可以使用tr实用程序来截断双qoutes:
echo $baselineid| tr -d '"'双引号问题的解决办法在这篇文章中有许多可能的解决办法:
因此,可能的解决方案命令可能如下所示:
aws ssm register-patch-baseline-for-patch-group --baseline-id $(echo $baselineid| tr -d '"') --patch-group "Group A"https://stackoverflow.com/questions/62589876
复制相似问题