cloudtrail

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package cloudtrail provides a client for AWS CloudTrail.

Index

Examples

Constants

View Source
const (
	// @enum LookupAttributeKey
	LookupAttributeKeyEventId = "EventId"
	// @enum LookupAttributeKey
	LookupAttributeKeyEventName = "EventName"
	// @enum LookupAttributeKey
	LookupAttributeKeyUsername = "Username"
	// @enum LookupAttributeKey
	LookupAttributeKeyResourceType = "ResourceType"
	// @enum LookupAttributeKey
	LookupAttributeKeyResourceName = "ResourceName"
)
View Source
const ServiceName = "cloudtrail"

A ServiceName is the name of the service the client will make API calls to.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddTagsInput added in v0.9.11

type AddTagsInput struct {

	// Specifies the ARN of the trail to which one or more tags will be added. The
	// format of a trail ARN is:
	//
	//  arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail
	ResourceId *string `type:"string" required:"true"`

	// Contains a list of CloudTrail tags, up to a limit of 10.
	TagsList []*Tag `type:"list"`
	// contains filtered or unexported fields
}

Specifies the tags to add to a trail.

func (AddTagsInput) GoString added in v0.9.11

func (s AddTagsInput) GoString() string

GoString returns the string representation

func (AddTagsInput) String added in v0.9.11

func (s AddTagsInput) String() string

String returns the string representation

func (*AddTagsInput) Validate added in v1.1.21

func (s *AddTagsInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type AddTagsOutput added in v0.9.11

type AddTagsOutput struct {
	// contains filtered or unexported fields
}

Returns the objects or data listed below if successful. Otherwise, returns an error.

func (AddTagsOutput) GoString added in v0.9.11

func (s AddTagsOutput) GoString() string

GoString returns the string representation

func (AddTagsOutput) String added in v0.9.11

func (s AddTagsOutput) String() string

String returns the string representation

type CloudTrail

type CloudTrail struct {
	*client.Client
}

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 AWS API calls for your AWS account and delivers log files to an Amazon S3 bucket. The recorded information includes the identity of the user, the start time of the AWS API call, the source IP address, the request parameters, and the response elements returned by the service.

As an alternative to the API, you can use one of the AWS SDKs, which consist

of libraries and sample code for various programming languages and platforms (Java, Ruby, .NET, iOS, Android, etc.). The SDKs provide a convenient way to create programmatic access to AWSCloudTrail. For example, the SDKs take care of cryptographically signing requests, managing errors, and retrying requests automatically. For information about the AWS SDKs, including how to download and install them, see the Tools for Amazon Web Services page (http://aws.amazon.com/tools/).

See the CloudTrail User Guide for information about the data that is included

with each AWS API call listed in the log files. The service client's operations are safe to be used concurrently. It is not safe to mutate any of the client's properties though.

func New

func New(p client.ConfigProvider, cfgs ...*aws.Config) *CloudTrail

New creates a new instance of the CloudTrail client with a session. If additional configuration is needed for the client instance use the optional aws.Config parameter to add your extra config.

Example:

// Create a CloudTrail client from just a session.
svc := cloudtrail.New(mySession)

// Create a CloudTrail client with additional configuration
svc := cloudtrail.New(mySession, aws.NewConfig().WithRegion("us-west-2"))

func (*CloudTrail) AddTags added in v0.9.11

func (c *CloudTrail) AddTags(input *AddTagsInput) (*AddTagsOutput, error)

Adds one or more tags to a trail, up to a limit of 10. Tags must be unique per trail. Overwrites an existing tag's value when a new value is specified for an existing tag key. If you specify a key without a value, the tag will be created with the specified key and a value of null. You can tag a trail that applies to all regions only from the region in which the trail was created (that is, from its home region).

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudtrail"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := cloudtrail.New(sess)

	params := &cloudtrail.AddTagsInput{
		ResourceId: aws.String("String"), // Required
		TagsList: []*cloudtrail.Tag{
			{ // Required
				Key:   aws.String("String"), // Required
				Value: aws.String("String"),
			},
			// More values...
		},
	}
	resp, err := svc.AddTags(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*CloudTrail) AddTagsRequest added in v0.9.11

func (c *CloudTrail) AddTagsRequest(input *AddTagsInput) (req *request.Request, output *AddTagsOutput)

AddTagsRequest generates a "aws/request.Request" representing the client's request for the AddTags operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the AddTags method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the AddTagsRequest method.
req, resp := client.AddTagsRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*CloudTrail) CreateTrail

func (c *CloudTrail) CreateTrail(input *CreateTrailInput) (*CreateTrailOutput, error)

Creates a trail that specifies the settings for delivery of log data to an Amazon S3 bucket. A maximum of five trails can exist in a region, irrespective of the region in which they were created.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudtrail"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := cloudtrail.New(sess)

	params := &cloudtrail.CreateTrailInput{
		Name:                       aws.String("String"), // Required
		S3BucketName:               aws.String("String"), // Required
		CloudWatchLogsLogGroupArn:  aws.String("String"),
		CloudWatchLogsRoleArn:      aws.String("String"),
		EnableLogFileValidation:    aws.Bool(true),
		IncludeGlobalServiceEvents: aws.Bool(true),
		IsMultiRegionTrail:         aws.Bool(true),
		KmsKeyId:                   aws.String("String"),
		S3KeyPrefix:                aws.String("String"),
		SnsTopicName:               aws.String("String"),
	}
	resp, err := svc.CreateTrail(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*CloudTrail) CreateTrailRequest

func (c *CloudTrail) CreateTrailRequest(input *CreateTrailInput) (req *request.Request, output *CreateTrailOutput)

CreateTrailRequest generates a "aws/request.Request" representing the client's request for the CreateTrail operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the CreateTrail method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the CreateTrailRequest method.
req, resp := client.CreateTrailRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*CloudTrail) DeleteTrail

func (c *CloudTrail) DeleteTrail(input *DeleteTrailInput) (*DeleteTrailOutput, error)

Deletes a trail. This operation must be called from the region in which the trail was created. DeleteTrail cannot be called on the shadow trails (replicated trails in other regions) of a trail that is enabled in all regions.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudtrail"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := cloudtrail.New(sess)

	params := &cloudtrail.DeleteTrailInput{
		Name: aws.String("String"), // Required
	}
	resp, err := svc.DeleteTrail(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*CloudTrail) DeleteTrailRequest

func (c *CloudTrail) DeleteTrailRequest(input *DeleteTrailInput) (req *request.Request, output *DeleteTrailOutput)

DeleteTrailRequest generates a "aws/request.Request" representing the client's request for the DeleteTrail operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the DeleteTrail method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the DeleteTrailRequest method.
req, resp := client.DeleteTrailRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*CloudTrail) DescribeTrails

func (c *CloudTrail) DescribeTrails(input *DescribeTrailsInput) (*DescribeTrailsOutput, error)

Retrieves settings for the trail associated with the current region for your account.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudtrail"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := cloudtrail.New(sess)

	params := &cloudtrail.DescribeTrailsInput{
		IncludeShadowTrails: aws.Bool(true),
		TrailNameList: []*string{
			aws.String("String"), // Required
			// More values...
		},
	}
	resp, err := svc.DescribeTrails(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*CloudTrail) DescribeTrailsRequest

func (c *CloudTrail) DescribeTrailsRequest(input *DescribeTrailsInput) (req *request.Request, output *DescribeTrailsOutput)

DescribeTrailsRequest generates a "aws/request.Request" representing the client's request for the DescribeTrails operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the DescribeTrails method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the DescribeTrailsRequest method.
req, resp := client.DescribeTrailsRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*CloudTrail) GetTrailStatus

func (c *CloudTrail) GetTrailStatus(input *GetTrailStatusInput) (*GetTrailStatusOutput, error)

Returns a JSON-formatted list of information about the specified trail. Fields include information on delivery errors, Amazon SNS and Amazon S3 errors, and start and stop logging times for each trail. This operation returns trail status from a single region. To return trail status from all regions, you must call the operation on each region.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudtrail"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := cloudtrail.New(sess)

	params := &cloudtrail.GetTrailStatusInput{
		Name: aws.String("String"), // Required
	}
	resp, err := svc.GetTrailStatus(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*CloudTrail) GetTrailStatusRequest

func (c *CloudTrail) GetTrailStatusRequest(input *GetTrailStatusInput) (req *request.Request, output *GetTrailStatusOutput)

GetTrailStatusRequest generates a "aws/request.Request" representing the client's request for the GetTrailStatus operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the GetTrailStatus method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the GetTrailStatusRequest method.
req, resp := client.GetTrailStatusRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*CloudTrail) ListPublicKeys added in v0.9.11

func (c *CloudTrail) ListPublicKeys(input *ListPublicKeysInput) (*ListPublicKeysOutput, error)

Returns all public keys whose private keys were used to sign the digest files within the specified time range. The public key is needed to validate digest files that were signed with its corresponding private key.

CloudTrail uses different private/public key pairs per region. Each digest

file is signed with a private key unique to its region. Therefore, when you validate a digest file from a particular region, you must look in the same region for its corresponding public key.

Example
package main

import (
	"fmt"
	"time"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudtrail"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := cloudtrail.New(sess)

	params := &cloudtrail.ListPublicKeysInput{
		EndTime:   aws.Time(time.Now()),
		NextToken: aws.String("String"),
		StartTime: aws.Time(time.Now()),
	}
	resp, err := svc.ListPublicKeys(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*CloudTrail) ListPublicKeysRequest added in v0.9.11

func (c *CloudTrail) ListPublicKeysRequest(input *ListPublicKeysInput) (req *request.Request, output *ListPublicKeysOutput)

ListPublicKeysRequest generates a "aws/request.Request" representing the client's request for the ListPublicKeys operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the ListPublicKeys method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the ListPublicKeysRequest method.
req, resp := client.ListPublicKeysRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*CloudTrail) ListTags added in v0.9.11

func (c *CloudTrail) ListTags(input *ListTagsInput) (*ListTagsOutput, error)

Lists the tags for the trail in the current region.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudtrail"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := cloudtrail.New(sess)

	params := &cloudtrail.ListTagsInput{
		ResourceIdList: []*string{ // Required
			aws.String("String"), // Required
			// More values...
		},
		NextToken: aws.String("String"),
	}
	resp, err := svc.ListTags(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*CloudTrail) ListTagsRequest added in v0.9.11

func (c *CloudTrail) ListTagsRequest(input *ListTagsInput) (req *request.Request, output *ListTagsOutput)

ListTagsRequest generates a "aws/request.Request" representing the client's request for the ListTags operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the ListTags method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the ListTagsRequest method.
req, resp := client.ListTagsRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*CloudTrail) LookupEvents

func (c *CloudTrail) LookupEvents(input *LookupEventsInput) (*LookupEventsOutput, error)

Looks up API activity events captured by CloudTrail that create, update, or delete resources in your account. Events for a region can be looked up for the times in which you had CloudTrail turned on in that region during the last seven days. Lookup supports five different attributes: time range (defined by a start time and end time), user name, event name, resource type, and resource name. All attributes are optional. The maximum number of attributes that can be specified in any one lookup request are time range and one other attribute. The default number of results returned is 10, with a maximum of 50 possible. The response includes a token that you can use to get the next page of results.

The rate of lookup requests is limited to one per second per account. If

this limit is exceeded, a throttling error occurs.

Events that occurred during the selected time range will not be available

for lookup if CloudTrail logging was not enabled when the events occurred.

Example
package main

import (
	"fmt"
	"time"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudtrail"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := cloudtrail.New(sess)

	params := &cloudtrail.LookupEventsInput{
		EndTime: aws.Time(time.Now()),
		LookupAttributes: []*cloudtrail.LookupAttribute{
			{ // Required
				AttributeKey:   aws.String("LookupAttributeKey"), // Required
				AttributeValue: aws.String("String"),             // Required
			},
			// More values...
		},
		MaxResults: aws.Int64(1),
		NextToken:  aws.String("NextToken"),
		StartTime:  aws.Time(time.Now()),
	}
	resp, err := svc.LookupEvents(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*CloudTrail) LookupEventsRequest

func (c *CloudTrail) LookupEventsRequest(input *LookupEventsInput) (req *request.Request, output *LookupEventsOutput)

LookupEventsRequest generates a "aws/request.Request" representing the client's request for the LookupEvents operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the LookupEvents method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the LookupEventsRequest method.
req, resp := client.LookupEventsRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*CloudTrail) RemoveTags added in v0.9.11

func (c *CloudTrail) RemoveTags(input *RemoveTagsInput) (*RemoveTagsOutput, error)

Removes the specified tags from a trail.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudtrail"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := cloudtrail.New(sess)

	params := &cloudtrail.RemoveTagsInput{
		ResourceId: aws.String("String"), // Required
		TagsList: []*cloudtrail.Tag{
			{ // Required
				Key:   aws.String("String"), // Required
				Value: aws.String("String"),
			},
			// More values...
		},
	}
	resp, err := svc.RemoveTags(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*CloudTrail) RemoveTagsRequest added in v0.9.11

func (c *CloudTrail) RemoveTagsRequest(input *RemoveTagsInput) (req *request.Request, output *RemoveTagsOutput)

RemoveTagsRequest generates a "aws/request.Request" representing the client's request for the RemoveTags operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the RemoveTags method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the RemoveTagsRequest method.
req, resp := client.RemoveTagsRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*CloudTrail) StartLogging

func (c *CloudTrail) StartLogging(input *StartLoggingInput) (*StartLoggingOutput, error)

Starts the recording of AWS API calls and log file delivery for a trail. For a trail that is enabled in all regions, this operation must be called from the region in which the trail was created. This operation cannot be called on the shadow trails (replicated trails in other regions) of a trail that is enabled in all regions.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudtrail"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := cloudtrail.New(sess)

	params := &cloudtrail.StartLoggingInput{
		Name: aws.String("String"), // Required
	}
	resp, err := svc.StartLogging(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*CloudTrail) StartLoggingRequest

func (c *CloudTrail) StartLoggingRequest(input *StartLoggingInput) (req *request.Request, output *StartLoggingOutput)

StartLoggingRequest generates a "aws/request.Request" representing the client's request for the StartLogging operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the StartLogging method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the StartLoggingRequest method.
req, resp := client.StartLoggingRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*CloudTrail) StopLogging

func (c *CloudTrail) StopLogging(input *StopLoggingInput) (*StopLoggingOutput, error)

Suspends the recording of AWS API calls and log file delivery for the specified trail. Under most circumstances, there is no need to use this action. You can update a trail without stopping it first. This action is the only way to stop recording. For a trail enabled in all regions, this operation must be called from the region in which the trail was created, or an InvalidHomeRegionException will occur. This operation cannot be called on the shadow trails (replicated trails in other regions) of a trail enabled in all regions.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudtrail"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := cloudtrail.New(sess)

	params := &cloudtrail.StopLoggingInput{
		Name: aws.String("String"), // Required
	}
	resp, err := svc.StopLogging(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*CloudTrail) StopLoggingRequest

func (c *CloudTrail) StopLoggingRequest(input *StopLoggingInput) (req *request.Request, output *StopLoggingOutput)

StopLoggingRequest generates a "aws/request.Request" representing the client's request for the StopLogging operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the StopLogging method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the StopLoggingRequest method.
req, resp := client.StopLoggingRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*CloudTrail) UpdateTrail

func (c *CloudTrail) UpdateTrail(input *UpdateTrailInput) (*UpdateTrailOutput, error)

Updates the settings that specify delivery of log files. Changes to a trail do not require stopping the CloudTrail service. Use this action to designate an existing bucket for log delivery. If the existing bucket has previously been a target for CloudTrail log files, an IAM policy exists for the bucket. UpdateTrail must be called from the region in which the trail was created; otherwise, an InvalidHomeRegionException is thrown.

Example
package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudtrail"
)

func main() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := cloudtrail.New(sess)

	params := &cloudtrail.UpdateTrailInput{
		Name:                       aws.String("String"), // Required
		CloudWatchLogsLogGroupArn:  aws.String("String"),
		CloudWatchLogsRoleArn:      aws.String("String"),
		EnableLogFileValidation:    aws.Bool(true),
		IncludeGlobalServiceEvents: aws.Bool(true),
		IsMultiRegionTrail:         aws.Bool(true),
		KmsKeyId:                   aws.String("String"),
		S3BucketName:               aws.String("String"),
		S3KeyPrefix:                aws.String("String"),
		SnsTopicName:               aws.String("String"),
	}
	resp, err := svc.UpdateTrail(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Output:

func (*CloudTrail) UpdateTrailRequest

func (c *CloudTrail) UpdateTrailRequest(input *UpdateTrailInput) (req *request.Request, output *UpdateTrailOutput)

UpdateTrailRequest generates a "aws/request.Request" representing the client's request for the UpdateTrail operation. The "output" return value can be used to capture response data after the request's "Send" method is called.

Creating a request object using this method should be used when you want to inject custom logic into the request's lifecycle using a custom handler, or if you want to access properties on the request object before or after sending the request. If you just want the service response, call the UpdateTrail method directly instead.

Note: You must call the "Send" method on the returned request object in order to execute the request.

// Example sending a request using the UpdateTrailRequest method.
req, resp := client.UpdateTrailRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

type CreateTrailInput

type CreateTrailInput struct {

	// Specifies a log group name using an Amazon Resource Name (ARN), a unique
	// identifier that represents the log group to which CloudTrail logs will be
	// delivered. Not required unless you specify CloudWatchLogsRoleArn.
	CloudWatchLogsLogGroupArn *string `type:"string"`

	// Specifies the role for the CloudWatch Logs endpoint to assume to write to
	// a user's log group.
	CloudWatchLogsRoleArn *string `type:"string"`

	// Specifies whether log file integrity validation is enabled. The default is
	// false.
	//
	//  When you disable log file integrity validation, the chain of digest files
	// is broken after one hour. CloudTrail will not create digest files for log
	// files that were delivered during a period in which log file integrity validation
	// was disabled. For example, if you enable log file integrity validation at
	// noon on January 1, disable it at noon on January 2, and re-enable it at noon
	// on January 10, digest files will not be created for the log files delivered
	// from noon on January 2 to noon on January 10. The same applies whenever you
	// stop CloudTrail logging or delete a trail.
	EnableLogFileValidation *bool `type:"boolean"`

	// Specifies whether the trail is publishing events from global services such
	// as IAM to the log files.
	IncludeGlobalServiceEvents *bool `type:"boolean"`

	// Specifies whether the trail is created in the current region or in all regions.
	// The default is false.
	IsMultiRegionTrail *bool `type:"boolean"`

	// Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail.
	// The value can be a an alias name prefixed by "alias/", a fully specified
	// ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.
	//
	// Examples:
	//
	//   alias/MyAliasName
	//
	//   arn:aws:kms:us-east-1:123456789012:alias/MyAliasName
	//
	//   arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
	//
	//   12345678-1234-1234-1234-123456789012
	KmsKeyId *string `type:"string"`

	// Specifies the name of the trail. The name must meet the following requirements:
	//
	//   Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores
	// (_), or dashes (-)
	//
	//   Start with a letter or number, and end with a letter or number
	//
	//   Be between 3 and 128 characters
	//
	//   Have no adjacent periods, underscores or dashes. Names like my-_namespace
	// and my--namespace are invalid.
	//
	//   Not be in IP address format (for example, 192.168.5.4)
	Name *string `type:"string" required:"true"`

	// Specifies the name of the Amazon S3 bucket designated for publishing log
	// files. See Amazon S3 Bucket Naming Requirements (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/create_trail_naming_policy.html).
	S3BucketName *string `type:"string" required:"true"`

	// Specifies the Amazon S3 key prefix that comes after the name of the bucket
	// you have designated for log file delivery. For more information, see Finding
	// Your CloudTrail Log Files (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html).
	// The maximum length is 200 characters.
	S3KeyPrefix *string `type:"string"`

	// Specifies the name of the Amazon SNS topic defined for notification of log
	// file delivery. The maximum length is 256 characters.
	SnsTopicName *string `type:"string"`
	// contains filtered or unexported fields
}

Specifies the settings for each trail.

func (CreateTrailInput) GoString added in v0.6.5

func (s CreateTrailInput) GoString() string

GoString returns the string representation

func (CreateTrailInput) String added in v0.6.5

func (s CreateTrailInput) String() string

String returns the string representation

func (*CreateTrailInput) Validate added in v1.1.21

func (s *CreateTrailInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type CreateTrailOutput

type CreateTrailOutput struct {

	// Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail
	// logs will be delivered.
	CloudWatchLogsLogGroupArn *string `type:"string"`

	// Specifies the role for the CloudWatch Logs endpoint to assume to write to
	// a user's log group.
	CloudWatchLogsRoleArn *string `type:"string"`

	// Specifies whether the trail is publishing events from global services such
	// as IAM to the log files.
	IncludeGlobalServiceEvents *bool `type:"boolean"`

	// Specifies whether the trail exists in one region or in all regions.
	IsMultiRegionTrail *bool `type:"boolean"`

	// Specifies the KMS key ID that encrypts the logs delivered by CloudTrail.
	// The value is a fully specified ARN to a KMS key in the format:
	//
	//  arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
	KmsKeyId *string `type:"string"`

	// Specifies whether log file integrity validation is enabled.
	LogFileValidationEnabled *bool `type:"boolean"`

	// Specifies the name of the trail.
	Name *string `type:"string"`

	// Specifies the name of the Amazon S3 bucket designated for publishing log
	// files.
	S3BucketName *string `type:"string"`

	// Specifies the Amazon S3 key prefix that comes after the name of the bucket
	// you have designated for log file delivery. For more information, see Finding
	// Your CloudTrail Log Files (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html).
	S3KeyPrefix *string `type:"string"`

	// Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications
	// when log files are delivered. The format of a topic ARN is:
	//
	//  arn:aws:sns:us-east-1:123456789012:MyTopic
	SnsTopicARN *string `type:"string"`

	// This field is deprecated. Use SnsTopicARN.
	SnsTopicName *string `deprecated:"true" type:"string"`

	// Specifies the ARN of the trail that was created. The format of a trail ARN
	// is:
	//
	//  arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail
	TrailARN *string `type:"string"`
	// contains filtered or unexported fields
}

Returns the objects or data listed below if successful. Otherwise, returns an error.

func (CreateTrailOutput) GoString added in v0.6.5

func (s CreateTrailOutput) GoString() string

GoString returns the string representation

func (CreateTrailOutput) String added in v0.6.5

func (s CreateTrailOutput) String() string

String returns the string representation

type DeleteTrailInput

type DeleteTrailInput struct {

	// Specifies the name or the CloudTrail ARN of the trail to be deleted. The
	// format of a trail ARN is:
	//
	//  arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail
	Name *string `type:"string" required:"true"`
	// contains filtered or unexported fields
}

The request that specifies the name of a trail to delete.

func (DeleteTrailInput) GoString added in v0.6.5

func (s DeleteTrailInput) GoString() string

GoString returns the string representation

func (DeleteTrailInput) String added in v0.6.5

func (s DeleteTrailInput) String() string

String returns the string representation

func (*DeleteTrailInput) Validate added in v1.1.21

func (s *DeleteTrailInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type DeleteTrailOutput

type DeleteTrailOutput struct {
	// contains filtered or unexported fields
}

Returns the objects or data listed below if successful. Otherwise, returns an error.

func (DeleteTrailOutput) GoString added in v0.6.5

func (s DeleteTrailOutput) GoString() string

GoString returns the string representation

func (DeleteTrailOutput) String added in v0.6.5

func (s DeleteTrailOutput) String() string

String returns the string representation

type DescribeTrailsInput

type DescribeTrailsInput struct {

	// Specifies whether to include shadow trails in the response. A shadow trail
	// is the replication in a region of a trail that was created in a different
	// region. The default is true.
	IncludeShadowTrails *bool `locationName:"includeShadowTrails" type:"boolean"`

	// Specifies a list of trail names, trail ARNs, or both, of the trails to describe.
	// The format of a trail ARN is:
	//
	//  arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail
	//
	// If an empty list is specified, information for the trail in the current
	// region is returned.
	//
	//   If an empty list is specified and IncludeShadowTrails is false, then information
	// for all trails in the current region is returned.
	//
	//   If an empty list is specified and IncludeShadowTrails is null or true,
	// then information for all trails in the current region and any associated
	// shadow trails in other regions is returned.
	//
	//    If one or more trail names are specified, information is returned only
	// if the names match the names of trails belonging only to the current region.
	// To return information about a trail in another region, you must specify its
	// trail ARN.
	TrailNameList []*string `locationName:"trailNameList" type:"list"`
	// contains filtered or unexported fields
}

Returns information about the trail.

func (DescribeTrailsInput) GoString added in v0.6.5

func (s DescribeTrailsInput) GoString() string

GoString returns the string representation

func (DescribeTrailsInput) String added in v0.6.5

func (s DescribeTrailsInput) String() string

String returns the string representation

type DescribeTrailsOutput

type DescribeTrailsOutput struct {

	// The list of trail objects.
	TrailList []*Trail `locationName:"trailList" type:"list"`
	// contains filtered or unexported fields
}

Returns the objects or data listed below if successful. Otherwise, returns an error.

func (DescribeTrailsOutput) GoString added in v0.6.5

func (s DescribeTrailsOutput) GoString() string

GoString returns the string representation

func (DescribeTrailsOutput) String added in v0.6.5

func (s DescribeTrailsOutput) String() string

String returns the string representation

type Event

type Event struct {

	// A JSON string that contains a representation of the event returned.
	CloudTrailEvent *string `type:"string"`

	// The CloudTrail ID of the event returned.
	EventId *string `type:"string"`

	// The name of the event returned.
	EventName *string `type:"string"`

	// The date and time of the event returned.
	EventTime *time.Time `type:"timestamp" timestampFormat:"unix"`

	// A list of resources referenced by the event returned.
	Resources []*Resource `type:"list"`

	// A user name or role name of the requester that called the API in the event
	// returned.
	Username *string `type:"string"`
	// contains filtered or unexported fields
}

Contains information about an event that was returned by a lookup request. The result includes a representation of a CloudTrail event.

func (Event) GoString added in v0.6.5

func (s Event) GoString() string

GoString returns the string representation

func (Event) String added in v0.6.5

func (s Event) String() string

String returns the string representation

type GetTrailStatusInput

type GetTrailStatusInput struct {

	// Specifies the name or the CloudTrail ARN of the trail for which you are requesting
	// status. To get the status of a shadow trail (a replication of the trail in
	// another region), you must specify its ARN. The format of a trail ARN is:
	//
	//  arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail
	Name *string `type:"string" required:"true"`
	// contains filtered or unexported fields
}

The name of a trail about which you want the current status.

func (GetTrailStatusInput) GoString added in v0.6.5

func (s GetTrailStatusInput) GoString() string

GoString returns the string representation

func (GetTrailStatusInput) String added in v0.6.5

func (s GetTrailStatusInput) String() string

String returns the string representation

func (*GetTrailStatusInput) Validate added in v1.1.21

func (s *GetTrailStatusInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type GetTrailStatusOutput

type GetTrailStatusOutput struct {

	// Whether the CloudTrail is currently logging AWS API calls.
	IsLogging *bool `type:"boolean"`

	// Displays any CloudWatch Logs error that CloudTrail encountered when attempting
	// to deliver logs to CloudWatch Logs.
	LatestCloudWatchLogsDeliveryError *string `type:"string"`

	// Displays the most recent date and time when CloudTrail delivered logs to
	// CloudWatch Logs.
	LatestCloudWatchLogsDeliveryTime *time.Time `type:"timestamp" timestampFormat:"unix"`

	// This field is deprecated.
	LatestDeliveryAttemptSucceeded *string `type:"string"`

	// This field is deprecated.
	LatestDeliveryAttemptTime *string `type:"string"`

	// Displays any Amazon S3 error that CloudTrail encountered when attempting
	// to deliver log files to the designated bucket. For more information see the
	// topic Error Responses (http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html)
	// in the Amazon S3 API Reference.
	//
	//  This error occurs only when there is a problem with the destination S3
	// bucket and will not occur for timeouts. To resolve the issue, create a new
	// bucket and call UpdateTrail to specify the new bucket, or fix the existing
	// objects so that CloudTrail can again write to the bucket.
	LatestDeliveryError *string `type:"string"`

	// Specifies the date and time that CloudTrail last delivered log files to an
	// account's Amazon S3 bucket.
	LatestDeliveryTime *time.Time `type:"timestamp" timestampFormat:"unix"`

	// Displays any Amazon S3 error that CloudTrail encountered when attempting
	// to deliver a digest file to the designated bucket. For more information see
	// the topic Error Responses (http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html)
	// in the Amazon S3 API Reference.
	//
	//  This error occurs only when there is a problem with the destination S3
	// bucket and will not occur for timeouts. To resolve the issue, create a new
	// bucket and call UpdateTrail to specify the new bucket, or fix the existing
	// objects so that CloudTrail can again write to the bucket.
	LatestDigestDeliveryError *string `type:"string"`

	// Specifies the date and time that CloudTrail last delivered a digest file
	// to an account's Amazon S3 bucket.
	LatestDigestDeliveryTime *time.Time `type:"timestamp" timestampFormat:"unix"`

	// This field is deprecated.
	LatestNotificationAttemptSucceeded *string `type:"string"`

	// This field is deprecated.
	LatestNotificationAttemptTime *string `type:"string"`

	// Displays any Amazon SNS error that CloudTrail encountered when attempting
	// to send a notification. For more information about Amazon SNS errors, see
	// the Amazon SNS Developer Guide (http://docs.aws.amazon.com/sns/latest/dg/welcome.html).
	LatestNotificationError *string `type:"string"`

	// Specifies the date and time of the most recent Amazon SNS notification that
	// CloudTrail has written a new log file to an account's Amazon S3 bucket.
	LatestNotificationTime *time.Time `type:"timestamp" timestampFormat:"unix"`

	// Specifies the most recent date and time when CloudTrail started recording
	// API calls for an AWS account.
	StartLoggingTime *time.Time `type:"timestamp" timestampFormat:"unix"`

	// Specifies the most recent date and time when CloudTrail stopped recording
	// API calls for an AWS account.
	StopLoggingTime *time.Time `type:"timestamp" timestampFormat:"unix"`

	// This field is deprecated.
	TimeLoggingStarted *string `type:"string"`

	// This field is deprecated.
	TimeLoggingStopped *string `type:"string"`
	// contains filtered or unexported fields
}

Returns the objects or data listed below if successful. Otherwise, returns an error.

func (GetTrailStatusOutput) GoString added in v0.6.5

func (s GetTrailStatusOutput) GoString() string

GoString returns the string representation

func (GetTrailStatusOutput) String added in v0.6.5

func (s GetTrailStatusOutput) String() string

String returns the string representation

type ListPublicKeysInput added in v0.9.11

type ListPublicKeysInput struct {

	// Optionally specifies, in UTC, the end of the time range to look up public
	// keys for CloudTrail digest files. If not specified, the current time is used.
	EndTime *time.Time `type:"timestamp" timestampFormat:"unix"`

	// Reserved for future use.
	NextToken *string `type:"string"`

	// Optionally specifies, in UTC, the start of the time range to look up public
	// keys for CloudTrail digest files. If not specified, the current time is used,
	// and the current public key is returned.
	StartTime *time.Time `type:"timestamp" timestampFormat:"unix"`
	// contains filtered or unexported fields
}

Requests the public keys for a specified time range.

func (ListPublicKeysInput) GoString added in v0.9.11

func (s ListPublicKeysInput) GoString() string

GoString returns the string representation

func (ListPublicKeysInput) String added in v0.9.11

func (s ListPublicKeysInput) String() string

String returns the string representation

type ListPublicKeysOutput added in v0.9.11

type ListPublicKeysOutput struct {

	// Reserved for future use.
	NextToken *string `type:"string"`

	// Contains an array of PublicKey objects.
	//
	//  The returned public keys may have validity time ranges that overlap.
	PublicKeyList []*PublicKey `type:"list"`
	// contains filtered or unexported fields
}

Returns the objects or data listed below if successful. Otherwise, returns an error.

func (ListPublicKeysOutput) GoString added in v0.9.11

func (s ListPublicKeysOutput) GoString() string

GoString returns the string representation

func (ListPublicKeysOutput) String added in v0.9.11

func (s ListPublicKeysOutput) String() string

String returns the string representation

type ListTagsInput added in v0.9.11

type ListTagsInput struct {

	// Reserved for future use.
	NextToken *string `type:"string"`

	// Specifies a list of trail ARNs whose tags will be listed. The list has a
	// limit of 20 ARNs. The format of a trail ARN is:
	//
	//  arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail
	ResourceIdList []*string `type:"list" required:"true"`
	// contains filtered or unexported fields
}

Specifies a list of trail tags to return.

func (ListTagsInput) GoString added in v0.9.11

func (s ListTagsInput) GoString() string

GoString returns the string representation

func (ListTagsInput) String added in v0.9.11

func (s ListTagsInput) String() string

String returns the string representation

func (*ListTagsInput) Validate added in v1.1.21

func (s *ListTagsInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type ListTagsOutput added in v0.9.11

type ListTagsOutput struct {

	// Reserved for future use.
	NextToken *string `type:"string"`

	// A list of resource tags.
	ResourceTagList []*ResourceTag `type:"list"`
	// contains filtered or unexported fields
}

Returns the objects or data listed below if successful. Otherwise, returns an error.

func (ListTagsOutput) GoString added in v0.9.11

func (s ListTagsOutput) GoString() string

GoString returns the string representation

func (ListTagsOutput) String added in v0.9.11

func (s ListTagsOutput) String() string

String returns the string representation

type LookupAttribute

type LookupAttribute struct {

	// Specifies an attribute on which to filter the events returned.
	AttributeKey *string `type:"string" required:"true" enum:"LookupAttributeKey"`

	// Specifies a value for the specified AttributeKey.
	AttributeValue *string `type:"string" required:"true"`
	// contains filtered or unexported fields
}

Specifies an attribute and value that filter the events returned.

func (LookupAttribute) GoString added in v0.6.5

func (s LookupAttribute) GoString() string

GoString returns the string representation

func (LookupAttribute) String added in v0.6.5

func (s LookupAttribute) String() string

String returns the string representation

func (*LookupAttribute) Validate added in v1.1.21

func (s *LookupAttribute) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type LookupEventsInput

type LookupEventsInput struct {

	// Specifies that only events that occur before or at the specified time are
	// returned. If the specified end time is before the specified start time, an
	// error is returned.
	EndTime *time.Time `type:"timestamp" timestampFormat:"unix"`

	// Contains a list of lookup attributes. Currently the list can contain only
	// one item.
	LookupAttributes []*LookupAttribute `type:"list"`

	// The number of events to return. Possible values are 1 through 50. The default
	// is 10.
	MaxResults *int64 `min:"1" type:"integer"`

	// The token to use to get the next page of results after a previous API call.
	// This token must be passed in with the same parameters that were specified
	// in the the original call. For example, if the original call specified an
	// AttributeKey of 'Username' with a value of 'root', the call with NextToken
	// should include those same parameters.
	NextToken *string `type:"string"`

	// Specifies that only events that occur after or at the specified time are
	// returned. If the specified start time is after the specified end time, an
	// error is returned.
	StartTime *time.Time `type:"timestamp" timestampFormat:"unix"`
	// contains filtered or unexported fields
}

Contains a request for LookupEvents.

func (LookupEventsInput) GoString added in v0.6.5

func (s LookupEventsInput) GoString() string

GoString returns the string representation

func (LookupEventsInput) String added in v0.6.5

func (s LookupEventsInput) String() string

String returns the string representation

func (*LookupEventsInput) Validate added in v1.1.21

func (s *LookupEventsInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type LookupEventsOutput

type LookupEventsOutput struct {

	// A list of events returned based on the lookup attributes specified and the
	// CloudTrail event. The events list is sorted by time. The most recent event
	// is listed first.
	Events []*Event `type:"list"`

	// The token to use to get the next page of results after a previous API call.
	// If the token does not appear, there are no more results to return. The token
	// must be passed in with the same parameters as the previous call. For example,
	// if the original call specified an AttributeKey of 'Username' with a value
	// of 'root', the call with NextToken should include those same parameters.
	NextToken *string `type:"string"`
	// contains filtered or unexported fields
}

Contains a response to a LookupEvents action.

func (LookupEventsOutput) GoString added in v0.6.5

func (s LookupEventsOutput) GoString() string

GoString returns the string representation

func (LookupEventsOutput) String added in v0.6.5

func (s LookupEventsOutput) String() string

String returns the string representation

type PublicKey added in v0.9.11

type PublicKey struct {

	// The fingerprint of the public key.
	Fingerprint *string `type:"string"`

	// The ending time of validity of the public key.
	ValidityEndTime *time.Time `type:"timestamp" timestampFormat:"unix"`

	// The starting time of validity of the public key.
	ValidityStartTime *time.Time `type:"timestamp" timestampFormat:"unix"`

	// The DER encoded public key value in PKCS#1 format.
	//
	// Value is automatically base64 encoded/decoded by the SDK.
	Value []byte `type:"blob"`
	// contains filtered or unexported fields
}

Contains information about a returned public key.

func (PublicKey) GoString added in v0.9.11

func (s PublicKey) GoString() string

GoString returns the string representation

func (PublicKey) String added in v0.9.11

func (s PublicKey) String() string

String returns the string representation

type RemoveTagsInput added in v0.9.11

type RemoveTagsInput struct {

	// Specifies the ARN of the trail from which tags should be removed. The format
	// of a trail ARN is:
	//
	//  arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail
	ResourceId *string `type:"string" required:"true"`

	// Specifies a list of tags to be removed.
	TagsList []*Tag `type:"list"`
	// contains filtered or unexported fields
}

Specifies the tags to remove from a trail.

func (RemoveTagsInput) GoString added in v0.9.11

func (s RemoveTagsInput) GoString() string

GoString returns the string representation

func (RemoveTagsInput) String added in v0.9.11

func (s RemoveTagsInput) String() string

String returns the string representation

func (*RemoveTagsInput) Validate added in v1.1.21

func (s *RemoveTagsInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type RemoveTagsOutput added in v0.9.11

type RemoveTagsOutput struct {
	// contains filtered or unexported fields
}

Returns the objects or data listed below if successful. Otherwise, returns an error.

func (RemoveTagsOutput) GoString added in v0.9.11

func (s RemoveTagsOutput) GoString() string

GoString returns the string representation

func (RemoveTagsOutput) String added in v0.9.11

func (s RemoveTagsOutput) String() string

String returns the string representation

type Resource

type Resource struct {

	// The name of the resource referenced by the event returned. These are user-created
	// names whose values will depend on the environment. For example, the resource
	// name might be "auto-scaling-test-group" for an Auto Scaling Group or "i-1234567"
	// for an EC2 Instance.
	ResourceName *string `type:"string"`

	// The type of a resource referenced by the event returned. When the resource
	// type cannot be determined, null is returned. Some examples of resource types
	// are: Instance for EC2, Trail for CloudTrail, DBInstance for RDS, and AccessKey
	// for IAM. For a list of resource types supported for event lookup, see Resource
	// Types Supported for Event Lookup (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/lookup_supported_resourcetypes.html).
	ResourceType *string `type:"string"`
	// contains filtered or unexported fields
}

Specifies the type and name of a resource referenced by an event.

func (Resource) GoString added in v0.6.5

func (s Resource) GoString() string

GoString returns the string representation

func (Resource) String added in v0.6.5

func (s Resource) String() string

String returns the string representation

type ResourceTag added in v0.9.11

type ResourceTag struct {

	// Specifies the ARN of the resource.
	ResourceId *string `type:"string"`

	// A list of tags.
	TagsList []*Tag `type:"list"`
	// contains filtered or unexported fields
}

A resource tag.

func (ResourceTag) GoString added in v0.9.11

func (s ResourceTag) GoString() string

GoString returns the string representation

func (ResourceTag) String added in v0.9.11

func (s ResourceTag) String() string

String returns the string representation

type StartLoggingInput

type StartLoggingInput struct {

	// Specifies the name or the CloudTrail ARN of the trail for which CloudTrail
	// logs AWS API calls. The format of a trail ARN is:
	//
	//  arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail
	Name *string `type:"string" required:"true"`
	// contains filtered or unexported fields
}

The request to CloudTrail to start logging AWS API calls for an account.

func (StartLoggingInput) GoString added in v0.6.5

func (s StartLoggingInput) GoString() string

GoString returns the string representation

func (StartLoggingInput) String added in v0.6.5

func (s StartLoggingInput) String() string

String returns the string representation

func (*StartLoggingInput) Validate added in v1.1.21

func (s *StartLoggingInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type StartLoggingOutput

type StartLoggingOutput struct {
	// contains filtered or unexported fields
}

Returns the objects or data listed below if successful. Otherwise, returns an error.

func (StartLoggingOutput) GoString added in v0.6.5

func (s StartLoggingOutput) GoString() string

GoString returns the string representation

func (StartLoggingOutput) String added in v0.6.5

func (s StartLoggingOutput) String() string

String returns the string representation

type StopLoggingInput

type StopLoggingInput struct {

	// Specifies the name or the CloudTrail ARN of the trail for which CloudTrail
	// will stop logging AWS API calls. The format of a trail ARN is:
	//
	//  arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail
	Name *string `type:"string" required:"true"`
	// contains filtered or unexported fields
}

Passes the request to CloudTrail to stop logging AWS API calls for the specified account.

func (StopLoggingInput) GoString added in v0.6.5

func (s StopLoggingInput) GoString() string

GoString returns the string representation

func (StopLoggingInput) String added in v0.6.5

func (s StopLoggingInput) String() string

String returns the string representation

func (*StopLoggingInput) Validate added in v1.1.21

func (s *StopLoggingInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type StopLoggingOutput

type StopLoggingOutput struct {
	// contains filtered or unexported fields
}

Returns the objects or data listed below if successful. Otherwise, returns an error.

func (StopLoggingOutput) GoString added in v0.6.5

func (s StopLoggingOutput) GoString() string

GoString returns the string representation

func (StopLoggingOutput) String added in v0.6.5

func (s StopLoggingOutput) String() string

String returns the string representation

type Tag added in v0.9.11

type Tag struct {

	// The key in a key-value pair. The key must be must be no longer than 128 Unicode
	// characters. The key must be unique for the resource to which it applies.
	Key *string `type:"string" required:"true"`

	// The value in a key-value pair of a tag. The value must be no longer than
	// 256 Unicode characters.
	Value *string `type:"string"`
	// contains filtered or unexported fields
}

A custom key-value pair associated with a resource such as a CloudTrail trail.

func (Tag) GoString added in v0.9.11

func (s Tag) GoString() string

GoString returns the string representation

func (Tag) String added in v0.9.11

func (s Tag) String() string

String returns the string representation

func (*Tag) Validate added in v1.1.21

func (s *Tag) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type Trail

type Trail struct {

	// Specifies an Amazon Resource Name (ARN), a unique identifier that represents
	// the log group to which CloudTrail logs will be delivered.
	CloudWatchLogsLogGroupArn *string `type:"string"`

	// Specifies the role for the CloudWatch Logs endpoint to assume to write to
	// a user's log group.
	CloudWatchLogsRoleArn *string `type:"string"`

	// The region in which the trail was created.
	HomeRegion *string `type:"string"`

	// Set to True to include AWS API calls from AWS global services such as IAM.
	// Otherwise, False.
	IncludeGlobalServiceEvents *bool `type:"boolean"`

	// Specifies whether the trail belongs only to one region or exists in all regions.
	IsMultiRegionTrail *bool `type:"boolean"`

	// Specifies the KMS key ID that encrypts the logs delivered by CloudTrail.
	// The value is a fully specified ARN to a KMS key in the format:
	//
	//  arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
	KmsKeyId *string `type:"string"`

	// Specifies whether log file validation is enabled.
	LogFileValidationEnabled *bool `type:"boolean"`

	// Name of the trail set by calling CreateTrail. The maximum length is 128 characters.
	Name *string `type:"string"`

	// Name of the Amazon S3 bucket into which CloudTrail delivers your trail files.
	// See Amazon S3 Bucket Naming Requirements (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/create_trail_naming_policy.html).
	S3BucketName *string `type:"string"`

	// Specifies the Amazon S3 key prefix that comes after the name of the bucket
	// you have designated for log file delivery. For more information, see Finding
	// Your CloudTrail Log Files (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html).The
	// maximum length is 200 characters.
	S3KeyPrefix *string `type:"string"`

	// Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications
	// when log files are delivered. The format of a topic ARN is:
	//
	//  arn:aws:sns:us-east-1:123456789012:MyTopic
	SnsTopicARN *string `type:"string"`

	// This field is deprecated. Use SnsTopicARN.
	SnsTopicName *string `deprecated:"true" type:"string"`

	// Specifies the ARN of the trail. The format of a trail ARN is:
	//
	//  arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail
	TrailARN *string `type:"string"`
	// contains filtered or unexported fields
}

The settings for a trail.

func (Trail) GoString added in v0.6.5

func (s Trail) GoString() string

GoString returns the string representation

func (Trail) String added in v0.6.5

func (s Trail) String() string

String returns the string representation

type UpdateTrailInput

type UpdateTrailInput struct {

	// Specifies a log group name using an Amazon Resource Name (ARN), a unique
	// identifier that represents the log group to which CloudTrail logs will be
	// delivered. Not required unless you specify CloudWatchLogsRoleArn.
	CloudWatchLogsLogGroupArn *string `type:"string"`

	// Specifies the role for the CloudWatch Logs endpoint to assume to write to
	// a user's log group.
	CloudWatchLogsRoleArn *string `type:"string"`

	// Specifies whether log file validation is enabled. The default is false.
	//
	//  When you disable log file integrity validation, the chain of digest files
	// is broken after one hour. CloudTrail will not create digest files for log
	// files that were delivered during a period in which log file integrity validation
	// was disabled. For example, if you enable log file integrity validation at
	// noon on January 1, disable it at noon on January 2, and re-enable it at noon
	// on January 10, digest files will not be created for the log files delivered
	// from noon on January 2 to noon on January 10. The same applies whenever you
	// stop CloudTrail logging or delete a trail.
	EnableLogFileValidation *bool `type:"boolean"`

	// Specifies whether the trail is publishing events from global services such
	// as IAM to the log files.
	IncludeGlobalServiceEvents *bool `type:"boolean"`

	// Specifies whether the trail applies only to the current region or to all
	// regions. The default is false. If the trail exists only in the current region
	// and this value is set to true, shadow trails (replications of the trail)
	// will be created in the other regions. If the trail exists in all regions
	// and this value is set to false, the trail will remain in the region where
	// it was created, and its shadow trails in other regions will be deleted.
	IsMultiRegionTrail *bool `type:"boolean"`

	// Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail.
	// The value can be a an alias name prefixed by "alias/", a fully specified
	// ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.
	//
	// Examples:
	//
	//   alias/MyAliasName
	//
	//   arn:aws:kms:us-east-1:123456789012:alias/MyAliasName
	//
	//   arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
	//
	//   12345678-1234-1234-1234-123456789012
	KmsKeyId *string `type:"string"`

	// Specifies the name of the trail or trail ARN. If Name is a trail name, the
	// string must meet the following requirements:
	//
	//   Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores
	// (_), or dashes (-)
	//
	//   Start with a letter or number, and end with a letter or number
	//
	//   Be between 3 and 128 characters
	//
	//   Have no adjacent periods, underscores or dashes. Names like my-_namespace
	// and my--namespace are invalid.
	//
	//   Not be in IP address format (for example, 192.168.5.4)
	//
	//   If Name is a trail ARN, it must be in the format:
	//
	//  arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail
	Name *string `type:"string" required:"true"`

	// Specifies the name of the Amazon S3 bucket designated for publishing log
	// files. See Amazon S3 Bucket Naming Requirements (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/create_trail_naming_policy.html).
	S3BucketName *string `type:"string"`

	// Specifies the Amazon S3 key prefix that comes after the name of the bucket
	// you have designated for log file delivery. For more information, see Finding
	// Your CloudTrail Log Files (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html).
	// The maximum length is 200 characters.
	S3KeyPrefix *string `type:"string"`

	// Specifies the name of the Amazon SNS topic defined for notification of log
	// file delivery. The maximum length is 256 characters.
	SnsTopicName *string `type:"string"`
	// contains filtered or unexported fields
}

Specifies settings to update for the trail.

func (UpdateTrailInput) GoString added in v0.6.5

func (s UpdateTrailInput) GoString() string

GoString returns the string representation

func (UpdateTrailInput) String added in v0.6.5

func (s UpdateTrailInput) String() string

String returns the string representation

func (*UpdateTrailInput) Validate added in v1.1.21

func (s *UpdateTrailInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type UpdateTrailOutput

type UpdateTrailOutput struct {

	// Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail
	// logs will be delivered.
	CloudWatchLogsLogGroupArn *string `type:"string"`

	// Specifies the role for the CloudWatch Logs endpoint to assume to write to
	// a user's log group.
	CloudWatchLogsRoleArn *string `type:"string"`

	// Specifies whether the trail is publishing events from global services such
	// as IAM to the log files.
	IncludeGlobalServiceEvents *bool `type:"boolean"`

	// Specifies whether the trail exists in one region or in all regions.
	IsMultiRegionTrail *bool `type:"boolean"`

	// Specifies the KMS key ID that encrypts the logs delivered by CloudTrail.
	// The value is a fully specified ARN to a KMS key in the format:
	//
	//  arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
	KmsKeyId *string `type:"string"`

	// Specifies whether log file integrity validation is enabled.
	LogFileValidationEnabled *bool `type:"boolean"`

	// Specifies the name of the trail.
	Name *string `type:"string"`

	// Specifies the name of the Amazon S3 bucket designated for publishing log
	// files.
	S3BucketName *string `type:"string"`

	// Specifies the Amazon S3 key prefix that comes after the name of the bucket
	// you have designated for log file delivery. For more information, see Finding
	// Your CloudTrail Log Files (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html).
	S3KeyPrefix *string `type:"string"`

	// Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications
	// when log files are delivered. The format of a topic ARN is:
	//
	//  arn:aws:sns:us-east-1:123456789012:MyTopic
	SnsTopicARN *string `type:"string"`

	// This field is deprecated. Use SnsTopicARN.
	SnsTopicName *string `deprecated:"true" type:"string"`

	// Specifies the ARN of the trail that was updated. The format of a trail ARN
	// is:
	//
	//  arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail
	TrailARN *string `type:"string"`
	// contains filtered or unexported fields
}

Returns the objects or data listed below if successful. Otherwise, returns an error.

func (UpdateTrailOutput) GoString added in v0.6.5

func (s UpdateTrailOutput) GoString() string

GoString returns the string representation

func (UpdateTrailOutput) String added in v0.6.5

func (s UpdateTrailOutput) String() string

String returns the string representation

Directories

Path Synopsis
Package cloudtrailiface provides an interface for the AWS CloudTrail.
Package cloudtrailiface provides an interface for the AWS CloudTrail.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL