require("aws.s3")
# create a bucket
mybucket <- "mybucket_for_cloudtrail"
stopifnot(put_bucket(mybucket))
# create a trail
trail <- create_trail("exampletrail", mybucket)
# confirm trail created
get_trails()
# start/stop logging to the trail
start_logging(trail)
stop_logging(trail)
# check trail status
trail_status(trail)
# delete trail
delete_trail(trail)
Run the code above in your browser using DataLab