You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe I'm not finding the correct struct somewhere in the SDK, but I have many cloud watch metrics alarms going to an sns topic. one of the subscribers to the topic is an lambda function.
Example:
#[tokio::main]asyncfnmain() -> Result<(),Error>{
tracing_subscriber::fmt().with_max_level(tracing::Level::INFO).with_target(false).without_time().init();run(service_fn(lambda_handler)).await}asyncfnlambda_handler(event:LambdaEvent<SnsEvent>) -> Result<(),Error>{info!("received events: {:?}", event.payload.records.len());for event in event.payload.records{process_record(&event)?;}Ok(())}fnprocess_record(record:&SnsRecord) -> Result<(),Error>{info!("processing record");let message = &record.sns;info!(message = ?message);/* I would like something to the effect of: let payload: CloudWatchAlarmSNSPayload = serde_json::from_str(message.message) */Ok(())}
Or really just: SnsMessageObj<CloudWatchAlarmSNSPayload>
The text was updated successfully, but these errors were encountered:
This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
ref from go: https://github.com/aws/aws-lambda-go/blob/3a93ed1e265b5e368f0d20c3a2b8395d2c9f787d/events/sns.go#L34C6-L45
Maybe I'm not finding the correct struct somewhere in the SDK, but I have many cloud watch metrics alarms going to an sns topic. one of the subscribers to the topic is an lambda function.
Example:
Or really just:
SnsMessageObj<CloudWatchAlarmSNSPayload>
The text was updated successfully, but these errors were encountered: