We are no longer updating the Amazon Machine Learning service or accepting new users for it. This documentation is available for existing users, but we are no longer updating it. For more information, see What is Amazon Machine Learning.
Logging Amazon ML API Calls with AWS CloudTrail
Amazon Machine Learning (Amazon ML) is integrated with AWS CloudTrail, a service that provides a record of actions taken by a user, role, or an AWS service in Amazon ML. CloudTrail captures all API calls for Amazon ML as events. The calls captured include calls from the Amazon ML console and code calls to the Amazon ML API operations. If you create a trail, you can enable continuous delivery of CloudTrail events to an Amazon S3 bucket, including events for Amazon ML. If you don't configure a trail, you can still view the most recent events in the CloudTrail console in Event history. Using the information collected by CloudTrail, you can determine the request that was made to Amazon ML, the IP address from which the request was made, who made the request, when it was made, and additional details.
To learn more about CloudTrail, including how to configure and enable it, see the AWS CloudTrail User Guide.
Amazon ML Information in CloudTrail
CloudTrail is enabled on your AWS account when you create the account. When supported event activity occurs in Amazon ML, that activity is recorded in a CloudTrail event along with other AWS service events in Event history. You can view, search, and download recent events in your AWS account. For more information, see Viewing Events with CloudTrail Event History.
For an ongoing record of events in your AWS account, including events for Amazon ML, create a trail. A trail enables CloudTrail to deliver log files to an Amazon S3 bucket. By default, when you create a trail in the console, the trail applies to all AWS Regions. The trail logs events from all Regions in the AWS partition and delivers the log files to the Amazon S3 bucket that you specify. Additionally, you can configure other AWS services to further analyze and act upon the event data collected in CloudTrail logs. For more information, see the following:
Amazon ML supports logging the following actions as events in CloudTrail log files:
The following Amazon ML operations use request parameters that contain credentials. Before these requests are sent to CloudTrail, the credentials are replaced with three asterisks ("***"):
When the following Amazon ML operations are performed with the Amazon ML console, the attribute
ComputeStatistics
is not included in the RequestParameters
component
of the CloudTrail log:
Every event or log entry contains information about who generated the request. The identity information helps you determine the following:
-
Whether the request was made with root or AWS Identity and Access Management (IAM) user credentials.
-
Whether the request was made with temporary security credentials for a role or federated user.
-
Whether the request was made by another AWS service.
For more information, see the CloudTrail userIdentity Element.
Example: Amazon ML Log File Entries
A trail is a configuration that enables delivery of events as log files to an Amazon S3 bucket that you specify. CloudTrail log files contain one or more log entries. An event represents a single request from any source and includes information about the requested action, the date and time of the action, request parameters, and so on. CloudTrail log files aren't an ordered stack trace of the public API calls, so they don't appear in any specific order.
The following example shows a CloudTrail log entry that demonstrates the action.
{ "Records": [ { "eventVersion": "1.03", "userIdentity": { "type": "IAMUser", "principalId": "EX_PRINCIPAL_ID", "arn": "arn:aws:iam::012345678910:user/Alice", "accountId": "012345678910", "accessKeyId": "EXAMPLE_KEY_ID", "userName": "Alice" }, "eventTime": "2015-11-12T15:04:02Z", "eventSource": "machinelearning.amazonaws.com", "eventName": "CreateDataSourceFromS3", "awsRegion": "us-east-1", "sourceIPAddress": "127.0.0.1", "userAgent": "console.amazonaws.com", "requestParameters": { "data": { "dataLocationS3": "s3://aml-sample-data/banking-batch.csv", "dataSchema": "{\"version\":\"1.0\",\"rowId\":null,\"rowWeight\":null, \"targetAttributeName\":null,\"dataFormat\":\"CSV\", \"dataFileContainsHeader\":false,\"attributes\":[ {\"attributeName\":\"age\",\"attributeType\":\"NUMERIC\"}, {\"attributeName\":\"job\",\"attributeType\":\"CATEGORICAL\"}, {\"attributeName\":\"marital\",\"attributeType\":\"CATEGORICAL\"}, {\"attributeName\":\"education\",\"attributeType\":\"CATEGORICAL\"}, {\"attributeName\":\"default\",\"attributeType\":\"CATEGORICAL\"}, {\"attributeName\":\"housing\",\"attributeType\":\"CATEGORICAL\"}, {\"attributeName\":\"loan\",\"attributeType\":\"CATEGORICAL\"}, {\"attributeName\":\"contact\",\"attributeType\":\"CATEGORICAL\"}, {\"attributeName\":\"month\",\"attributeType\":\"CATEGORICAL\"}, {\"attributeName\":\"day_of_week\",\"attributeType\":\"CATEGORICAL\"}, {\"attributeName\":\"duration\",\"attributeType\":\"NUMERIC\"}, {\"attributeName\":\"campaign\",\"attributeType\":\"NUMERIC\"}, {\"attributeName\":\"pdays\",\"attributeType\":\"NUMERIC\"}, {\"attributeName\":\"previous\",\"attributeType\":\"NUMERIC\"}, {\"attributeName\":\"poutcome\",\"attributeType\":\"CATEGORICAL\"}, {\"attributeName\":\"emp_var_rate\",\"attributeType\":\"NUMERIC\"}, {\"attributeName\":\"cons_price_idx\",\"attributeType\":\"NUMERIC\"}, {\"attributeName\":\"cons_conf_idx\",\"attributeType\":\"NUMERIC\"}, {\"attributeName\":\"euribor3m\",\"attributeType\":\"NUMERIC\"}, {\"attributeName\":\"nr_employed\",\"attributeType\":\"NUMERIC\"} ],\"excludedAttributeNames\":[]}" }, "dataSourceId": "exampleDataSourceId", "dataSourceName": "Banking sample for batch prediction" }, "responseElements": { "dataSourceId": "exampleDataSourceId" }, "requestID": "9b14bc94-894e-11e5-a84d-2d2deb28fdec", "eventID": "f1d47f93-c708-495b-bff1-cb935a6064b2", "eventType": "AwsApiCall", "recipientAccountId": "012345678910" }, { "eventVersion": "1.03", "userIdentity": { "type": "IAMUser", "principalId": "EX_PRINCIPAL_ID", "arn": "arn:aws:iam::012345678910:user/Alice", "accountId": "012345678910", "accessKeyId": "EXAMPLE_KEY_ID", "userName": "Alice" }, "eventTime": "2015-11-11T15:24:05Z", "eventSource": "machinelearning.amazonaws.com", "eventName": "CreateBatchPrediction", "awsRegion": "us-east-1", "sourceIPAddress": "127.0.0.1", "userAgent": "console.amazonaws.com", "requestParameters": { "batchPredictionName": "Batch prediction: ML model: Banking sample", "batchPredictionId": "exampleBatchPredictionId", "batchPredictionDataSourceId": "exampleDataSourceId", "outputUri": "s3://EXAMPLE_BUCKET/BatchPredictionOutput/", "mLModelId": "exampleModelId" }, "responseElements": { "batchPredictionId": "exampleBatchPredictionId" }, "requestID": "3e18f252-8888-11e5-b6ca-c9da3c0f3955", "eventID": "db27a771-7a2e-4e9d-bfa0-59deee9d936d", "eventType": "AwsApiCall", "recipientAccountId": "012345678910" } ] }