

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# `AWS-PatchInstanceWithRollback`
<a name="automation-aws-patchinstancewithrollback"></a>

**描述**

使 EC2 实例符合适用的补丁基准。失败时对根卷进行回滚。

[运行此自动化（控制台）](https://console.aws.amazon.com/systems-manager/automation/execute/AWS-PatchInstanceWithRollback)

**文档类型**

自动化

**所有者**

Amazon

**平台**

Linux，macOS, Windows

**参数**
+ AutomationAssumeRole

  类型：字符串

  描述：（可选）允许 Systems Manager Automation 代表您执行操作 AWS Identity and Access Management (IAM) 角色的 Amazon 资源名称（ARN）。如果未指定角色，Systems Manager Automation 将使用启动此运行手册的用户的权限。
+ InstanceId

  类型：字符串

  描述：（必填） EC2 InstanceId ，我们对其应用补丁基线。
+ LambdaAssumeRole

  类型：字符串

  描述：（可选）允许 Automation 创建的 Lambda 代表您执行操作的角色的 ARN。如果未指定，将创建临时角色来运行 Lambda 函数。
+ ReportS3Bucket

  类型：字符串

  说明：（可选）过程期间生成的合规性报告的 Amazon S3 存储桶目标。

**文档步骤**


****  

| 步骤编号 | 步骤名称 | 自动化操作 | 
| --- | --- | --- | 
| 1 | createDocumentStack | `aws:createStack` | 
| 2 | IdentifyRootVolume | `aws:invokeLambdaFunction` | 
| 3 | PrePatchSnapshot | `aws:executeAutomation` | 
| 4 | installMissingUpdates | `aws:runCommand` | 
| 5 | SleepThruInstallation | `aws:invokeLambdaFunction` | 
| 6 | CheckCompliance | `aws:invokeLambdaFunction` | 
| 7 | SaveComplianceReportToS3 | `aws:invokeLambdaFunction` | 
| 8 | ReportSuccessOrFailure | `aws:invokeLambdaFunction` | 
| 9 | RestoreFromSnapshot | `aws:invokeLambdaFunction` | 
| 10 | DeleteSnapshot | `aws:invokeLambdaFunction` | 
| 11 | deleteCloudFormation模板 | `aws:deleteStack` | 

**输出**

IdentifyRootVolume. 有效载荷

PrePatchSnapshot。输出

SaveComplianceReportToS3. 有效载荷

RestoreFromSnapshot. 有效载荷

CheckCompliance. 有效载荷