Lambda函数使用ssm.send_命令从boto3库获取错误“日期时间。日期时间是不是JSON序列化“

2024-04-19 21:47:39 发布

您现在位置:Python中文网/ 问答频道 /正文

使用此代码:

command = ssm.send_command( InstanceIds=[ 'i-xxxxxxxxxx' ], DocumentName='AWS-RunPowerShellScript', Comment='Restarting Server', Parameters={ "commands":[".\\python.exe C:\\Users\\user\\Desktop\\script.py"], "workingDirectory": ["C:\\Python36"] } )
return command

我在AWS Lambda函数中收到以下错误:

^{pr2}$

这对我来说没有任何意义,因为我没有使用任何与日期时间。日期时间.
我猜那个命令变量中有JSON,但我不知道它为什么会使用datetime。在


Tags: 代码awssendserver时间commentcommandcommands