我在 lambda 中为来自 SSM 的运行命令编写了 python 代码,但我遇到了错误
响应:{“errorMessage”:“2019-11-26T10:51:09.649Z d6a9aff6-9da9-477c-82b4-100d96a316fe 任务在 3.00 秒后超时”}
请求 ID:“d6a9aff6-9da9-477c-82b4-100d96a316fe”
功能日志:START RequestId:d6a9aff6-9da9-477c-82b4-100d96a316fe 版本:$LATEST END RequestId:d6a9aff6-9da9-477c-82b4-100d96a316fe REPORT RequestId:d6a9aff6-9da9-477c-82b4-100d96a316fe 计费持续时间: 3000 毫秒内存大小:128 MB 使用的最大内存:34 MB
2019-11-26T10:51:09.649Z d6a9aff6-9da9-477c-82b4-100d96a316fe 任务在 3.00 秒后超时
编码
from __future__ import print_function
import json
import boto3
import urllib.request
ec2_client = boto3.client('ec2', region_name='us-west-1')
ssm_client = boto3.client('ssm', region_name='us-west-1')
client = boto3.client('ssm')
params={"commands":["mkdir reham1"],"workingDirectory":["/home"],"executionTimeout":["3600"]}
response = ssm_client.send_command(DocumentName="AWS-RunShellScript", InstanceIds="i-0fb28a7b3786adee1",Comment='logging the', TimeoutSeconds=600, Parameters=params)