

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# `AWSSupport-RunEC2RescueForWindowsTool`
<a name="automation-awssupport-runec2rescueforwindowstool"></a>

 **説明** 

**AWSSupport-RunEC2RescueForWindowsTool** ランブックは、ターゲットの Amazon Elastic Compute Cloud (Amazon EC2) Windows マネージドインスタンスで Amazon EC2 Rescue for Windows Server トラブルシューティングツールを実行し、一般的な問題のトラブルシューティングに役立ちます。このランブックは、主に 3 つのアクションをサポートしています。
+ **ResetAccess**: ローカル管理者パスワードをリセットします。パスワードはランダムに生成され、 として AWS Systems Manager Parameter Store に安全に保存されます`/EC2Rescue/Password/<instance_id>`。パラメータを指定しない場合、パスワードは default AWS Key Management Service (AWS KMS) キー で暗号化されます`alias/aws/ssm`。必要に応じて、独自の AWS KMS キーでパスワードを暗号化するキー ID を指定できます。
+ **CollectLogs**: `/collect:all`オプションで Amazon EC2 Rescue を実行して、オペレーティングシステムからログと設定ファイルを収集し、アカウントの Amazon Simple Storage Service (Amazon S3) バケットにアップロードします。
+ **FixAll**: `/rescue:all`オプションを使用して Amazon EC2 Rescue を実行して、現在のインスタンスにアタッチされたオフラインの Windows ルートボリュームの問題を検出して対処しようとします。

**重要**  
このランブックでは、ターゲットインスタンスが AWS Tools for Windows PowerShell がインストールされている Windows マネージドインスタンスである必要があります。ランブックは、Systems Manager Distributor パッケージ を使用して Amazon EC2 Rescue for Windows Server ツールをインストールします`AWSSupport-EC2Rescue`。

 **動作の仕組み** 

ランブックは次のステップを実行します。
+ Systems Manager Distributor パッケージを使用してAmazon EC2 Rescue for Windows Server トラブルシューティングツールをインストールします。
+ 指定されたパラメータを使用して、指定されたアクション (`ResetAccess`、`CollectLogs`、または `FixAll`) を実行します。
+ の場合`ResetAccess`: 安全なパスワードを生成し、Parameter Store に保存します。
+ の場合`CollectLogs`: システムログを収集し、指定された Amazon S3 バケットにアップロードします。
+ の場合`FixAll`: 指定されたオフラインボリュームの問題を解決しようとします。

 [このオートメーションを実行する (コンソール)](https://console.aws.amazon.com/systems-manager/automation/execute/AWSSupport-RunEC2RescueForWindowsTool) 

**ドキュメントタイプ**

オートメーション

**[所有者]**

Amazon

**[Platforms]** (プラットフォーム)

Server 

**パラメータ**

**必要な IAM アクセス許可**

`AutomationAssumeRole` パラメータでは、ランブックを正常に使用するために、次のアクションが必要です。
+ `ssm:SendCommand`
+ `ssm:ListCommandInvocations`
+ `ssm:DescribeInstanceInformation`
+ `ssm:GetCommandInvocation`
+ `ssm:PutParameter` (ResetAccess アクションの場合)
+ `kms:Encrypt` (カスタム AWS KMS キーを使用した ResetAccess アクションの場合)
+ `s3:PutObject` (CollectLogs アクションの場合)
+ `s3:GetBucketAcl` (CollectLogs アクションの場合)
+ `s3:GetBucketPolicy` (CollectLogs アクションの場合)
+ `s3:GetBucketPolicyStatus` (CollectLogs アクションの場合)

ポリシーの例: 

```
{
    "Version": "2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ssm:SendCommand",
                "ssm:ListCommandInvocations",
                "ssm:DescribeInstanceInformation",
                "ssm:GetCommandInvocation",
                "ssm:PutParameter",
                "kms:Encrypt",
                "s3:PutObject",
                "s3:GetBucketAcl",
                "s3:GetBucketPolicy",
                "s3:GetBucketPolicyStatus"
            ],
            "Resource": "*"
        }
    ]
}
```

 **指示** 

次の手順に従って自動化を設定します。

1. ドキュメントの Systems Manager [https://console.aws.amazon.com/systems-manager/documents/AWSSupport-RunEC2RescueForWindowsTool/description](https://console.aws.amazon.com/systems-manager/documents/AWSSupport-RunEC2RescueForWindowsTool/description)で に移動します。

1. [**Execute automation**] (オートメーションを実行) を選択します。

1. 入力パラメータには、次のように入力します。
   + **コマンド (必須):**
     + 説明: (必須) 実行するアクション。
     + 型: `String`
     + 値を許可する: `[ResetAccess, CollectLogs, FixAll]`
     + デフォルト: `ResetAccess`
   + **パラメータ (必須):**
     + 説明: (必須) コマンドのパラメータ:
       + の場合`ResetAccess`: AWS AWS KMS キー ID またはエイリアス (デフォルト: `alias/aws/ssm`)
       + の場合`CollectLogs`: ログをアップロードする Amazon S3 バケット名
       + の場合`FixAll`: オフライン修復のデバイス名 (例: `xvdf`)
     + 型: `String`
     + 許可パターン: `^[0-9a-z][a-z0-9-.]{3,63}$|^(dev\/[a-z0-9]{2,10}|xv[a-z0-9]{1,10})$|^(alias\\aws\\ssm|[a-zA-Z0-9-/_]{1,32})$`

1. **[実行]** を選択します。

1. 自動化が開始されます。

1. ドキュメントは以下のステップを実行します。
   + **installEC2Rescue**:

     Systems Manager Distributor パッケージ を使用してAmazon EC2 Rescue for Windows Server トラブルシューティングツールをインストールします`AWSSupport-EC2Rescue`。
   + **runEC2RescueForWindows**:

     コマンドパラメータで指定された アクションを使用して PowerShell スクリプトを実行し、リクエストされたオペレーションを実行します。

1. 完了したら、**出力**セクションで実行の詳細な結果を確認します。

**リファレンス**

Systems Manager Automation
+ [このオートメーションを実行する (コンソール)](https://console.aws.amazon.com/systems-manager/documents/AWSSupport-RunEC2RescueForWindowsTool/description)
+ [オートメーションを実行する](https://docs.aws.amazon.com//systems-manager/latest/userguide/automation-working-executing.html)
+ [オートメーションの設定](https://docs.aws.amazon.com//systems-manager/latest/userguide/automation-setup.html)
+ [オートメーションワークフローのサポート](https://aws.amazon.com/premiumsupport/technology/saw/)
+ [Systems Manager Run Command で Amazon EC2 Rescue for Windows Server を使用する](https://docs.aws.amazon.com//AWSEC2/latest/WindowsGuide/ec2rw-ssm.html)