Amazon EC2 Systems Manager
用户指南
AWS 服务或AWS文档中描述的功能,可能因地区/位置而异。点 击 Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

排除 Systems Manager Automation 的故障

利用以下信息帮助您排除 Automation 服务中的问题。本主题介绍了依据 Automation 错误消息解决问题的特定任务。

常见 Automation 错误

此部分提供有关常见 Automation 错误的信息。

VPC not defined 400

默认情况下,当 Automation 运行 AWS-UpdateLinuxAmi 文档或 AWS-UpdateWindowsAmi 文档时,系统会在默认VPC (172.30.0.0/16) 中创建一个临时实例。如果您删除了默认 VPC,会收到以下错误:

VPC not defined 400

要解决此问题,您必须创建一个新的包含子网 ID 的 Automation 文档。复制下面的包含子网 ID 参数的示例文档,并创建一个新文档。有关创建文档的信息,请参阅创建 Automation 文档

AWS-UpdateLinuxAmi

Copy
{ "schemaVersion":"0.3", "description":"Updates AMI with Linux distribution packages and Amazon software. For details,see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sysman-ami-walkthrough.html", "assumeRole":"{{AutomationAssumeRole}}", "parameters":{ "SourceAmiId":{ "type":"String", "description":"(Required) The source Amazon Machine Image ID." }, "InstanceIamRole":{ "type":"String", "description":"(Required) The name of the role that enables Systems Manager (SSM) to manage the instance.", "default":"ManagedInstanceProfile" }, "AutomationAssumeRole":{ "type":"String", "description":"(Required) The ARN of the role that allows Automation to perform the actions on your behalf.", "default":"arn:aws:iam::{{global:ACCOUNT_ID}}:role/AutomationServiceRole" }, "SubnetId":{ "type":"String", "description":"(Required) The subnet that the created instance will be placed into." }, "TargetAmiName":{ "type":"String", "description":"(Optional) The name of the new AMI that will be created. Default is a system-generated string including the source AMI id, and the creation time and date.", "default":"UpdateLinuxAmi_from_{{SourceAmiId}}_on_{{global:DATE_TIME}}" }, "InstanceType":{ "type":"String", "description":"(Optional) Type of instance to launch as the workspace host. Instance types vary by region. Default is t2.micro.", "default":"t2.micro" }, "PreUpdateScript":{ "type":"String", "description":"(Optional) URL of a script to run before updates are applied. Default (\"none\") is to not run a script.", "default":"none" }, "PostUpdateScript":{ "type":"String", "description":"(Optional) URL of a script to run after package updates are applied. Default (\"none\") is to not run a script.", "default":"none" }, "IncludePackages":{ "type":"String", "description":"(Optional) Only update these named packages. By default (\"all\"), all available updates are applied.", "default":"all" }, "ExcludePackages":{ "type":"String", "description":"(Optional) Names of packages to hold back from updates, under all conditions. By default (\"none\"), no package is excluded.", "default":"none" } }, "mainSteps":[ { "name":"launchInstance", "action":"aws:runInstances", "maxAttempts":3, "timeoutSeconds":1200, "onFailure":"Abort", "inputs":{ "ImageId":"{{SourceAmiId}}", "InstanceType":"{{InstanceType}}", "SubnetId":"{{ SubnetId }}", "UserData":"IyEvYmluL2Jhc2gNCg0KZnVuY3Rpb24gZ2V0X2NvbnRlbnRzKCkgew0KICAgIGlmIFsgLXggIiQod2hpY2ggY3VybCkiIF07IHRoZW4NCiAgICAgICAgY3VybCAtcyAtZiAiJDEiDQogICAgZWxpZiBbIC14ICIkKHdoaWNoIHdnZXQpIiBdOyB0aGVuDQogICAgICAgIHdnZXQgIiQxIiAtTyAtDQogICAgZWxzZQ0KICAgICAgICBkaWUgIk5vIGRvd25sb2FkIHV0aWxpdHkgKGN1cmwsIHdnZXQpIg0KICAgIGZpDQp9DQoNCnJlYWRvbmx5IElERU5USVRZX1VSTD0iaHR0cDovLzE2OS4yNTQuMTY5LjI1NC8yMDE2LTA2LTMwL2R5bmFtaWMvaW5zdGFuY2UtaWRlbnRpdHkvZG9jdW1lbnQvIg0KcmVhZG9ubHkgVFJVRV9SRUdJT049JChnZXRfY29udGVudHMgIiRJREVOVElUWV9VUkwiIHwgYXdrIC1GXCIgJy9yZWdpb24vIHsgcHJpbnQgJDQgfScpDQpyZWFkb25seSBERUZBVUxUX1JFR0lPTj0idXMtZWFzdC0xIg0KcmVhZG9ubHkgUkVHSU9OPSIke1RSVUVfUkVHSU9OOi0kREVGQVVMVF9SRUdJT059Ig0KDQpyZWFkb25seSBTQ1JJUFRfTkFNRT0iYXdzLWluc3RhbGwtc3NtLWFnZW50Ig0KIFNDUklQVF9VUkw9Imh0dHBzOi8vYXdzLXNzbS1kb3dubG9hZHMtJFJFR0lPTi5zMy5hbWF6b25hd3MuY29tL3NjcmlwdHMvJFNDUklQVF9OQU1FIg0KDQppZiBbICIkUkVHSU9OIiA9ICJjbi1ub3J0aC0xIiBdOyB0aGVuDQogIFNDUklQVF9VUkw9Imh0dHBzOi8vYXdzLXNzbS1kb3dubG9hZHMtJFJFR0lPTi5zMy5jbi1ub3J0aC0xLmFtYXpvbmF3cy5jb20uY24vc2NyaXB0cy8kU0NSSVBUX05BTUUiDQpmaQ0KDQppZiBbICIkUkVHSU9OIiA9ICJ1cy1nb3Ytd2VzdC0xIiBdOyB0aGVuDQogIFNDUklQVF9VUkw9Imh0dHBzOi8vYXdzLXNzbS1kb3dubG9hZHMtJFJFR0lPTi5zMy11cy1nb3Ytd2VzdC0xLmFtYXpvbmF3cy5jb20vc2NyaXB0cy8kU0NSSVBUX05BTUUiDQpmaQ0KDQpjZCAvdG1wDQpGSUxFX1NJWkU9MA0KTUFYX1JFVFJZX0NPVU5UPTMNClJFVFJZX0NPVU5UPTANCg0Kd2hpbGUgWyAkUkVUUllfQ09VTlQgLWx0ICRNQVhfUkVUUllfQ09VTlQgXSA7IGRvDQogIGVjaG8gQVdTLVVwZGF0ZUxpbnV4QW1pOiBEb3dubG9hZGluZyBzY3JpcHQgZnJvbSAkU0NSSVBUX1VSTA0KICBnZXRfY29udGVudHMgIiRTQ1JJUFRfVVJMIiA+ICIkU0NSSVBUX05BTUUiDQogIEZJTEVfU0laRT0kKGR1IC1rIC90bXAvJFNDUklQVF9OQU1FIHwgY3V0IC1mMSkNCiAgZWNobyBBV1MtVXBkYXRlTGludXhBbWk6IEZpbmlzaGVkIGRvd25sb2FkaW5nIHNjcmlwdCwgc2l6ZTogJEZJTEVfU0laRQ0KICBpZiBbICRGSUxFX1NJWkUgLWd0IDAgXTsgdGhlbg0KICAgIGJyZWFrDQogIGVsc2UNCiAgICBpZiBbWyAkUkVUUllfQ09VTlQgLWx0IE1BWF9SRVRSWV9DT1VOVCBdXTsgdGhlbg0KICAgICAgUkVUUllfQ09VTlQ9JCgoUkVUUllfQ09VTlQrMSkpOw0KICAgICAgZWNobyBBV1MtVXBkYXRlTGludXhBbWk6IEZpbGVTaXplIGlzIDAsIHJldHJ5Q291bnQ6ICRSRVRSWV9DT1VOVA0KICAgIGZpDQogIGZpIA0KZG9uZQ0KDQppZiBbICRGSUxFX1NJWkUgLWd0IDAgXTsgdGhlbg0KICBjaG1vZCAreCAiJFNDUklQVF9OQU1FIg0KICBlY2hvIEFXUy1VcGRhdGVMaW51eEFtaTogUnVubmluZyBVcGRhdGVTU01BZ2VudCBzY3JpcHQgbm93IC4uLi4NCiAgLi8iJFNDUklQVF9OQU1FIiAtLXJlZ2lvbiAiJFJFR0lPTiINCmVsc2UNCiAgZWNobyBBV1MtVXBkYXRlTGludXhBbWk6IFVuYWJsZSB0byBkb3dubG9hZCBzY3JpcHQsIHF1aXR0aW5nIC4uLi4NCmZp", "MinInstanceCount":1, "MaxInstanceCount":1, "IamInstanceProfileName":"{{InstanceIamRole}}" } }, { "name":"updateOSSoftware", "action":"aws:runCommand", "maxAttempts":3, "timeoutSeconds":3600, "onFailure":"Abort", "inputs":{ "DocumentName":"AWS-RunShellScript", "InstanceIds":[ "{{launchInstance.InstanceIds}}" ], "Parameters":{ "commands":[ "set -e", "[ -x \"$(which wget)\" ] && get_contents='wget $1 -O -'", "[ -x \"$(which curl)\" ] && get_contents='curl -s -f $1'", "eval $get_contents https://aws-ssm-downloads-{{global:REGION}}.s3.amazonaws.com/scripts/aws-update-linux-instance > /tmp/aws-update-linux-instance", "chmod +x /tmp/aws-update-linux-instance", "/tmp/aws-update-linux-instance --pre-update-script '{{PreUpdateScript}}' --post-update-script '{{PostUpdateScript}}' --include-packages '{{IncludePackages}}' --exclude-packages '{{ExcludePackages}}' 2>&1 | tee /tmp/aws-update-linux-instance.log" ] } } }, { "name":"stopInstance", "action":"aws:changeInstanceState", "maxAttempts":3, "timeoutSeconds":1200, "onFailure":"Abort", "inputs":{ "InstanceIds":[ "{{launchInstance.InstanceIds}}" ], "DesiredState":"stopped" } }, { "name":"createImage", "action":"aws:createImage", "maxAttempts":3, "onFailure":"Abort", "inputs":{ "InstanceId":"{{launchInstance.InstanceIds}}", "ImageName":"{{TargetAmiName}}", "NoReboot":true, "ImageDescription":"AMI Generated by EC2 Automation on {{global:DATE_TIME}} from {{SourceAmiId}}" } }, { "name":"terminateInstance", "action":"aws:changeInstanceState", "maxAttempts":3, "onFailure":"Continue", "inputs":{ "InstanceIds":[ "{{launchInstance.InstanceIds}}" ], "DesiredState":"terminated" } } ], "outputs":[ "createImage.ImageId" ] }

AWS-UpdateWindowsAmi

Copy
{ "schemaVersion":"0.3", "description":"Updates a Microsoft Windows AMI. By default it will install all Windows updates, Amazon software, and Amazon drivers. It will then sysprep and create a new AMI. Supports Windows Server 2008 R2 and greater.", "assumeRole":"{{ AutomationAssumeRole }}", "parameters":{ "SourceAmiId":{ "type":"String", "description":"(Required) The source Amazon Machine Image ID." }, "IamInstanceProfileName":{ "type":"String", "description":"(Required) The name of the role that enables Systems Manager to manage the instance.", "default":"ManagedInstanceProfile" }, "AutomationAssumeRole":{ "type":"String", "description":"(Required) The ARN of the role that allows Automation to perform the actions on your behalf.", "default":"arn:aws:iam::{{global:ACCOUNT_ID}}:role/AutomationServiceRole" }, "SubnetId": { "type": "String", "description": "(Required) The subnet that the created instance will be placed into." }, "TargetAmiName":{ "type":"String", "description":"(Optional) The name of the new AMI that will be created. Default is a system-generated string including the source AMI id, and the creation time and date.", "default":"UpdateWindowsAmi_from_{{SourceAmiId}}_on_{{global:DATE_TIME}}" }, "InstanceType":{ "type":"String", "description":"(Optional) Type of instance to launch as the workspace host. Instance types vary by region. Default is t2.medium.", "default":"t2.medium" }, "IncludeKbs":{ "type":"String", "description":"(Optional) Specify one or more Microsoft Knowledge Base (KB) article IDs to include. You can install multiple IDs using comma-separated values. When specified, the categories and security level values are ignored. Valid formats: KB9876543 or 9876543.", "default":"" }, "ExcludeKbs":{ "type":"String", "description":"(Optional) Specify one or more Microsoft Knowledge Base (KB) article IDs to exclude. You can exclude multiple IDs using comma-separated values. When specified, all these KBs are excluded from install process. Valid formats: KB9876543 or 9876543.", "default":"" }, "Categories":{ "type":"String", "description":"(Optional) Specify one or more update categories. You can filter categories using comma-separated values. By default patches for all categories are selected. If value supplied, the update list is filtered by those values. Options: Critical Update, Security Update, Definition Update, Update Rollup, Service Pack, Tool, Update or Driver. Valid formats include a single entry, for example: Critical Update. Or, you can specify a comma separated list: Critical Update,Security Update,Definition Update. NOTE: There cannot be any spaces around the commas.", "default":"" }, "SeverityLevels":{ "type":"String", "description":"(Optional) Specify one or more MSRC severity levels associated with an update. You can filter severity levels using comma-separated values. By default patches for all security levels are selected. If value supplied, the update list is filtered by those values. Options: Critical, Important, Low, Moderate or Unspecified. Valid formats include a single entry, for example: Critical. Or, you can specify a comma separated list: Critical,Important,Low.", "default":"" }, "PreUpdateScript":{ "type":"String", "description":"(Optional) A script provided as a string. It will execute prior to installing OS updates.", "default":"" }, "PostUpdateScript":{ "type":"String", "description":"(Optional) A script provided as a string. It will execute after installing OS updates.", "default":"" } }, "mainSteps":[ { "name":"LaunchInstance", "action":"aws:runInstances", "timeoutSeconds":1800, "maxAttempts":3, "onFailure":"Abort", "inputs":{ "ImageId":"{{ SourceAmiId }}", "InstanceType":"{{ InstanceType }}", "SubnetId":"{{ SubnetId }}", "MinInstanceCount":1, "MaxInstanceCount":1, "IamInstanceProfileName":"{{ IamInstanceProfileName }}" } }, { "name":"RunPreUpdateScript", "action":"aws:runCommand", "maxAttempts":3, "onFailure":"Abort", "timeoutSeconds":1800, "inputs":{ "DocumentName":"AWS-RunPowerShellScript", "InstanceIds":[ "{{ LaunchInstance.InstanceIds }}" ], "Parameters":{ "commands":"{{ PreUpdateScript }}" } } }, { "name":"UpdateSSMAgent", "action":"aws:runCommand", "maxAttempts":3, "onFailure":"Abort", "timeoutSeconds":600, "inputs":{ "DocumentName":"AWS-UpdateSSMAgent", "InstanceIds":[ "{{ LaunchInstance.InstanceIds }}" ] } }, { "name":"UpdateEC2Config", "action":"aws:runCommand", "maxAttempts":3, "onFailure":"Abort", "timeoutSeconds":7200, "inputs":{ "DocumentName":"AWS-InstallPowerShellModule", "InstanceIds":[ "{{ LaunchInstance.InstanceIds }}" ], "Parameters":{ "executionTimeout":"7200", "source":"https://aws-ssm-downloads-{{global:REGION}}.s3.amazonaws.com/PSModules/AWSUpdateWindowsInstance/Latest/AWSUpdateWindowsInstance.zip", "sourceHash":"14CAD416F4A054894EBD2091EA4B99E542368BE5895BDD466B567C1ABA87C87C", "commands":[ "Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force", "Import-Module AWSUpdateWindowsInstance", "if ([Environment]::OSVersion.Version.Major -ge 10) {", " Install-AwsUwiEC2Launch -Id {{ automation:EXECUTION_ID }}", "} else {", " Install-AwsUwiEC2Config -Id {{ automation:EXECUTION_ID }}", "}" ] } } }, { "name":"UpdateAWSPVDriver", "action":"aws:runCommand", "maxAttempts":3, "onFailure":"Abort", "timeoutSeconds":600, "inputs":{ "DocumentName":"AWS-ConfigureAWSPackage", "InstanceIds":[ "{{ LaunchInstance.InstanceIds }}" ], "Parameters":{ "name":"AWSPVDriver", "action":"Install" } } }, { "name":"InstallWindowsUpdates", "action":"aws:runCommand", "maxAttempts":3, "onFailure":"Abort", "timeoutSeconds":14400, "inputs":{ "DocumentName":"AWS-InstallWindowsUpdates", "InstanceIds":[ "{{ LaunchInstance.InstanceIds }}" ], "Parameters":{ "Action":"Install", "IncludeKbs":"{{ IncludeKbs }}", "ExcludeKbs":"{{ ExcludeKbs }}", "Categories":"{{ Categories }}", "SeverityLevels":"{{ SeverityLevels }}" } } }, { "name":"RunPostUpdateScript", "action":"aws:runCommand", "maxAttempts":3, "onFailure":"Abort", "timeoutSeconds":1800, "inputs":{ "DocumentName":"AWS-RunPowerShellScript", "InstanceIds":[ "{{ LaunchInstance.InstanceIds }}" ], "Parameters":{ "commands":"{{ PostUpdateScript }}" } } }, { "name":"RunSysprepGeneralize", "action":"aws:runCommand", "maxAttempts":3, "onFailure":"Abort", "timeoutSeconds":7200, "inputs":{ "DocumentName":"AWS-InstallPowerShellModule", "InstanceIds":[ "{{ LaunchInstance.InstanceIds }}" ], "Parameters":{ "executionTimeout":"7200", "source":"https://aws-ssm-downloads-{{global:REGION}}.s3.amazonaws.com/PSModules/AWSUpdateWindowsInstance/Latest/AWSUpdateWindowsInstance.zip", "sourceHash":"14CAD416F4A054894EBD2091EA4B99E542368BE5895BDD466B567C1ABA87C87C", "commands":[ "Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force", "Import-Module AWSUpdateWindowsInstance", "Start-AwsUwiSysprep -Id {{ automation:EXECUTION_ID }}" ] } } }, { "name":"StopInstance", "action":"aws:changeInstanceState", "maxAttempts":3, "timeoutSeconds":7200, "onFailure":"Abort", "inputs":{ "InstanceIds":[ "{{ LaunchInstance.InstanceIds }}" ], "CheckStateOnly":false, "DesiredState":"stopped" } }, { "name":"CreateImage", "action":"aws:createImage", "maxAttempts":3, "onFailure":"Abort", "inputs":{ "InstanceId":"{{ LaunchInstance.InstanceIds }}", "ImageName":"{{ TargetAmiName }}", "NoReboot":true, "ImageDescription":"Test CreateImage Description" } }, { "name":"CreateTags", "action":"aws:createTags", "maxAttempts":3, "onFailure":"Abort", "inputs":{ "ResourceType":"EC2", "ResourceIds":[ "{{ CreateImage.ImageId }}" ], "Tags":[ { "Key":"Original_AMI_ID", "Value":"Created from {{ SourceAmiId }}" } ] } }, { "name":"TerminateInstance", "action":"aws:changeInstanceState", "maxAttempts":3, "onFailure":"Abort", "inputs":{ "InstanceIds":[ "{{ LaunchInstance.InstanceIds }}" ], "DesiredState":"terminated" } } ], "outputs":[ "CreateImage.ImageId" ] }

Automation 执行无法启动

如果您没有为 Automation 正确配置 IAM 用户、角色和策略,Automation 执行可能因拒绝访问错误或代入角色无效错误而失败。

拒绝访问

以下示例描述了 Automation 执行因拒绝访问错误无法启动的情况。

对 Systems Manager API 的访问被拒绝

错误消息User: user arn is not authorized to perform: ssm:StartAutomationExecution on resource: document arn (Service: AWSSimpleSystemsManagement; Status Code: 400; Error Code: AccessDeniedException; Request ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

  • 可能的原因 1:尝试启动 Automation 执行的 IAM 用户没有调用 StartAutomationExecution API 的权限。要解决此问题,请将所需的 IAM 策略附加到用于启动执行的用户账户。有关更多信息,请参阅 任务 5:配置用户对 Automation 的访问权限

  • 可能的原因 2:尝试启动 Automation 执行的 IAM 用户具有调用 StartAutomationExecution API 的权限,但是无权使用指定 Automation 文档来调用该 API。要解决此问题,请将所需的 IAM 策略附加到用于启动执行的用户账户。有关更多信息,请参阅 任务 5:配置用户对 Automation 的访问权限

由于不具备 PassRole 权限访问被拒

错误消息User: user arn is not authorized to perform: iam:PassRole on resource: automation assume role arn (Service: AWSSimpleSystemsManagement; Status Code: 400; Error Code: AccessDeniedException; Request ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

尝试启动 Automation 执行的 IAM 用户不具有代入角色所需的 PassRole 权限。要解决此问题,请将 iam:PassRole 策略附加到尝试启动 Automation 执行的 IAM 用户的角色。有关更多信息,请参阅 任务 4:将 iam:PassRole 策略附加到您的 Automation 角色

代入角色无效

执行 Automation 时,要么在文档中提供代入角色,要么将代入角色作为文档的一个参数值传递。如果未指定或未正确配置代入角色,可出现不同类型的错误。

代入角色格式错误

错误消息The format of the supplied assume role ARN is invalid.代入角色格式不正确。要解决该问题,请验证 Automation 文档中是否指定了有效的代入角色,或者在执行 Automation 时指定为运行时参数。

无法代入代入角色

错误消息The defined assume role is unable to be assumed. (Service: AWSSimpleSystemsManagement; Status Code: 400; Error Code: InvalidAutomationExecutionParametersException; Request ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

执行已启动,但是状态为“失败”

特定操作失败

Automation 文档包含步骤,并且步骤按顺序执行。每个步骤调用一项或多项 AWS 服务 API。API 可确定本步的输入、行为和输出。在多个位置错误可能导致步骤失败。失败消息指示出现错误的时间和位置。

要查看 EC2 控制台中的失败消息,请选择失败步骤的 View Outputs 链接。要查看 CLI 中的失败消息,请调用 get-automation-execution 并查找失败的 StepExecution 中的 FailureMessage 属性。

在以下示例中,与 aws:runInstance 操作相关联的步骤失败。每个示例探讨了不同类型的错误。

缺少映像

错误消息Automation Step Execution fails when it is launching the instance(s). Get Exception from RunInstances API of ec2 Service. Exception Message from RunInstances API: [The image id '[ami id]' does not exist (Service: AmazonEC2; Status Code: 400; Error Code: InvalidAMIID.NotFound; Request ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)]. Please refer to Automation Service Troubleshooting Guide for more diagnosis details.

aws:runInstances 操作收到的 ImageId 输入不存在。要解决该问题,请用正确的 AMI ID 更新 automation 文档或参数值。

代入角色策略没有足够的权限

错误消息Automation Step Execution fails when it is launching the instance(s). Get Exception from RunInstances API of ec2 Service. Exception Message from RunInstances API: [You are not authorized to perform this operation. Encoded authorization failure message: xxxxxxx (Service: AmazonEC2; Status Code: 403; Error Code: UnauthorizedOperation; Request ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)]. Please refer to Automation Service Troubleshooting Guide for more diagnosis details.

代入角色的权限不足,无法在 Amazon EC2 实例上调用 RunInstances API。要解决此问题,请将 IAM 策略附加到有权调用 RunInstances API 的代入角色。有关更多信息,请参见 方法 2:使用 IAM 为 Automation 配置角色

意外状态

错误消息Step fails when it is verifying launched instance(s) are ready to be used. Instance i-xxxxxxxxx entered unexpected state: shutting-down. Please refer to Automation Service Troubleshooting Guide for more diagnosis details.

  • 可能的原因 1:实例或 Amazon EC2 服务有问题。要解决此问题,请登录到实例或查阅实例系统日志以了解实例启动关闭的原因。

  • 可能的原因 2:为 aws:runInstances 操作指定的用户数据脚本有问题或语法错误。验证用户数据脚本的语法。另外,请验证用户数据脚本是否未关闭实例,或者调用了关闭该实例的其他脚本。

操作特定失败参考

如果步骤失败,失败消息可能指示失败时正在调用哪个服务。下表列出每个操作调用的服务。该表还提供指向有关每个服务的信息的链接。

Action 此操作调用的 AWS 服务 有关此服务的信息 内容故障排除

aws:runInstances

Amazon EC2

Amazon EC2 用户指南

EC2 实例故障排除

aws:changeInstanceState

Amazon EC2

Amazon EC2 用户指南

EC2 实例故障排除

aws:runCommand

Systems Manager

Systems Manager Run Command

Run Command 疑难解答

aws:createImage

Amazon EC2

Amazon Machine Images

aws:createStack

AWS CloudFormation

AWS CloudFormation User Guide

AWS CloudFormation 疑难解答

aws:deleteStack

AWS CloudFormation

AWS CloudFormation User Guide

AWS CloudFormation 疑难解答

aws:deleteImage

Amazon EC2

Amazon Machine Images

aws:copyImage

Amazon EC2

Amazon Machine Images

aws:createTag

Amazon EC2, Systems Manager

EC2 资源和标签

aws:invokeLambdaFunction

AWS Lambda

AWS Lambda Developer Guide

Lambda 故障排除

Automation 服务内部错误

错误消息Internal Server Error. Please refer to Automation Service Troubleshooting Guide for more diagnosis details.

Automation 服务中的一个问题导致指定 Automation 文档无法正确执行。要解决此问题,请联系 AWS Support。请提供执行 ID 和客户 ID (如果有)。

执行已启动,但超时

错误消息Step timed out while step is verifying launched instance(s) are ready to be used. Please refer to Automation Service Troubleshooting Guide for more diagnosis details.

aws:runInstances 操作中的步骤超时。如果执行本步操作所花的时间超出此步中为 timeoutSeconds 指定的值,就会发生这种情况。要解决该问题,请为 timeoutSeconds 指定较长的值。如果不能解决问题,请调查步骤执行时间超出预期的原因。