AWS Systems Manager Change Manager は新規顧客に公開されなくなりました。既存のお客様は、通常どおりサービスを引き続き使用できます。詳細については、「AWS Systems Manager Change Manager の可用性の変更」を参照してください。
CLI で DescribeEffectiveInstanceAssociations を使用する
次のサンプルコードは、DescribeEffectiveInstanceAssociations を使用する方法を説明しています。
- CLI
-
- AWS CLI
-
インスタンスの有効な関連付けの詳細情報を取得するには
次の
describe-effective-instance-associationsの例では、インスタンスの有効な関連付けに関する詳細情報を取得します。コマンド:
aws ssm describe-effective-instance-associations --instance-id"i-1234567890abcdef0"出力:
{ "Associations": [ { "AssociationId": "8dfe3659-4309-493a-8755-0123456789ab", "InstanceId": "i-1234567890abcdef0", "Content": "{\n \"schemaVersion\": \"1.2\",\n \"description\": \"Update the Amazon SSM Agent to the latest version or specified version.\",\n \"parameters\": {\n \"version\": {\n \"default\": \"\",\n \"description\": \"(Optional) A specific version of the Amazon SSM Agent to install. If not specified, the agent will be updated to the latest version.\",\n \"type\": \"String\"\n },\n \"allowDowngrade\": {\n \"default\": \"false\",\n \"description\": \"(Optional) Allow the Amazon SSM Agent service to be downgraded to an earlier version. If set to false, the service can be upgraded to newer versions only (default). If set to true, specify the earlier version.\",\n \"type\": \"String\",\n \"allowedValues\": [\n \"true\",\n \"false\"\n ]\n }\n },\n \"runtimeConfig\": {\n \"aws:updateSsmAgent\": {\n \"properties\": [\n {\n \"agentName\": \"amazon-ssm-agent\",\n \"source\": \"https://s3.{Region}.amazonaws.com/amazon-ssm-{Region}/ssm-agent-manifest.json\",\n \"allowDowngrade\": \"{{ allowDowngrade }}\",\n \"targetVersion\": \"{{ version }}\"\n }\n ]\n }\n }\n}\n", "AssociationVersion": "1" } ] }-
API の詳細については、「AWS CLI Command Reference」の「DescribeEffectiveInstanceAssociations
」を参照してください。
-
- PowerShell
-
- Tools for PowerShell V4
-
例 1: この例では、インスタンスの有効な関連付けを記述します。
Get-SSMEffectiveInstanceAssociationList -InstanceId "i-0000293ffd8c57862" -MaxResult 5出力:
AssociationId Content ------------- ------- d8617c07-2079-4c18-9847-1655fc2698b0 {...例 2: この例では、インスタンスの有効な関連付けの内容を記述します。
(Get-SSMEffectiveInstanceAssociationList -InstanceId "i-0000293ffd8c57862" -MaxResult 5).Content出力:
{ "schemaVersion": "1.2", "description": "Update the Amazon SSM Agent to the latest version or specified version.", "parameters": { "version": { "default": "", "description": "(Optional) A specific version of the Amazon SSM Agent to install. If not specified, the agen t will be updated to the latest version.", "type": "String" }, "allowDowngrade": { "default": "false", "description": "(Optional) Allow the Amazon SSM Agent service to be downgraded to an earlier version. If set to false, the service can be upgraded to newer versions only (default). If set to true, specify the earlier version.", "type": "String", "allowedValues": [ "true", "false" ] } }, "runtimeConfig": { "aws:updateSsmAgent": { "properties": [ { "agentName": "amazon-ssm-agent", "source": "https://s3.{Region}.amazonaws.com/amazon-ssm-{Region}/ssm-agent-manifest.json", "allowDowngrade": "{{ allowDowngrade }}", "targetVersion": "{{ version }}" } ] } } }-
API の詳細については、「AWS Tools for PowerShell Cmdlet リファレンス (V4)」の「DescribeEffectiveInstanceAssociations」を参照してください。
-
- Tools for PowerShell V5
-
例 1: この例では、インスタンスの有効な関連付けを記述します。
Get-SSMEffectiveInstanceAssociationList -InstanceId "i-0000293ffd8c57862" -MaxResult 5出力:
AssociationId Content ------------- ------- d8617c07-2079-4c18-9847-1655fc2698b0 {...例 2: この例では、インスタンスの有効な関連付けの内容を記述します。
(Get-SSMEffectiveInstanceAssociationList -InstanceId "i-0000293ffd8c57862" -MaxResult 5).Content出力:
{ "schemaVersion": "1.2", "description": "Update the Amazon SSM Agent to the latest version or specified version.", "parameters": { "version": { "default": "", "description": "(Optional) A specific version of the Amazon SSM Agent to install. If not specified, the agen t will be updated to the latest version.", "type": "String" }, "allowDowngrade": { "default": "false", "description": "(Optional) Allow the Amazon SSM Agent service to be downgraded to an earlier version. If set to false, the service can be upgraded to newer versions only (default). If set to true, specify the earlier version.", "type": "String", "allowedValues": [ "true", "false" ] } }, "runtimeConfig": { "aws:updateSsmAgent": { "properties": [ { "agentName": "amazon-ssm-agent", "source": "https://s3.{Region}.amazonaws.com/amazon-ssm-{Region}/ssm-agent-manifest.json", "allowDowngrade": "{{ allowDowngrade }}", "targetVersion": "{{ version }}" } ] } } }-
API の詳細については、AWS Tools for PowerShell Cmdlet リファレンス (V5) の「DescribeEffectiveInstanceAssociations」を参照してください。
-
AWS SDK デベロッパーガイドとコード例の詳細なリストについては、このサービスを AWS SDK で使用する を参照してください。このトピックには、使用開始方法に関する情報と、以前の SDK バージョンの詳細も含まれています。