阅读背景:

如何在创建AWS Spot实例时指定多个“Tag”

来源:互联网 

I am using AWS SDK for python to create AWS spot instances, but not getting on how can I specify multiple key-value name pait which will eventually get reflected under 'Tags' section of the created VM. According to the below API documentation, keyName is the name if the key pair , and I am not sure whether this is related to Tags or not.

我正在使用AWS SDK for python来创建AWS spot实例,但没有开始如何指定多个键值名称pait,它最终将反映在创建的VM的“Tags”部分下。根据以下API文档,keyName是密钥对的名称,我不确定这是否与Tags相关。

https://boto3.readthedocs.io/en/latest/reference/services/ec2.html#EC2.Client.request_spot_instances

https://boto3.readthedocs.io/en/latest/reference/services/ec2.html#EC2.Client.request_spot_instances

1 个解决方案

#1


0  

You can not define tags through request_spot_instances. You need to either use create_tags after the spot instance request is created or create a Launch template with tags defined in them and then create a spot instance fleet request to have tags.

您无法通过request_spot_instances定义标记。您需要在创建专色实例请求后使用create_tags,或者创建一个其中定义了标签的Launch模板,然后创建一个spot实例fleet请求以获取标签。

References:

参考文献:


分享到: