的run_instances() documentation顯示:
resp = client.run_instances({
...
tag_specifications: [
{
resource_type: "customer-gateway", # accepts customer-gateway, dhcp-options, image, instance, internet-gateway, network-acl, network-interface, reserved-instances, route-table, snapshot, spot-instances-request, subnet, security-group, volume, vpc, vpn-connection, vpn-gateway
tags: [
{
key: "String",
value: "String",
},
],
},
],
...
它已推出使用create_tags()後,您還可以標記一個實例:
resp = client.create_tags({
resources: [
"i-abcd1234",
],
tags: [
{
key: "Stack",
value: "production",
},
],
})