| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920 |
- // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
- // Package cloudtrail provides a client for AWS CloudTrail.
- package cloudtrail
- import (
- "fmt"
- "time"
- "github.com/aws/aws-sdk-go/aws/awsutil"
- "github.com/aws/aws-sdk-go/aws/request"
- )
- const opAddTags = "AddTags"
- // 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 (c *CloudTrail) AddTagsRequest(input *AddTagsInput) (req *request.Request, output *AddTagsOutput) {
- op := &request.Operation{
- Name: opAddTags,
- HTTPMethod: "POST",
- HTTPPath: "/",
- }
- if input == nil {
- input = &AddTagsInput{}
- }
- req = c.newRequest(op, input, output)
- output = &AddTagsOutput{}
- req.Data = output
- return
- }
- // 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).
- func (c *CloudTrail) AddTags(input *AddTagsInput) (*AddTagsOutput, error) {
- req, out := c.AddTagsRequest(input)
- err := req.Send()
- return out, err
- }
- const opCreateTrail = "CreateTrail"
- // 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 (c *CloudTrail) CreateTrailRequest(input *CreateTrailInput) (req *request.Request, output *CreateTrailOutput) {
- op := &request.Operation{
- Name: opCreateTrail,
- HTTPMethod: "POST",
- HTTPPath: "/",
- }
- if input == nil {
- input = &CreateTrailInput{}
- }
- req = c.newRequest(op, input, output)
- output = &CreateTrailOutput{}
- req.Data = output
- return
- }
- // 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.
- func (c *CloudTrail) CreateTrail(input *CreateTrailInput) (*CreateTrailOutput, error) {
- req, out := c.CreateTrailRequest(input)
- err := req.Send()
- return out, err
- }
- const opDeleteTrail = "DeleteTrail"
- // 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 (c *CloudTrail) DeleteTrailRequest(input *DeleteTrailInput) (req *request.Request, output *DeleteTrailOutput) {
- op := &request.Operation{
- Name: opDeleteTrail,
- HTTPMethod: "POST",
- HTTPPath: "/",
- }
- if input == nil {
- input = &DeleteTrailInput{}
- }
- req = c.newRequest(op, input, output)
- output = &DeleteTrailOutput{}
- req.Data = output
- return
- }
- // 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.
- func (c *CloudTrail) DeleteTrail(input *DeleteTrailInput) (*DeleteTrailOutput, error) {
- req, out := c.DeleteTrailRequest(input)
- err := req.Send()
- return out, err
- }
- const opDescribeTrails = "DescribeTrails"
- // 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 (c *CloudTrail) DescribeTrailsRequest(input *DescribeTrailsInput) (req *request.Request, output *DescribeTrailsOutput) {
- op := &request.Operation{
- Name: opDescribeTrails,
- HTTPMethod: "POST",
- HTTPPath: "/",
- }
- if input == nil {
- input = &DescribeTrailsInput{}
- }
- req = c.newRequest(op, input, output)
- output = &DescribeTrailsOutput{}
- req.Data = output
- return
- }
- // Retrieves settings for the trail associated with the current region for your
- // account.
- func (c *CloudTrail) DescribeTrails(input *DescribeTrailsInput) (*DescribeTrailsOutput, error) {
- req, out := c.DescribeTrailsRequest(input)
- err := req.Send()
- return out, err
- }
- const opGetTrailStatus = "GetTrailStatus"
- // 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 (c *CloudTrail) GetTrailStatusRequest(input *GetTrailStatusInput) (req *request.Request, output *GetTrailStatusOutput) {
- op := &request.Operation{
- Name: opGetTrailStatus,
- HTTPMethod: "POST",
- HTTPPath: "/",
- }
- if input == nil {
- input = &GetTrailStatusInput{}
- }
- req = c.newRequest(op, input, output)
- output = &GetTrailStatusOutput{}
- req.Data = output
- return
- }
- // 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.
- func (c *CloudTrail) GetTrailStatus(input *GetTrailStatusInput) (*GetTrailStatusOutput, error) {
- req, out := c.GetTrailStatusRequest(input)
- err := req.Send()
- return out, err
- }
- const opListPublicKeys = "ListPublicKeys"
- // 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 (c *CloudTrail) ListPublicKeysRequest(input *ListPublicKeysInput) (req *request.Request, output *ListPublicKeysOutput) {
- op := &request.Operation{
- Name: opListPublicKeys,
- HTTPMethod: "POST",
- HTTPPath: "/",
- }
- if input == nil {
- input = &ListPublicKeysInput{}
- }
- req = c.newRequest(op, input, output)
- output = &ListPublicKeysOutput{}
- req.Data = output
- return
- }
- // 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.
- func (c *CloudTrail) ListPublicKeys(input *ListPublicKeysInput) (*ListPublicKeysOutput, error) {
- req, out := c.ListPublicKeysRequest(input)
- err := req.Send()
- return out, err
- }
- const opListTags = "ListTags"
- // 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 (c *CloudTrail) ListTagsRequest(input *ListTagsInput) (req *request.Request, output *ListTagsOutput) {
- op := &request.Operation{
- Name: opListTags,
- HTTPMethod: "POST",
- HTTPPath: "/",
- }
- if input == nil {
- input = &ListTagsInput{}
- }
- req = c.newRequest(op, input, output)
- output = &ListTagsOutput{}
- req.Data = output
- return
- }
- // Lists the tags for the trail in the current region.
- func (c *CloudTrail) ListTags(input *ListTagsInput) (*ListTagsOutput, error) {
- req, out := c.ListTagsRequest(input)
- err := req.Send()
- return out, err
- }
- const opLookupEvents = "LookupEvents"
- // 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 (c *CloudTrail) LookupEventsRequest(input *LookupEventsInput) (req *request.Request, output *LookupEventsOutput) {
- op := &request.Operation{
- Name: opLookupEvents,
- HTTPMethod: "POST",
- HTTPPath: "/",
- }
- if input == nil {
- input = &LookupEventsInput{}
- }
- req = c.newRequest(op, input, output)
- output = &LookupEventsOutput{}
- req.Data = output
- return
- }
- // 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.
- func (c *CloudTrail) LookupEvents(input *LookupEventsInput) (*LookupEventsOutput, error) {
- req, out := c.LookupEventsRequest(input)
- err := req.Send()
- return out, err
- }
- const opRemoveTags = "RemoveTags"
- // 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 (c *CloudTrail) RemoveTagsRequest(input *RemoveTagsInput) (req *request.Request, output *RemoveTagsOutput) {
- op := &request.Operation{
- Name: opRemoveTags,
- HTTPMethod: "POST",
- HTTPPath: "/",
- }
- if input == nil {
- input = &RemoveTagsInput{}
- }
- req = c.newRequest(op, input, output)
- output = &RemoveTagsOutput{}
- req.Data = output
- return
- }
- // Removes the specified tags from a trail.
- func (c *CloudTrail) RemoveTags(input *RemoveTagsInput) (*RemoveTagsOutput, error) {
- req, out := c.RemoveTagsRequest(input)
- err := req.Send()
- return out, err
- }
- const opStartLogging = "StartLogging"
- // 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 (c *CloudTrail) StartLoggingRequest(input *StartLoggingInput) (req *request.Request, output *StartLoggingOutput) {
- op := &request.Operation{
- Name: opStartLogging,
- HTTPMethod: "POST",
- HTTPPath: "/",
- }
- if input == nil {
- input = &StartLoggingInput{}
- }
- req = c.newRequest(op, input, output)
- output = &StartLoggingOutput{}
- req.Data = output
- return
- }
- // 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.
- func (c *CloudTrail) StartLogging(input *StartLoggingInput) (*StartLoggingOutput, error) {
- req, out := c.StartLoggingRequest(input)
- err := req.Send()
- return out, err
- }
- const opStopLogging = "StopLogging"
- // 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 (c *CloudTrail) StopLoggingRequest(input *StopLoggingInput) (req *request.Request, output *StopLoggingOutput) {
- op := &request.Operation{
- Name: opStopLogging,
- HTTPMethod: "POST",
- HTTPPath: "/",
- }
- if input == nil {
- input = &StopLoggingInput{}
- }
- req = c.newRequest(op, input, output)
- output = &StopLoggingOutput{}
- req.Data = output
- return
- }
- // 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.
- func (c *CloudTrail) StopLogging(input *StopLoggingInput) (*StopLoggingOutput, error) {
- req, out := c.StopLoggingRequest(input)
- err := req.Send()
- return out, err
- }
- const opUpdateTrail = "UpdateTrail"
- // 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)
- // }
- //
- func (c *CloudTrail) UpdateTrailRequest(input *UpdateTrailInput) (req *request.Request, output *UpdateTrailOutput) {
- op := &request.Operation{
- Name: opUpdateTrail,
- HTTPMethod: "POST",
- HTTPPath: "/",
- }
- if input == nil {
- input = &UpdateTrailInput{}
- }
- req = c.newRequest(op, input, output)
- output = &UpdateTrailOutput{}
- req.Data = output
- return
- }
- // 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.
- func (c *CloudTrail) UpdateTrail(input *UpdateTrailInput) (*UpdateTrailOutput, error) {
- req, out := c.UpdateTrailRequest(input)
- err := req.Send()
- return out, err
- }
- // Specifies the tags to add to a trail.
- type AddTagsInput struct {
- _ struct{} `type:"structure"`
- // 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"`
- }
- // String returns the string representation
- func (s AddTagsInput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s AddTagsInput) GoString() string {
- return s.String()
- }
- // Validate inspects the fields of the type to determine if they are valid.
- func (s *AddTagsInput) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "AddTagsInput"}
- if s.ResourceId == nil {
- invalidParams.Add(request.NewErrParamRequired("ResourceId"))
- }
- if s.TagsList != nil {
- for i, v := range s.TagsList {
- if v == nil {
- continue
- }
- if err := v.Validate(); err != nil {
- invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagsList", i), err.(request.ErrInvalidParams))
- }
- }
- }
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
- }
- // Returns the objects or data listed below if successful. Otherwise, returns
- // an error.
- type AddTagsOutput struct {
- _ struct{} `type:"structure"`
- }
- // String returns the string representation
- func (s AddTagsOutput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s AddTagsOutput) GoString() string {
- return s.String()
- }
- // Specifies the settings for each trail.
- type CreateTrailInput struct {
- _ struct{} `type:"structure"`
- // 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"`
- }
- // String returns the string representation
- func (s CreateTrailInput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s CreateTrailInput) GoString() string {
- return s.String()
- }
- // Validate inspects the fields of the type to determine if they are valid.
- func (s *CreateTrailInput) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "CreateTrailInput"}
- if s.Name == nil {
- invalidParams.Add(request.NewErrParamRequired("Name"))
- }
- if s.S3BucketName == nil {
- invalidParams.Add(request.NewErrParamRequired("S3BucketName"))
- }
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
- }
- // Returns the objects or data listed below if successful. Otherwise, returns
- // an error.
- type CreateTrailOutput struct {
- _ struct{} `type:"structure"`
- // 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"`
- }
- // String returns the string representation
- func (s CreateTrailOutput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s CreateTrailOutput) GoString() string {
- return s.String()
- }
- // The request that specifies the name of a trail to delete.
- type DeleteTrailInput struct {
- _ struct{} `type:"structure"`
- // 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"`
- }
- // String returns the string representation
- func (s DeleteTrailInput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s DeleteTrailInput) GoString() string {
- return s.String()
- }
- // Validate inspects the fields of the type to determine if they are valid.
- func (s *DeleteTrailInput) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "DeleteTrailInput"}
- if s.Name == nil {
- invalidParams.Add(request.NewErrParamRequired("Name"))
- }
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
- }
- // Returns the objects or data listed below if successful. Otherwise, returns
- // an error.
- type DeleteTrailOutput struct {
- _ struct{} `type:"structure"`
- }
- // String returns the string representation
- func (s DeleteTrailOutput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s DeleteTrailOutput) GoString() string {
- return s.String()
- }
- // Returns information about the trail.
- type DescribeTrailsInput struct {
- _ struct{} `type:"structure"`
- // 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"`
- }
- // String returns the string representation
- func (s DescribeTrailsInput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s DescribeTrailsInput) GoString() string {
- return s.String()
- }
- // Returns the objects or data listed below if successful. Otherwise, returns
- // an error.
- type DescribeTrailsOutput struct {
- _ struct{} `type:"structure"`
- // The list of trail objects.
- TrailList []*Trail `locationName:"trailList" type:"list"`
- }
- // String returns the string representation
- func (s DescribeTrailsOutput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s DescribeTrailsOutput) GoString() string {
- return s.String()
- }
- // Contains information about an event that was returned by a lookup request.
- // The result includes a representation of a CloudTrail event.
- type Event struct {
- _ struct{} `type:"structure"`
- // 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"`
- }
- // String returns the string representation
- func (s Event) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s Event) GoString() string {
- return s.String()
- }
- // The name of a trail about which you want the current status.
- type GetTrailStatusInput struct {
- _ struct{} `type:"structure"`
- // 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"`
- }
- // String returns the string representation
- func (s GetTrailStatusInput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s GetTrailStatusInput) GoString() string {
- return s.String()
- }
- // Validate inspects the fields of the type to determine if they are valid.
- func (s *GetTrailStatusInput) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "GetTrailStatusInput"}
- if s.Name == nil {
- invalidParams.Add(request.NewErrParamRequired("Name"))
- }
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
- }
- // Returns the objects or data listed below if successful. Otherwise, returns
- // an error.
- type GetTrailStatusOutput struct {
- _ struct{} `type:"structure"`
- // 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"`
- }
- // String returns the string representation
- func (s GetTrailStatusOutput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s GetTrailStatusOutput) GoString() string {
- return s.String()
- }
- // Requests the public keys for a specified time range.
- type ListPublicKeysInput struct {
- _ struct{} `type:"structure"`
- // 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"`
- }
- // String returns the string representation
- func (s ListPublicKeysInput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s ListPublicKeysInput) GoString() string {
- return s.String()
- }
- // Returns the objects or data listed below if successful. Otherwise, returns
- // an error.
- type ListPublicKeysOutput struct {
- _ struct{} `type:"structure"`
- // 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"`
- }
- // String returns the string representation
- func (s ListPublicKeysOutput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s ListPublicKeysOutput) GoString() string {
- return s.String()
- }
- // Specifies a list of trail tags to return.
- type ListTagsInput struct {
- _ struct{} `type:"structure"`
- // 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"`
- }
- // String returns the string representation
- func (s ListTagsInput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s ListTagsInput) GoString() string {
- return s.String()
- }
- // Validate inspects the fields of the type to determine if they are valid.
- func (s *ListTagsInput) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "ListTagsInput"}
- if s.ResourceIdList == nil {
- invalidParams.Add(request.NewErrParamRequired("ResourceIdList"))
- }
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
- }
- // Returns the objects or data listed below if successful. Otherwise, returns
- // an error.
- type ListTagsOutput struct {
- _ struct{} `type:"structure"`
- // Reserved for future use.
- NextToken *string `type:"string"`
- // A list of resource tags.
- ResourceTagList []*ResourceTag `type:"list"`
- }
- // String returns the string representation
- func (s ListTagsOutput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s ListTagsOutput) GoString() string {
- return s.String()
- }
- // Specifies an attribute and value that filter the events returned.
- type LookupAttribute struct {
- _ struct{} `type:"structure"`
- // 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"`
- }
- // String returns the string representation
- func (s LookupAttribute) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s LookupAttribute) GoString() string {
- return s.String()
- }
- // Validate inspects the fields of the type to determine if they are valid.
- func (s *LookupAttribute) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "LookupAttribute"}
- if s.AttributeKey == nil {
- invalidParams.Add(request.NewErrParamRequired("AttributeKey"))
- }
- if s.AttributeValue == nil {
- invalidParams.Add(request.NewErrParamRequired("AttributeValue"))
- }
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
- }
- // Contains a request for LookupEvents.
- type LookupEventsInput struct {
- _ struct{} `type:"structure"`
- // 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"`
- }
- // String returns the string representation
- func (s LookupEventsInput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s LookupEventsInput) GoString() string {
- return s.String()
- }
- // Validate inspects the fields of the type to determine if they are valid.
- func (s *LookupEventsInput) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "LookupEventsInput"}
- if s.MaxResults != nil && *s.MaxResults < 1 {
- invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
- }
- if s.LookupAttributes != nil {
- for i, v := range s.LookupAttributes {
- if v == nil {
- continue
- }
- if err := v.Validate(); err != nil {
- invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LookupAttributes", i), err.(request.ErrInvalidParams))
- }
- }
- }
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
- }
- // Contains a response to a LookupEvents action.
- type LookupEventsOutput struct {
- _ struct{} `type:"structure"`
- // 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"`
- }
- // String returns the string representation
- func (s LookupEventsOutput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s LookupEventsOutput) GoString() string {
- return s.String()
- }
- // Contains information about a returned public key.
- type PublicKey struct {
- _ struct{} `type:"structure"`
- // 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"`
- }
- // String returns the string representation
- func (s PublicKey) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s PublicKey) GoString() string {
- return s.String()
- }
- // Specifies the tags to remove from a trail.
- type RemoveTagsInput struct {
- _ struct{} `type:"structure"`
- // 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"`
- }
- // String returns the string representation
- func (s RemoveTagsInput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s RemoveTagsInput) GoString() string {
- return s.String()
- }
- // Validate inspects the fields of the type to determine if they are valid.
- func (s *RemoveTagsInput) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "RemoveTagsInput"}
- if s.ResourceId == nil {
- invalidParams.Add(request.NewErrParamRequired("ResourceId"))
- }
- if s.TagsList != nil {
- for i, v := range s.TagsList {
- if v == nil {
- continue
- }
- if err := v.Validate(); err != nil {
- invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagsList", i), err.(request.ErrInvalidParams))
- }
- }
- }
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
- }
- // Returns the objects or data listed below if successful. Otherwise, returns
- // an error.
- type RemoveTagsOutput struct {
- _ struct{} `type:"structure"`
- }
- // String returns the string representation
- func (s RemoveTagsOutput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s RemoveTagsOutput) GoString() string {
- return s.String()
- }
- // Specifies the type and name of a resource referenced by an event.
- type Resource struct {
- _ struct{} `type:"structure"`
- // 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"`
- }
- // String returns the string representation
- func (s Resource) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s Resource) GoString() string {
- return s.String()
- }
- // A resource tag.
- type ResourceTag struct {
- _ struct{} `type:"structure"`
- // Specifies the ARN of the resource.
- ResourceId *string `type:"string"`
- // A list of tags.
- TagsList []*Tag `type:"list"`
- }
- // String returns the string representation
- func (s ResourceTag) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s ResourceTag) GoString() string {
- return s.String()
- }
- // The request to CloudTrail to start logging AWS API calls for an account.
- type StartLoggingInput struct {
- _ struct{} `type:"structure"`
- // 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"`
- }
- // String returns the string representation
- func (s StartLoggingInput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s StartLoggingInput) GoString() string {
- return s.String()
- }
- // Validate inspects the fields of the type to determine if they are valid.
- func (s *StartLoggingInput) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "StartLoggingInput"}
- if s.Name == nil {
- invalidParams.Add(request.NewErrParamRequired("Name"))
- }
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
- }
- // Returns the objects or data listed below if successful. Otherwise, returns
- // an error.
- type StartLoggingOutput struct {
- _ struct{} `type:"structure"`
- }
- // String returns the string representation
- func (s StartLoggingOutput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s StartLoggingOutput) GoString() string {
- return s.String()
- }
- // Passes the request to CloudTrail to stop logging AWS API calls for the specified
- // account.
- type StopLoggingInput struct {
- _ struct{} `type:"structure"`
- // 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"`
- }
- // String returns the string representation
- func (s StopLoggingInput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s StopLoggingInput) GoString() string {
- return s.String()
- }
- // Validate inspects the fields of the type to determine if they are valid.
- func (s *StopLoggingInput) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "StopLoggingInput"}
- if s.Name == nil {
- invalidParams.Add(request.NewErrParamRequired("Name"))
- }
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
- }
- // Returns the objects or data listed below if successful. Otherwise, returns
- // an error.
- type StopLoggingOutput struct {
- _ struct{} `type:"structure"`
- }
- // String returns the string representation
- func (s StopLoggingOutput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s StopLoggingOutput) GoString() string {
- return s.String()
- }
- // A custom key-value pair associated with a resource such as a CloudTrail trail.
- type Tag struct {
- _ struct{} `type:"structure"`
- // 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"`
- }
- // String returns the string representation
- func (s Tag) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s Tag) GoString() string {
- return s.String()
- }
- // Validate inspects the fields of the type to determine if they are valid.
- func (s *Tag) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "Tag"}
- if s.Key == nil {
- invalidParams.Add(request.NewErrParamRequired("Key"))
- }
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
- }
- // The settings for a trail.
- type Trail struct {
- _ struct{} `type:"structure"`
- // 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"`
- }
- // String returns the string representation
- func (s Trail) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s Trail) GoString() string {
- return s.String()
- }
- // Specifies settings to update for the trail.
- type UpdateTrailInput struct {
- _ struct{} `type:"structure"`
- // 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"`
- }
- // String returns the string representation
- func (s UpdateTrailInput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s UpdateTrailInput) GoString() string {
- return s.String()
- }
- // Validate inspects the fields of the type to determine if they are valid.
- func (s *UpdateTrailInput) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "UpdateTrailInput"}
- if s.Name == nil {
- invalidParams.Add(request.NewErrParamRequired("Name"))
- }
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
- }
- // Returns the objects or data listed below if successful. Otherwise, returns
- // an error.
- type UpdateTrailOutput struct {
- _ struct{} `type:"structure"`
- // 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"`
- }
- // String returns the string representation
- func (s UpdateTrailOutput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s UpdateTrailOutput) GoString() string {
- return s.String()
- }
- const (
- // @enum LookupAttributeKey
- LookupAttributeKeyEventId = "EventId"
- // @enum LookupAttributeKey
- LookupAttributeKeyEventName = "EventName"
- // @enum LookupAttributeKey
- LookupAttributeKeyUsername = "Username"
- // @enum LookupAttributeKey
- LookupAttributeKeyResourceType = "ResourceType"
- // @enum LookupAttributeKey
- LookupAttributeKeyResourceName = "ResourceName"
- )
|