开发者

How set name to automatically launched instances

开发者 https://www.devze.com 2023-04-03 05:32 出处:网络
I use bat file to launch Amazon Instances by this code: ec2-run-instances %AMI_Id% -k ED_Key_Pair -t t1.mic开发者_开发问答ro -g default -z us-east-1a

I use bat file to launch Amazon Instances by this code: ec2-run-instances %AMI_Id% -k ED_Key_Pair -t t1.mic开发者_开发问答ro -g default -z us-east-1a

But I can not set name of the Instances. I want use ec2-create-tags resource_id [resource_id ...] --tag key[=value] [--tag key[=value] ...] command to set a name. But I can not get Instances ID from remote computer. How can I do it?


The instance id should be returned by the ec2-run-instances command. A part of the returned string should be something like:

INSTANCE    <instance_id>

instance_id should be in the format i-12345678

If you are on windows (cmd) you will most likely also need to wrap your key=[value] in double quotes.

ec2-create-tags i-12345678 "key=value"

or in Powershell

ec2-create-tags i-12345678 `"key=value`"
0

精彩评论

暂无评论...
验证码 换一张
取 消