オートメーションのタグ付け - AWS Systems Manager

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

オートメーションのタグ付け

このセクションのトピックでは、オートメーションのタグの使用方法について説明します。AWS Systems Manager オートメーションには最大 5 個のタグを追加できます。コンソールまたはコマンドラインからオートメーションを開始したとき、またはコマンドラインを使用してオートメーションを実行した後、オートメーションにタグを追加できます。

オートメーションにタグを追加する (コンソール)

  1. AWS Systems Manager コンソール (https://console.aws.amazon.com/systems-manager/) を開きます。

  2. ナビゲーションペインで [オートメーション] を選択します。

    -または-

    AWS Systems Manager ホームページが最初に開く場合は、メニューアイコン ( 
    The menu icon
  ) を選択してナビゲーションペインを開き、[オートメーション] を選択します。

  3. 実行するオートメーション Runbook を選択します。

  4. [Execute automation] (オートメーションを実行) を選択します。

  5. [Tags (タグ)] セクションで [Edit (編集)] を選択し、1 つ以上のキーと値のタグのペアを追加します。

  6. [Save (保存)] を選択します。

オートメーションにタグを追加する (コマンドライン)

コマンドラインツールを使用して次のコマンドを実行し、オートメーションの起動時にタグを追加します。各リソースプレースホルダーの例をユーザー自身の情報に置き換えます。

Linux & macOS
aws ssm start-automation-execution \ --document-name DocumentName \ --parameters ParametersRequiredByDocument \ --tags "Key=ExampleKey,Value=ExampleValue"
Windows
aws ssm start-automation-execution ^ --document-name DocumentName ^ --parameters ParametersRequiredByDocument ^ --tags "Key=ExampleKey,Value=ExampleValue"
PowerShell
$exampleTag = New-Object Amazon.SimpleSystemsManagement.Model.Tag $exampleTag.Key = "ExampleKey" $exampleTag.Value = "ExampleValue" Start-SSMAutomationExecution ` -DocumentName DocumentName ` -Parameter ParametersRequiredByDocument -Tag $exampleTag
  1. コマンドラインツールを使用してオートメーションを実行した後にタグ付けすることもできます。オートメーションにタグを追加するには、次のコマンドを実行します。各リソースプレースホルダーの例をユーザー自身の情報に置き換えます。

    Linux & macOS
    aws ssm add-tags-to-resource \ --resource-type "Automation" \ --resource-id "automation-execution-id" \ --tags "Key=ExampleKey,Value=ExampleValue"
    Windows
    aws ssm add-tags-to-resource ^ --resource-type "Automation" ^ --resource-id "automation-execution-id" ^ --tags "Key=ExampleKey,Value=ExampleValue"
    PowerShell
    $exampleTag = New-Object Amazon.SimpleSystemsManagement.Model.Tag $exampleTag.Key = "ExampleKey" $exampleTag.Value = "ExampleValue" Add-SSMResourceTag ` -ResourceType "Automation" ` -ResourceId "automation-execution-id" ` -Tag $exampleTag ` -Force

    成功した場合は、コマンドの出力はありません。

  2. オートメーションのタグを確認するには、次のコマンドを実行します。

    Linux & macOS
    aws ssm list-tags-for-resource \ --resource-type "Automation" \ --resource-id "automation-execution-id"
    Windows
    aws ssm list-tags-for-resource ^ --resource-type "Automation" ^ --resource-id "automation-execution-id"
    PowerShell
    Get-SSMResourceTag ` -ResourceType "Automation" ` -ResourceId "automation-execution-id"

オートメーションからタグを削除する

コマンドラインツールを使用して、オートメーションからタグを削除できます。

オートメーションからタグを削除する (コマンドライン)

  1. コマンドラインツールを使用して次のコマンドを実行し、オートメーションからタグを削除します。各リソースプレースホルダーの例をユーザー自身の情報に置き換えます。

    Linux & macOS
    aws ssm remove-tags-from-resource \ --resource-type "Automation" \ --resource-id "automation-execution-id" \ --tag-key "tag-key"
    Windows
    aws ssm remove-tags-from-resource ^ --resource-type "Automation" ^ --resource-id "automation-execution-id" ^ --tag-key "tag-key"
    PowerShell
    Remove-SSMResourceTag ` -ResourceId "automation-execution-id" ` -ResourceType "Automation" ` -TagKey "tag-key" ` -Force
  2. オートメーションのタグを確認するには、次のコマンドを実行します。

    Linux & macOS
    aws ssm list-tags-for-resource \ --resource-type "Automation" \ --resource-id "automation-execution-id"
    Windows
    aws ssm list-tags-for-resource ^ --resource-type "Automation" ^ --resource-id "automation-execution-id"
    PowerShell
    Get-SSMResourceTag ` -ResourceType "Automation" ` -ResourceId "automation-execution-id"