Add the scaffolding for glue-sync
This commit is contained in:
parent
13167d7b18
commit
9d88d396f1
|
@ -0,0 +1 @@
|
|||
/target
|
|
@ -0,0 +1,22 @@
|
|||
[package]
|
||||
name = "glue-sync"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# Starting in Rust 1.62 you can use `cargo add` to add dependencies
|
||||
# to your project.
|
||||
#
|
||||
# If you're using an older Rust version,
|
||||
# download cargo-edit(https://github.com/killercup/cargo-edit#installation)
|
||||
# to install the `add` subcommand.
|
||||
#
|
||||
# Running `cargo add DEPENDENCY_NAME` will
|
||||
# add the latest version of a dependency to the list,
|
||||
# and it will keep the alphabetic ordering for you.
|
||||
|
||||
[dependencies]
|
||||
aws_lambda_events = { version = "0.15.0", default-features = false, features = ["sqs"] }
|
||||
|
||||
lambda_runtime = "0.11.1"
|
||||
tokio = { version = "1", features = ["macros"] }
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
use aws_lambda_events::event::sqs::SqsEvent;
|
||||
use lambda_runtime::{run, service_fn, tracing, Error, LambdaEvent};
|
||||
|
||||
|
||||
/// This is the main body for the function.
|
||||
/// Write your code inside it.
|
||||
/// There are some code example in the following URLs:
|
||||
/// - https://github.com/awslabs/aws-lambda-rust-runtime/tree/main/examples
|
||||
/// - https://github.com/aws-samples/serverless-rust-demo/
|
||||
async fn function_handler(event: LambdaEvent<SqsEvent>) -> Result<(), Error> {
|
||||
// Extract some useful information from the request
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Error> {
|
||||
tracing::init_default_subscriber();
|
||||
|
||||
run(service_fn(function_handler)).await
|
||||
}
|
Loading…
Reference in New Issue