我可以在没有用户数据的情况下启动 ec2 实例:
aws ec2 request-spot-instances --spot-price .01 --instance-count 1 --launch-specification '{ "ImageId": "ami-3275ee5b", "KeyName": "key", "InstanceType": " t1.micro"}'
但是当我用 userdata 尝试它时,我收到以下错误:
aws ec2 request-spot-instances --spot-price .01 --instance-count 1 --launch-specification '{ "ImageId": "ami-3275ee5b", "KeyName": "key", "UserData": { "Fn::Base64" : { "Fn::Join" : ["", ["#!/bin/bash\n","touch /tmp/userdata_sucess\n"]]}}, "InstanceType": " t1.micro"}'
无效值 ('OrderedDict([(u'Fn::Base64', OrderedDict([(u'Fn::Join', [u'', [u'#!/bin/bash\n', u'touch / tmp/userdata_sucess\n']])]))])') 用于参数字符串:字符串类型的用户数据
amazon-ec2 ×1