There are more AWS SDK examples available in the AWS Doc SDK Examples
Code examples for CloudTrail using AWS SDKs
The following code examples show you how to use AWS CloudTrail with an AWS software development kit (SDK).
Actions are code excerpts from larger programs and must be run in context. While actions show you how to call individual service functions, you can see actions in context in their related scenarios.
More resources
CloudTrail Developer Guide – More information about CloudTrail.
CloudTrail API Reference – Details about all available CloudTrail actions.
AWS Developer Center
– Code examples that you can filter by category or full-text search. AWS SDK Examples
– GitHub repo with complete code in preferred languages. Includes instructions for setting up and running the code.