「AWS Config ルールによる非準拠の AWS リソースの修復」の手順に従い作業しました。しかし修復アクションが失敗してしまい、AWS Config コンソールには、「Action execution failed (details)」というエラーのアクションステータスが表示されます。[Details] ページを開きましたが、問題のトラブルシューティングに必要な情報が、十分に得られませんでした。
解決方法
AWS コマンドラインインターフェイス (AWS CLI) または AWS CloudTrail イベント履歴を使用して修復アクションが失敗した場合のトラブルシューティングを行うには、以下の手順に従います。
注意: AWS CLI コマンドの実行時にエラーが発生した場合は、AWS CLI の最新バージョンを使用していることを確認してください。
AWS CLI
1. Describe-readiation-execution-status の AWS CLI コマンドを実行して、次のような修復アクションステップのエラーメッセージ、状態、タイムスタンプについてより詳細なエラーメッセージ、状態、タイムスタンプを確認します。
aws configservice describe-remediation-execution-status \
--config-rule-name example-rule \
--region example-region \
--resource-keys resourceType=example-resource-type,resourceId=example-resource-ID
注: example-rule、example-region、example-resource-type、および example-resource-ID の部分は、ご使用の AWS Config ルール名、リージョン、リソースタイプ、およびリソース ID に置き換えて使用します。
2. 次のような出力が表示されます。
{
"RemediationExecutionStatuses": [
{
"ResourceKey": {
"resourceType": "AWS::EC2::Volume",
"resourceId": "vol-0b399a24561582586"
},
"State": "FAILED",
"StepDetails": [
{
"Name": "createDocumentStack",
"State": "FAILED",
"ErrorMessage": "Automation Step Execution fails when it is creating a CloudFormation stack.
Get Exception from CreateStack API of cloudformation Service. Exception Message from CreateStack API:
[User: arn:aws:sts::xxxxx:assumed-role/config-remediation-sshpublic-role-zkga0ot3/config-remediation-sshpublic is not authorized to perform: cloudformation:CreateStack
on resource: arn:aws:cloudformation:eu-west-2:xxxxx:stack/DetachEBSVolumeStack2f6d3590-ea2c-424a-97ea-045749f07164/*
(Service: AmazonCloudFormation; Status Code: 403; Error Code: AccessDenied; Request ID: b8f41dd6-9020-11e9-897d-f9719db1a9e6)].
Please refer to Automation Service Troubleshooting Guide for more diagnosis details.",
"StartTime": 1560680582.675,
"StopTime": 1560680582.884
},
{
"Name": "detachVolume",
"State": "PENDING"
},
{
"Name": "deleteCloudFormationTemplate",
"State": "PENDING"
}
],
"InvocationTime": 1560680582.419,
"LastUpdatedTime": 1560680583.67
}
]
}
3. [ StepDetails ] リストで、エラーメッセージとエラーの原因を書き留めます。
CloudTrail イベント履歴
1. AWS CloudTrail コンソールを開きます。
2. 詳細については、CloudTrail コンソールで CloudTrail イベントを表示するを参照してください。
3. StartAutomationExecution API アクションは、AWS Config が修復アクションを開始したときに呼び出されます。StartAutomationExecution API を使用してイベント名をフィルタし、イベントの詳細ページで requestID をコピーします。
4. AWS Systems Manager コンソールを開き、ナビゲーションペインで [Automation] を選択します。
5. オートメーションドキュメントの検索フィールドに requestID を貼り付けます。
6. 次に、修復が実行したアクションを見つけます。エラーが、AWS Identity and Access Management (IAM) のアクセス許可、構文の問題、または修復アクションによる誤ったパラメータ設定の内、どれに関連したものかを確認します。
関連情報
AWS Config ユーザーにカスタムのアクセス許可を付与する
AWS Config コンソールのエラーメッセージをトラブルシューティングするにはどうすればよいですか?
ルールを表示、更新、削除 (AWS CLI)
AWS Config で修復アクションを削除しようとしたときに、「NoSuchRemediationConfigurationException」または「予期しない内部エラー」のエラーを解決する方法を教えてください。