SSM / Client / describe_instance_information

describe_instance_information#

SSM.Client.describe_instance_information(**kwargs)#

Provides information about one or more of your managed nodes, including the operating system platform, SSM Agent version, association status, and IP address. This operation does not return information for nodes that are either Stopped or Terminated.

If you specify one or more node IDs, the operation returns information for those managed nodes. If you don’t specify node IDs, it returns information for all your managed nodes. If you specify a node ID that isn’t valid or a node that you don’t own, you receive an error.

Note

The IamRole field returned for this API operation is the Identity and Access Management (IAM) role assigned to on-premises managed nodes. This operation does not return the IAM role for EC2 instances.

See also: AWS API Documentation

Request Syntax

response = client.describe_instance_information(
    InstanceInformationFilterList=[
        {
            'key': 'InstanceIds'|'AgentVersion'|'PingStatus'|'PlatformTypes'|'ActivationIds'|'IamRole'|'ResourceType'|'AssociationStatus',
            'valueSet': [
                'string',
            ]
        },
    ],
    Filters=[
        {
            'Key': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    MaxResults=123,
    NextToken='string'
)
Parameters:
  • InstanceInformationFilterList (list) –

    This is a legacy method. We recommend that you don’t use this method. Instead, use the Filters data type. Filters enables you to return node information by filtering based on tags applied to managed nodes.

    Note

    Attempting to use InstanceInformationFilterList and Filters leads to an exception error.

    • (dict) –

      Describes a filter for a specific list of managed nodes. You can filter node information by using tags. You specify tags by using a key-value mapping.

      Use this operation instead of the DescribeInstanceInformationRequest$InstanceInformationFilterList method. The InstanceInformationFilterList method is a legacy method and doesn’t support tags.

      • key (string) – [REQUIRED]

        The name of the filter.

      • valueSet (list) – [REQUIRED]

        The filter values.

        • (string) –

  • Filters (list) –

    One or more filters. Use a filter to return a more specific list of managed nodes. You can filter based on tags applied to your managed nodes. Tag filters can’t be combined with other filter types. Use this Filters data type instead of InstanceInformationFilterList, which is deprecated.

    • (dict) –

      The filters to describe or get information about your managed nodes.

      • Key (string) – [REQUIRED]

        The filter key name to describe your managed nodes.

        Valid filter key values: ActivationIds | AgentVersion | AssociationStatus | IamRole | InstanceIds | PingStatus | PlatformTypes | ResourceType | SourceIds | SourceTypes | “tag-key” | “tag: {keyname}

        • Valid values for the AssociationStatus filter key: Success | Pending | Failed

        • Valid values for the PingStatus filter key: Online | ConnectionLost | Inactive (deprecated)

        • Valid values for the PlatformType filter key: Windows | Linux | MacOS

        • Valid values for the ResourceType filter key: EC2Instance | ManagedInstance

        • Valid values for the SourceType filter key: AWS::EC2::Instance | AWS::SSM::ManagedInstance | AWS::IoT::Thing

        • Valid tag examples: Key=tag-key,Values=Purpose | Key=tag:Purpose,Values=Test.

      • Values (list) – [REQUIRED]

        The filter values.

        • (string) –

  • MaxResults (integer) – The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results. The default value is 10 items.

  • NextToken (string) – The token for the next set of items to return. (You received this token from a previous call.)

Return type:

dict

Returns:

Response Syntax

{
    'InstanceInformationList': [
        {
            'InstanceId': 'string',
            'PingStatus': 'Online'|'ConnectionLost'|'Inactive',
            'LastPingDateTime': datetime(2015, 1, 1),
            'AgentVersion': 'string',
            'IsLatestVersion': True|False,
            'PlatformType': 'Windows'|'Linux'|'MacOS',
            'PlatformName': 'string',
            'PlatformVersion': 'string',
            'ActivationId': 'string',
            'IamRole': 'string',
            'RegistrationDate': datetime(2015, 1, 1),
            'ResourceType': 'ManagedInstance'|'EC2Instance',
            'Name': 'string',
            'IPAddress': 'string',
            'ComputerName': 'string',
            'AssociationStatus': 'string',
            'LastAssociationExecutionDate': datetime(2015, 1, 1),
            'LastSuccessfulAssociationExecutionDate': datetime(2015, 1, 1),
            'AssociationOverview': {
                'DetailedStatus': 'string',
                'InstanceAssociationStatusAggregatedCount': {
                    'string': 123
                }
            },
            'SourceId': 'string',
            'SourceType': 'AWS::EC2::Instance'|'AWS::IoT::Thing'|'AWS::SSM::ManagedInstance'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    • InstanceInformationList (list) –

      The managed node information list.

      • (dict) –

        Describes a filter for a specific list of managed nodes.

        • InstanceId (string) –

          The managed node ID.

        • PingStatus (string) –

          Connection status of SSM Agent.

          Note

          The status Inactive has been deprecated and is no longer in use.

        • LastPingDateTime (datetime) –

          The date and time when the agent last pinged the Systems Manager service.

        • AgentVersion (string) –

          The version of SSM Agent running on your Linux managed node.

        • IsLatestVersion (boolean) –

          Indicates whether the latest version of SSM Agent is running on your Linux managed node. This field doesn’t indicate whether or not the latest version is installed on Windows managed nodes, because some older versions of Windows Server use the EC2Config service to process Systems Manager requests.

        • PlatformType (string) –

          The operating system platform type.

        • PlatformName (string) –

          The name of the operating system platform running on your managed node.

        • PlatformVersion (string) –

          The version of the OS platform running on your managed node.

        • ActivationId (string) –

          The activation ID created by Amazon Web Services Systems Manager when the server or virtual machine (VM) was registered.

        • IamRole (string) –

          The Identity and Access Management (IAM) role assigned to the on-premises Systems Manager managed node. This call doesn’t return the IAM role for Amazon Elastic Compute Cloud (Amazon EC2) instances. To retrieve the IAM role for an EC2 instance, use the Amazon EC2 DescribeInstances operation. For information, see DescribeInstances in the Amazon EC2 API Reference or describe-instances in the Amazon Web Services CLI Command Reference.

        • RegistrationDate (datetime) –

          The date the server or VM was registered with Amazon Web Services as a managed node.

        • ResourceType (string) –

          The type of instance. Instances are either EC2 instances or managed instances.

        • Name (string) –

          The name assigned to an on-premises server, edge device, or virtual machine (VM) when it is activated as a Systems Manager managed node. The name is specified as the DefaultInstanceName property using the CreateActivation command. It is applied to the managed node by specifying the Activation Code and Activation ID when you install SSM Agent on the node, as explained in Install SSM Agent for a hybrid environment (Linux) and Install SSM Agent for a hybrid environment (Windows). To retrieve the Name tag of an EC2 instance, use the Amazon EC2 DescribeInstances operation. For information, see DescribeInstances in the Amazon EC2 API Reference or describe-instances in the Amazon Web Services CLI Command Reference.

        • IPAddress (string) –

          The IP address of the managed node.

        • ComputerName (string) –

          The fully qualified host name of the managed node.

        • AssociationStatus (string) –

          The status of the association.

        • LastAssociationExecutionDate (datetime) –

          The date the association was last run.

        • LastSuccessfulAssociationExecutionDate (datetime) –

          The last date the association was successfully run.

        • AssociationOverview (dict) –

          Information about the association.

          • DetailedStatus (string) –

            Detailed status information about the aggregated associations.

          • InstanceAssociationStatusAggregatedCount (dict) –

            The number of associations for the managed node(s).

            • (string) –

              • (integer) –

        • SourceId (string) –

          The ID of the source resource. For IoT Greengrass devices, SourceId is the Thing name.

        • SourceType (string) –

          The type of the source resource. For IoT Greengrass devices, SourceType is AWS::IoT::Thing.

    • NextToken (string) –

      The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

Exceptions

  • SSM.Client.exceptions.InternalServerError

  • SSM.Client.exceptions.InvalidInstanceId

  • SSM.Client.exceptions.InvalidNextToken

  • SSM.Client.exceptions.InvalidInstanceInformationFilterValue

  • SSM.Client.exceptions.InvalidFilterKey