cloudtrail

package
v1.5.9 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package cloudtrail reads the CloudTrail event history for an audit feed.

Index

Constants

View Source
const (
	AttrResourceName = "ResourceName"
	AttrResourceType = "ResourceType"
	AttrUsername     = "Username"
	AttrEventName    = "EventName"
)

Lookup attribute keys accepted by LookupEvents. The API allows one per call.

Variables

View Source
var Service = awsx.Service{Name: "cloudtrail", Prefix: "cloudtrail", SigningName: "cloudtrail", TargetPrefix: "com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101"}

Service is the CloudTrail API (target prefix checked against the botocore model).

Functions

This section is empty.

Types

type Client

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

Client is the lazy CloudTrail module.

func New

func New(c *awsx.Client) *Client

New wraps a shared client.

func (*Client) LookupByNames

func (c *Client) LookupByNames(ctx context.Context, q Query, names []string) ([]Event, error)

LookupByNames merges the feed for several resource names, for a tag query: LookupEvents cannot filter by tag, so callers resolve the tag to resource names first (the Tagging API sweep in cloudguard) and pass them here.

func (*Client) LookupEvents

func (c *Client) LookupEvents(ctx context.Context, q Query) ([]Event, error)

LookupEvents returns events matching one attribute, newest first.

type Event

type Event struct {
	ID, Name, Source, Username string
	Time                       time.Time
	Resources                  []string
}

Event is one audit row. Raw JSON is left out on purpose.

type Query

type Query struct {
	Region     string
	AttrKey    string
	AttrValue  string
	Start, End time.Time
	// MaxPages bounds pagination; below 1 reads one page.
	MaxPages int
}

Query selects events. Zero times mean the API default window.

Jump to

Keyboard shortcuts

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