calavera / aws-lambda-events

Rust event types for AWS Lambda
MIT License
128 stars 55 forks source link

CloudWatch events - API Call via CloudTrail #51

Closed martinjlowm closed 2 years ago

martinjlowm commented 2 years ago

With https://github.com/LegNeato/aws-lambda-events/pull/50, I was actually aiming at the CloudTrail event in particular, more specifically the request_parameters field. It's generic in the sense that it may hold any type of AWS API calls. Structs for most of these are available in other crates, but there are two problems at the moment:

  1. The official AWS SDK does not annotate any API calls with serde (de)-serialization attributes (e.g. https://github.com/awslabs/aws-sdk-rust/blob/2ad8b0abab2f54ac23d3c83f429873ae28d905fb/sdk/route53/src/input.rs#L16243-L16250)
  2. Rusoto does indeed annotate their structs, but does not transform from camelCase to snake_case...

Guessing that the official SDK will be the go-to crate, I don't think contributing to Rusoto (at this point) makes much sense, but then again - I suppose there's a good reason why the official SDK doesn't depend on serde at all.

Does it make sense to consider generating said structs from the official SDK and serve them with the appropriate attributes in this crate?

calavera commented 2 years ago

Does it make sense to consider generating said structs from the official SDK and serve them with the appropriate attributes in this crate?

I the long term, I hope we can generate all events from official definitions. We're still far away from that though. My mid term goal is to stop depending so much on the Go bindings, and handle events manually until the official definitions are published.

I'm going to close this ticket since #50 was just merged. Thanks for your contribution @martinjlowm !