Rust SDK for Lambda - CRUD && trigger with DynamoDB

0

Playing around with Rust SDK and cargo lambda, to create a fn that reads new items appended to a specific table in DynamoDB, which is set as the trigger. I've written a fn as such. What are better approaches to this? I guess the more broader question would be - is there a quicker way to access enum variants that are passed as event to the handler fn?

fn matchAttribute<T>(attribute: &AttributeValue) -> Option<T> 
    where 
        bool:   Into<T>,
        f64:     Into<T>,
        String: Into<T>,
        T: for<'a> std::convert::From<&'a std::string::String>
{
    match attribute {
        AttributeValue::Boolean(b) => Some((*b).into()),
        AttributeValue::Number(f) => Some((*f).into()),
        AttributeValue::String(s) => Some((s).into()),
        _ => None,
    }
}
질문됨 일 년 전232회 조회
1개 답변
0

One option to consider is DDB Streams using Lambda event filtering: FIltering

AWS
AWSdave
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠