Assurance / Client / start_resource_activities_query

start_resource_activities_query

Assurance.Client.start_resource_activities_query(**kwargs)

Starts a query of the AWS API calls that an artificial intelligence (AI) agent on Amazon Bedrock AgentCore Runtime made. Use the results to audit which resources the agent touched in your account. Returns a query ID. To check the status of the query and get its results, call GetResourceActivitiesQueryResults.

The agent runtime that you query must be in your AWS account.

See also: AWS API Documentation

Request Syntax

response = client.start_resource_activities_query(
    environmentArn='string',
    project='string',
    actorArn='string',
    startTime=datetime(2015, 1, 1),
    endTime=datetime(2015, 1, 1),
    aggregationLevels=[
        'ACTION'|'RESOURCE'|'SESSION',
    ],
    filters=[
        {
            'name': 'sessionId',
            'values': [
                'string',
            ]
        },
    ]
)
Parameters:
  • environmentArn (string) –

    [REQUIRED]

    The ARN of the environment to query in.

  • project (string) –

    [REQUIRED]

    The project to query in.

  • actorArn (string) –

    [REQUIRED]

    The ARN of the agent runtime whose activity to query. The agent runtime must be in your AWS account.

  • startTime (datetime) – The start of the time range to query, inclusive. The default is 24 hours before the request.

  • endTime (datetime) – The end of the time range to query, exclusive. The default is the time of the request.

  • aggregationLevels (list) –

    The ways to group the results. By default, the results include every grouping. Valid values:

    • ACTION – Call counts for each AWS service and API action.

    • RESOURCE – Call counts for each resource.

    • SESSION – The agent sessions in the time range.

    • (string) –

      The ways to group the results of a resource activities query.

  • filters (list) –

    The filters to apply to the results. A result must match every filter. Within one filter, a result must match at least one of the values. If you don’t specify any filters, the query returns all activity in the time range.

    • (dict) –

      A filter for the results of a resource activities query.

      • name (string) – [REQUIRED]

        The field to filter on. The only supported value is sessionId.

      • values (list) – [REQUIRED]

        The values to match exactly. A result matches the filter if it matches any of these values.

        • (string) –

          The ID of an agent session, as reported by Amazon Bedrock AgentCore Runtime.

Return type:

dict

Returns:

Response Syntax

{
    'queryId': 'string'
}

Response Structure

  • (dict) –

    • queryId (string) –

      The ID of the query. Pass it to GetResourceActivitiesQueryResults to get the status and results of the query. The ID doesn’t give access to the results.

Exceptions