aws:createTags – 建立 AWS 資源的標籤 - AWS Systems Manager

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

aws:createTags – 建立 AWS 資源的標籤

為 Amazon Elastic Compute Cloud (Amazon EC2) 執行個體或 AWS Systems Manager 受管執行個體建立標籤。

Input

此動作支援大部分 Amazon EC2 CreateTags 和 Systems Manager AddTagsToResource 參數。如需詳細資訊,請參閱 CreateTagsAddTagsToResource

以下範例示範如何將 Amazon Machine Image (AMI) 和執行個體標記為特定部門的生產資源。

YAML
name: createTags action: aws:createTags maxAttempts: 3 onFailure: Abort inputs: ResourceType: EC2 ResourceIds: - ami-9a3768fa - i-02951acd5111a8169 Tags: - Key: production Value: '' - Key: department Value: devops
JSON
{ "name": "createTags", "action": "aws:createTags", "maxAttempts": 3, "onFailure": "Abort", "inputs": { "ResourceType": "EC2", "ResourceIds": [ "ami-9a3768fa", "i-02951acd5111a8169" ], "Tags": [ { "Key": "production", "Value": "" }, { "Key": "department", "Value": "devops" } ] } }
ResourceIds

要標籤的資源之 ID。如果資源類型不是「EC2」,則此欄位只能包含單一項目。

類型:字串清單

必要:是

Tags (標籤)

要與資源建立關聯的標籤。

類型:對應清單

必要:是

ResourceType

要標籤的資源之類型。如果未提供,會使用「EC2」為預設值。

類型:字串

必要:否

有效值:EC2 | ManagedInstance | MaintenanceWindow | Parameter

輸出