1
我想设置一个EC2实例变量与从我在一个变量instanceId
想过去作为资源添加标签上的Python脚本以下电话:传递参数到AWS CLI命令
subprocess.call('aws ec2 create-tags --resources $instanceId --tags "Key=somekey, Value=someval"')
但我得到这个错误:
An error occurred (MissingParameter) when calling the CreateTags operation: The request must contain the parameter resourceIdSet
255
然而,当我打印出来instanceId
,我看到了实例的正确的ID,因此一定有什么毛病我传递变量的方式。这是否有不同的约定?
你运行的是旧版本的AWS CLI工具?运行'aws --version'来查看你安装的版本。 –
按照文档https://docs.python.org/2/library/subprocess.html#using-the-subprocess-module,你应该叫'subprocess.call()'使用参数列表 – ZdaR