使用Aws cli添加ami-roles,tags和EBS,用Ami创建ec2 windows实例

时间:2017-07-04 15:56:12

标签: amazon-ec2 aws-cli

我正在运行以下命令

aws ec2 run-instances --image-id ${Ami_id} --count 1 --instance-type t2.micro --iam-instance-profile Name="bot_syndication_cloudwatch" --key-name my-key\
--security-group-ids sg-27b53b5c,sg-7ddd5306 --subnet-id subnet-96e0d6e0 \
--tag-specifications ResourceType=instance,Tags=[{Key=Name,Value=Stage-Content-Syndication},{Key=Environment,Value=Stage},{Key=Platform,Value=Windows}]\
--block-device-mappings "[{\"DeviceName\":\"/dev/sdj\",\"NoDevice\":\"\"}]" \

我收到此错误

sg-7ddd5306, --tag-specifications, ResourceType=instance,Tags=[{Key=Name,Value=Stage-Content-Syndication},{Key=Environment,Value=Stage},{Key=Platform,Value=Windows}]--block-device-mappings, [{"DeviceName":"/dev/sdj","NoDevice":""}], sg-27b53b5c
Build step 'Execute shell' marked build as failure

1 个答案:

答案 0 :(得分:0)

问题在于此参数--security-group-ids sg-27b53b5c,sg-7ddd5306

如果要在ec2实例上分配多个安全组,则需要使用

等空格分隔
--security-group-ids sg-27b53b5c sg-7ddd5306