cloudtraildata

package
v1.55.5 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: Apache-2.0 Imports: 9 Imported by: 5

Documentation

Overview

Package cloudtraildata provides the client and types for making API requests to AWS CloudTrail Data Service.

The CloudTrail Data Service lets you ingest events into CloudTrail from any source in your hybrid environments, such as in-house or SaaS applications hosted on-premises or in the cloud, virtual machines, or containers. You can store, access, analyze, troubleshoot and take action on this data without maintaining multiple log aggregators and reporting tools. After you run PutAuditEvents to ingest your application activity into CloudTrail, you can use CloudTrail Lake to search, query, and analyze the data that is logged from your applications.

See https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-data-2021-08-11 for more information on this service.

See cloudtraildata package documentation for more information. https://docs.aws.amazon.com/sdk-for-go/api/service/cloudtraildata/

Using the Client

To contact AWS CloudTrail Data Service with the SDK use the New function to create a new service client. With that client you can make API requests to the service. These clients are safe to use concurrently.

See the SDK's documentation for more information on how to use the SDK. https://docs.aws.amazon.com/sdk-for-go/api/

See aws.Config documentation for more information on configuring SDK clients. https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config

See the AWS CloudTrail Data Service client CloudTrailData for more information on creating client for this service. https://docs.aws.amazon.com/sdk-for-go/api/service/cloudtraildata/#New

Index

Constants

View Source
const (

	// ErrCodeChannelInsufficientPermission for service response error code
	// "ChannelInsufficientPermission".
	//
	// The caller's account ID must be the same as the channel owner's account ID.
	ErrCodeChannelInsufficientPermission = "ChannelInsufficientPermission"

	// ErrCodeChannelNotFound for service response error code
	// "ChannelNotFound".
	//
	// The channel could not be found.
	ErrCodeChannelNotFound = "ChannelNotFound"

	// ErrCodeChannelUnsupportedSchema for service response error code
	// "ChannelUnsupportedSchema".
	//
	// The schema type of the event is not supported.
	ErrCodeChannelUnsupportedSchema = "ChannelUnsupportedSchema"

	// ErrCodeDuplicatedAuditEventId for service response error code
	// "DuplicatedAuditEventId".
	//
	// Two or more entries in the request have the same event ID.
	ErrCodeDuplicatedAuditEventId = "DuplicatedAuditEventId"

	// ErrCodeInvalidChannelARN for service response error code
	// "InvalidChannelARN".
	//
	// The specified channel ARN is not a valid channel ARN.
	ErrCodeInvalidChannelARN = "InvalidChannelARN"

	// ErrCodeUnsupportedOperationException for service response error code
	// "UnsupportedOperationException".
	//
	// The operation requested is not supported in this region or account.
	ErrCodeUnsupportedOperationException = "UnsupportedOperationException"
)
View Source
const (
	ServiceName = "CloudTrail Data" // Name of service.
	EndpointsID = "cloudtrail-data" // ID to lookup a service endpoint with.
	ServiceID   = "CloudTrail Data" // ServiceID is a unique identifier of a specific service.
)

Service information constants

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditEvent

type AuditEvent struct {

	// The content of an audit event that comes from the event, such as userIdentity,
	// userAgent, and eventSource.
	//
	// EventData is a required field
	EventData *string `locationName:"eventData" type:"string" required:"true"`

	// A checksum is a base64-SHA256 algorithm that helps you verify that CloudTrail
	// receives the event that matches with the checksum. Calculate the checksum
	// by running a command like the following:
	//
	// printf %s $eventdata | openssl dgst -binary -sha256 | base64
	EventDataChecksum *string `locationName:"eventDataChecksum" type:"string"`

	// The original event ID from the source event.
	//
	// Id is a required field
	Id *string `locationName:"id" min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

An event from a source outside of Amazon Web Services that you want CloudTrail to log.

func (AuditEvent) GoString

func (s AuditEvent) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*AuditEvent) SetEventData

func (s *AuditEvent) SetEventData(v string) *AuditEvent

SetEventData sets the EventData field's value.

func (*AuditEvent) SetEventDataChecksum

func (s *AuditEvent) SetEventDataChecksum(v string) *AuditEvent

SetEventDataChecksum sets the EventDataChecksum field's value.

func (*AuditEvent) SetId

func (s *AuditEvent) SetId(v string) *AuditEvent

SetId sets the Id field's value.

func (AuditEvent) String

func (s AuditEvent) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*AuditEvent) Validate

func (s *AuditEvent) Validate() error

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

type AuditEventResultEntry

type AuditEventResultEntry struct {

	// The event ID assigned by CloudTrail.
	//
	// EventID is a required field
	EventID *string `locationName:"eventID" min:"1" type:"string" required:"true"`

	// The original event ID from the source event.
	//
	// Id is a required field
	Id *string `locationName:"id" min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

A response that includes successful and failed event results.

func (AuditEventResultEntry) GoString

func (s AuditEventResultEntry) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*AuditEventResultEntry) SetEventID

SetEventID sets the EventID field's value.

func (*AuditEventResultEntry) SetId

SetId sets the Id field's value.

func (AuditEventResultEntry) String

func (s AuditEventResultEntry) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type ChannelInsufficientPermission

type ChannelInsufficientPermission struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"message" type:"string"`
	// contains filtered or unexported fields
}

The caller's account ID must be the same as the channel owner's account ID.

func (*ChannelInsufficientPermission) Code

Code returns the exception type name.

func (*ChannelInsufficientPermission) Error

func (ChannelInsufficientPermission) GoString

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ChannelInsufficientPermission) Message

Message returns the exception's message.

func (*ChannelInsufficientPermission) OrigErr

func (s *ChannelInsufficientPermission) OrigErr() error

OrigErr always returns nil, satisfies awserr.Error interface.

func (*ChannelInsufficientPermission) RequestID

func (s *ChannelInsufficientPermission) RequestID() string

RequestID returns the service's response RequestID for request.

func (*ChannelInsufficientPermission) StatusCode

func (s *ChannelInsufficientPermission) StatusCode() int

Status code returns the HTTP status code for the request's response error.

func (ChannelInsufficientPermission) String

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type ChannelNotFound

type ChannelNotFound struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"message" type:"string"`
	// contains filtered or unexported fields
}

The channel could not be found.

func (*ChannelNotFound) Code

func (s *ChannelNotFound) Code() string

Code returns the exception type name.

func (*ChannelNotFound) Error

func (s *ChannelNotFound) Error() string

func (ChannelNotFound) GoString

func (s ChannelNotFound) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ChannelNotFound) Message

func (s *ChannelNotFound) Message() string

Message returns the exception's message.

func (*ChannelNotFound) OrigErr

func (s *ChannelNotFound) OrigErr() error

OrigErr always returns nil, satisfies awserr.Error interface.

func (*ChannelNotFound) RequestID

func (s *ChannelNotFound) RequestID() string

RequestID returns the service's response RequestID for request.

func (*ChannelNotFound) StatusCode

func (s *ChannelNotFound) StatusCode() int

Status code returns the HTTP status code for the request's response error.

func (ChannelNotFound) String

func (s ChannelNotFound) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type ChannelUnsupportedSchema

type ChannelUnsupportedSchema struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"message" type:"string"`
	// contains filtered or unexported fields
}

The schema type of the event is not supported.

func (*ChannelUnsupportedSchema) Code

func (s *ChannelUnsupportedSchema) Code() string

Code returns the exception type name.

func (*ChannelUnsupportedSchema) Error

func (s *ChannelUnsupportedSchema) Error() string

func (ChannelUnsupportedSchema) GoString

func (s ChannelUnsupportedSchema) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ChannelUnsupportedSchema) Message

func (s *ChannelUnsupportedSchema) Message() string

Message returns the exception's message.

func (*ChannelUnsupportedSchema) OrigErr

func (s *ChannelUnsupportedSchema) OrigErr() error

OrigErr always returns nil, satisfies awserr.Error interface.

func (*ChannelUnsupportedSchema) RequestID

func (s *ChannelUnsupportedSchema) RequestID() string

RequestID returns the service's response RequestID for request.

func (*ChannelUnsupportedSchema) StatusCode

func (s *ChannelUnsupportedSchema) StatusCode() int

Status code returns the HTTP status code for the request's response error.

func (ChannelUnsupportedSchema) String

func (s ChannelUnsupportedSchema) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type CloudTrailData

type CloudTrailData struct {
	*client.Client
}

CloudTrailData provides the API operation methods for making requests to AWS CloudTrail Data Service. See this package's package overview docs for details on the service.

CloudTrailData methods are safe to use concurrently. It is not safe to modify mutate any of the struct's properties though.

func New

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

New creates a new instance of the CloudTrailData 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:

mySession := session.Must(session.NewSession())

// Create a CloudTrailData client from just a session.
svc := cloudtraildata.New(mySession)

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

func (*CloudTrailData) PutAuditEvents

func (c *CloudTrailData) PutAuditEvents(input *PutAuditEventsInput) (*PutAuditEventsOutput, error)

PutAuditEvents API operation for AWS CloudTrail Data Service.

Ingests your application events into CloudTrail Lake. A required parameter, auditEvents, accepts the JSON records (also called payload) of events that you want CloudTrail to ingest. You can add up to 100 of these events (or up to 1 MB) per PutAuditEvents request.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS CloudTrail Data Service's API operation PutAuditEvents for usage and error information.

Returned Error Types:

  • ChannelInsufficientPermission The caller's account ID must be the same as the channel owner's account ID.

  • ChannelNotFound The channel could not be found.

  • InvalidChannelARN The specified channel ARN is not a valid channel ARN.

  • ChannelUnsupportedSchema The schema type of the event is not supported.

  • DuplicatedAuditEventId Two or more entries in the request have the same event ID.

  • UnsupportedOperationException The operation requested is not supported in this region or account.

See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-data-2021-08-11/PutAuditEvents

func (*CloudTrailData) PutAuditEventsRequest

func (c *CloudTrailData) PutAuditEventsRequest(input *PutAuditEventsInput) (req *request.Request, output *PutAuditEventsOutput)

PutAuditEventsRequest generates a "aws/request.Request" representing the client's request for the PutAuditEvents operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See PutAuditEvents for more information on using the PutAuditEvents API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

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

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

See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-data-2021-08-11/PutAuditEvents

func (*CloudTrailData) PutAuditEventsWithContext

func (c *CloudTrailData) PutAuditEventsWithContext(ctx aws.Context, input *PutAuditEventsInput, opts ...request.Option) (*PutAuditEventsOutput, error)

PutAuditEventsWithContext is the same as PutAuditEvents with the addition of the ability to pass a context and additional request options.

See PutAuditEvents for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

type DuplicatedAuditEventId

type DuplicatedAuditEventId struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"message" type:"string"`
	// contains filtered or unexported fields
}

Two or more entries in the request have the same event ID.

func (*DuplicatedAuditEventId) Code

func (s *DuplicatedAuditEventId) Code() string

Code returns the exception type name.

func (*DuplicatedAuditEventId) Error

func (s *DuplicatedAuditEventId) Error() string

func (DuplicatedAuditEventId) GoString

func (s DuplicatedAuditEventId) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*DuplicatedAuditEventId) Message

func (s *DuplicatedAuditEventId) Message() string

Message returns the exception's message.

func (*DuplicatedAuditEventId) OrigErr

func (s *DuplicatedAuditEventId) OrigErr() error

OrigErr always returns nil, satisfies awserr.Error interface.

func (*DuplicatedAuditEventId) RequestID

func (s *DuplicatedAuditEventId) RequestID() string

RequestID returns the service's response RequestID for request.

func (*DuplicatedAuditEventId) StatusCode

func (s *DuplicatedAuditEventId) StatusCode() int

Status code returns the HTTP status code for the request's response error.

func (DuplicatedAuditEventId) String

func (s DuplicatedAuditEventId) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type InvalidChannelARN

type InvalidChannelARN struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"message" type:"string"`
	// contains filtered or unexported fields
}

The specified channel ARN is not a valid channel ARN.

func (*InvalidChannelARN) Code

func (s *InvalidChannelARN) Code() string

Code returns the exception type name.

func (*InvalidChannelARN) Error

func (s *InvalidChannelARN) Error() string

func (InvalidChannelARN) GoString

func (s InvalidChannelARN) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*InvalidChannelARN) Message

func (s *InvalidChannelARN) Message() string

Message returns the exception's message.

func (*InvalidChannelARN) OrigErr

func (s *InvalidChannelARN) OrigErr() error

OrigErr always returns nil, satisfies awserr.Error interface.

func (*InvalidChannelARN) RequestID

func (s *InvalidChannelARN) RequestID() string

RequestID returns the service's response RequestID for request.

func (*InvalidChannelARN) StatusCode

func (s *InvalidChannelARN) StatusCode() int

Status code returns the HTTP status code for the request's response error.

func (InvalidChannelARN) String

func (s InvalidChannelARN) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type PutAuditEventsInput

type PutAuditEventsInput struct {

	// The JSON payload of events that you want to ingest. You can also point to
	// the JSON event payload in a file.
	//
	// AuditEvents is a required field
	AuditEvents []*AuditEvent `locationName:"auditEvents" min:"1" type:"list" required:"true"`

	// The ARN or ID (the ARN suffix) of a channel.
	//
	// ChannelArn is a required field
	ChannelArn *string `location:"querystring" locationName:"channelArn" type:"string" required:"true"`

	// A unique identifier that is conditionally required when the channel's resource
	// policy includes an external ID. This value can be any string, such as a passphrase
	// or account number.
	ExternalId *string `location:"querystring" locationName:"externalId" min:"2" type:"string"`
	// contains filtered or unexported fields
}

func (PutAuditEventsInput) GoString

func (s PutAuditEventsInput) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*PutAuditEventsInput) SetAuditEvents

func (s *PutAuditEventsInput) SetAuditEvents(v []*AuditEvent) *PutAuditEventsInput

SetAuditEvents sets the AuditEvents field's value.

func (*PutAuditEventsInput) SetChannelArn

func (s *PutAuditEventsInput) SetChannelArn(v string) *PutAuditEventsInput

SetChannelArn sets the ChannelArn field's value.

func (*PutAuditEventsInput) SetExternalId

func (s *PutAuditEventsInput) SetExternalId(v string) *PutAuditEventsInput

SetExternalId sets the ExternalId field's value.

func (PutAuditEventsInput) String

func (s PutAuditEventsInput) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*PutAuditEventsInput) Validate

func (s *PutAuditEventsInput) Validate() error

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

type PutAuditEventsOutput

type PutAuditEventsOutput struct {

	// Lists events in the provided event payload that could not be ingested into
	// CloudTrail, and includes the error code and error message returned for events
	// that could not be ingested.
	//
	// Failed is a required field
	Failed []*ResultErrorEntry `locationName:"failed" type:"list" required:"true"`

	// Lists events in the provided event payload that were successfully ingested
	// into CloudTrail.
	//
	// Successful is a required field
	Successful []*AuditEventResultEntry `locationName:"successful" type:"list" required:"true"`
	// contains filtered or unexported fields
}

func (PutAuditEventsOutput) GoString

func (s PutAuditEventsOutput) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*PutAuditEventsOutput) SetFailed

SetFailed sets the Failed field's value.

func (*PutAuditEventsOutput) SetSuccessful

SetSuccessful sets the Successful field's value.

func (PutAuditEventsOutput) String

func (s PutAuditEventsOutput) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type ResultErrorEntry

type ResultErrorEntry struct {

	// The error code for events that could not be ingested by CloudTrail. Possible
	// error codes include: FieldTooLong, FieldNotFound, InvalidChecksum, InvalidData,
	// InvalidRecipient, InvalidEventSource, AccountNotSubscribed, Throttling, and
	// InternalFailure.
	//
	// ErrorCode is a required field
	ErrorCode *string `locationName:"errorCode" min:"1" type:"string" required:"true"`

	// The message that describes the error for events that could not be ingested
	// by CloudTrail.
	//
	// ErrorMessage is a required field
	ErrorMessage *string `locationName:"errorMessage" min:"1" type:"string" required:"true"`

	// The original event ID from the source event that could not be ingested by
	// CloudTrail.
	//
	// Id is a required field
	Id *string `locationName:"id" min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

Includes the error code and error message for events that could not be ingested by CloudTrail.

func (ResultErrorEntry) GoString

func (s ResultErrorEntry) GoString() string

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*ResultErrorEntry) SetErrorCode

func (s *ResultErrorEntry) SetErrorCode(v string) *ResultErrorEntry

SetErrorCode sets the ErrorCode field's value.

func (*ResultErrorEntry) SetErrorMessage

func (s *ResultErrorEntry) SetErrorMessage(v string) *ResultErrorEntry

SetErrorMessage sets the ErrorMessage field's value.

func (*ResultErrorEntry) SetId

SetId sets the Id field's value.

func (ResultErrorEntry) String

func (s ResultErrorEntry) String() string

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

type UnsupportedOperationException

type UnsupportedOperationException struct {
	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`

	Message_ *string `locationName:"message" type:"string"`
	// contains filtered or unexported fields
}

The operation requested is not supported in this region or account.

func (*UnsupportedOperationException) Code

Code returns the exception type name.

func (*UnsupportedOperationException) Error

func (UnsupportedOperationException) GoString

GoString returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

func (*UnsupportedOperationException) Message

Message returns the exception's message.

func (*UnsupportedOperationException) OrigErr

func (s *UnsupportedOperationException) OrigErr() error

OrigErr always returns nil, satisfies awserr.Error interface.

func (*UnsupportedOperationException) RequestID

func (s *UnsupportedOperationException) RequestID() string

RequestID returns the service's response RequestID for request.

func (*UnsupportedOperationException) StatusCode

func (s *UnsupportedOperationException) StatusCode() int

Status code returns the HTTP status code for the request's response error.

func (UnsupportedOperationException) String

String returns the string representation.

API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".

Directories

Path Synopsis
Package cloudtraildataiface provides an interface to enable mocking the AWS CloudTrail Data Service service client for testing your code.
Package cloudtraildataiface provides an interface to enable mocking the AWS CloudTrail Data Service service client for testing your code.

Jump to

Keyboard shortcuts

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