簡體   English   中英

如何在 CloudFormation 中使用預定義的 SSM Windows 補丁基線

[英]How to use pre-defined SSM Windows patch baselines in CloudFormation

我正在 CloudFormation 中創建 Systems Manager 補丁基准,以自動為我的 Windows EC2 實例應用操作系統更新:

  Windows2016PatchBaseline:
    Type: AWS::SSM::PatchBaseline
    Properties:
      Name: Windows2016PatchBaseline
      Description: Baseline containing all updates approved for Windows 2016 instances
      OperatingSystem: WINDOWS
      PatchGroups:
      - Windows Server 2016 Base   
      ApprovalRules:
        PatchRules:
        - PatchFilterGroup:
            PatchFilters:
            - Values:
              - Critical
              - Important
              - Moderate
              Key: MSRC_SEVERITY
            - Values:
              - SecurityUpdates
              - CriticalUpdates
              Key: CLASSIFICATION
            - Values:
              - WindowsServer2016
              Key: PRODUCT
          ApproveAfterDays: 7
          ComplianceLevel: CRITICAL

但是,我可以看到有一個預定義的基線可以完成大部分配置。 我想使用這個預定義的基線而不是創建自己的基線,但我在 CloudFormation 的AWS::SSM::PatchBaseline不到任何使用它的方法。

以前有沒有人這樣做過,或者它可能只能通過控制台獲得?

這是您要查找的內容:

  MaintenanceWindowRunCommandTask:
    Type: 'AWS::SSM::MaintenanceWindowTask'
    Properties:
      WindowId: !Ref MaintenanceWindow
      Targets:
        - Key: WindowTargetIds
          Values:
            - !Ref MaintenanceWindowTarget
      TaskArn: AWS-RunPatchBaseline
      TaskType: RUN_COMMAND
      TaskInvocationParameters:
        MaintenanceWindowRunCommandParameters:
          DocumentHash: 945ae15356b0f6ba7bce2a738101b8822cedef3bf5c027abc3bb9023aaec8b1b
          DocumentHashType: Sha256
          NotificationConfig:
            NotificationArn: !Ref MaintenanceTargetSNSARN
            NotificationEvents: 
              - All
            NotificationType: Command
          OutputS3BucketName: !Ref MaintenanceRunCommandS3Bucket
          OutputS3KeyPrefix: !Ref MaintenanceRunCommandS3BucketPrefix

看看我在這里的 SystemsManager 模板: https://github.com/Talderon/AWS_CloudFormation/tree/master/SystemsManager

查看我的 repo 中的 WIKI 頁面,因為我也記錄了那里的所有內容。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM