The AWS SDK for JavaScript v2 has reached end-of-support.
We recommend that you migrate to AWS SDK for JavaScript v3. For additional details and information on how to migrate, please refer to the announcement.

Class: AWS.CloudTrail

Inherits:
AWS.Service show all
Identifier:
cloudtrail
API Version:
2013-11-01
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Service Description

This is the CloudTrail API Reference. It provides descriptions of actions, data types, common parameters, and common errors for CloudTrail.

CloudTrail is a web service that records Amazon Web Services API calls for your Amazon Web Services account and delivers log files to an Amazon S3 bucket. The recorded information includes the identity of the user, the start time of the Amazon Web Services API call, the source IP address, the request parameters, and the response elements returned by the service.

Note: As an alternative to the API, you can use one of the Amazon Web Services SDKs, which consist of libraries and sample code for various programming languages and platforms (Java, Ruby, .NET, iOS, Android, etc.). The SDKs provide programmatic access to CloudTrail. For example, the SDKs handle cryptographically signing requests, managing errors, and retrying requests automatically. For more information about the Amazon Web Services SDKs, including how to download and install them, see Tools to Build on Amazon Web Services.

See the CloudTrail User Guide for information about the data that is included with each Amazon Web Services API call listed in the log files.

Sending a Request Using CloudTrail

var cloudtrail = new AWS.CloudTrail();
cloudtrail.addTags(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the CloudTrail object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var cloudtrail = new AWS.CloudTrail({apiVersion: '2013-11-01'});

You can also set the API version globally in AWS.config.apiVersions using the cloudtrail service identifier:

AWS.config.apiVersions = {
  cloudtrail: '2013-11-01',
  // other service API versions
};

var cloudtrail = new AWS.CloudTrail();

Version:

  • 2013-11-01

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse