{"id":13813085,"url":"https://github.com/softprops/serverless-aws-rust-http","last_synced_at":"2025-03-16T18:31:35.346Z","repository":{"id":53382076,"uuid":"161589723","full_name":"softprops/serverless-aws-rust-http","owner":"softprops","description":"⚡🏗️ template for new aws lambda serverless rust http apps","archived":false,"fork":false,"pushed_at":"2020-07-04T00:07:22.000Z","size":185,"stargazers_count":90,"open_issues_count":6,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-06T16:50:14.902Z","etag":null,"topics":["aws-lambda","lambda","serverless","serverless-framework"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/softprops.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-13T05:43:55.000Z","updated_at":"2024-11-11T21:50:57.000Z","dependencies_parsed_at":"2022-09-13T17:02:36.452Z","dependency_job_id":null,"html_url":"https://github.com/softprops/serverless-aws-rust-http","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softprops%2Fserverless-aws-rust-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softprops%2Fserverless-aws-rust-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softprops%2Fserverless-aws-rust-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softprops%2Fserverless-aws-rust-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/softprops","download_url":"https://codeload.github.com/softprops/serverless-aws-rust-http/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243826788,"owners_count":20354220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-lambda","lambda","serverless","serverless-framework"],"created_at":"2024-08-04T04:01:02.374Z","updated_at":"2025-03-16T18:31:34.250Z","avatar_url":"https://github.com/softprops.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# serverless AWS Rust HTTP template\n\nA sample template for bootstraping [Rustlang AWS Lambda](https://github.com/awslabs/aws-lambda-rust-runtime/) HTTP applications with ⚡ serverless framework ⚡.\n\n## ✨ features\n\n- 🦀 Build Rustlang applications targeting AWS Lambda with ease\n- 🛵 Continuous integration testing with GitHub Actions\n- 🚀 Continuous deployment with GitHub Actions\n- 🧪 Getting started tests\n\n## 📦 install\n\nInstall the [serverless framework](https://www.serverless.com/framework/docs/getting-started/) cli.\n\nThen then run the following in your terminal\n\n```bash\n$ npx serverless install \\\n  --url https://github.com/softprops/serverless-aws-rust-http \\\n  --name my-new-api\n```\n\nThis will download the source of a sample Rustlang application and unpack it as a new service named\n\"my-new-api\" in a directory called \"my-new-api\"\n\n## 🧙 how to be a wizard\n\nAssuming you have [aws credentials with appropriate deployment permissions configured](https://serverless.com/framework/docs/providers/aws/guide/credentials/)\n(if you already use any existing AWS tooling installed you likely already have this configured), you can impress your friends by creating a project\nthat is _born_ in a production environment.\n\n```bash\n$ npx serverless install \\\n  --url https://github.com/softprops/serverless-aws-rust-http \\\n  --name my-new-api \\\n  \u0026\u0026 cd my-new-api \\\n  \u0026\u0026 npm i \\\n  \u0026\u0026 npx serverless deploy\n```\n\n`npm i` will make sure npm dependencies are installed. This only needs run once.\nThe first time you run `npx serverless deploy` it will pull down and compile the base set\nof dependencies and your application. Unless the dependencies change afterwards,\nthis should only happen once, resulting in an out of the box rapid deployment\ncycle.\n\n## 🛵 continuous integration and deployment\n\nThis template includes an example [GitHub actions](https://travis-ci.org/) [configuration file](.github/workflows/main.yml) which can unlock a virtuous cycle of continuous integration and deployment\n( i.e all tests are run on prs and every push to master results in a deployment ).\n\nGitHub actions is managed simply by the presence of a file checked into your repository. To set up GitHub Actions to deploy to AWS you'll need to do a few things\n\nFirstly, version control your source. [Github](https://github.com/) is free for opensource.\n\n```bash\n$ git init\n$ git remote add origin git@github.com:{username}/{my-new-service}.git\n```\n\nStore a `AWS_ACCESS_KEY_ID` `AWS_SECRET_ACCESS_KEY` used for aws deployment in your repositories secrets https://github.com/{username}/{my-new-service}/settings/secrets\n\nAdd your changes to git and push them to GitHub.\n\nFinally, open https://github.com/{username}/{my-new-service}/actions in your browser and grab a bucket of popcorn 🍿\n\n## 🔫 function triggering\n\nWith your function deployed you can now start triggering it using `serverless` framework directly or\nthe AWS integration you've configured to trigger it on your behalf\n\nCopy this sample apigateway request into a file called payload.json\n\n```json\n{\n  \"path\": \"/test/hello\",\n  \"headers\": {\n    \"Accept\": \"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\",\n    \"Accept-Encoding\": \"gzip, deflate, lzma, sdch, br\",\n    \"Accept-Language\": \"en-US,en;q=0.8\",\n    \"CloudFront-Forwarded-Proto\": \"https\",\n    \"CloudFront-Is-Desktop-Viewer\": \"true\",\n    \"CloudFront-Is-Mobile-Viewer\": \"false\",\n    \"CloudFront-Is-SmartTV-Viewer\": \"false\",\n    \"CloudFront-Is-Tablet-Viewer\": \"false\",\n    \"CloudFront-Viewer-Country\": \"US\",\n    \"Host\": \"wt6mne2s9k.execute-api.us-west-2.amazonaws.com\",\n    \"Upgrade-Insecure-Requests\": \"1\",\n    \"User-Agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36 OPR/39.0.2256.48\",\n    \"Via\": \"1.1 fb7cca60f0ecd82ce07790c9c5eef16c.cloudfront.net (CloudFront)\",\n    \"X-Amz-Cf-Id\": \"nBsWBOrSHMgnaROZJK1wGCZ9PcRcSpq_oSXZNQwQ10OTZL4cimZo3g==\",\n    \"X-Forwarded-For\": \"192.168.100.1, 192.168.1.1\",\n    \"X-Forwarded-Port\": \"443\",\n    \"X-Forwarded-Proto\": \"https\"\n  },\n  \"pathParameters\": {\n    \"proxy\": \"hello\"\n  },\n  \"requestContext\": {\n    \"accountId\": \"123456789012\",\n    \"resourceId\": \"us4z18\",\n    \"stage\": \"test\",\n    \"requestId\": \"41b45ea3-70b5-11e6-b7bd-69b5aaebc7d9\",\n    \"identity\": {\n      \"cognitoIdentityPoolId\": \"\",\n      \"accountId\": \"\",\n      \"cognitoIdentityId\": \"\",\n      \"caller\": \"\",\n      \"apiKey\": \"\",\n      \"sourceIp\": \"192.168.100.1\",\n      \"cognitoAuthenticationType\": \"\",\n      \"cognitoAuthenticationProvider\": \"\",\n      \"userArn\": \"\",\n      \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36 OPR/39.0.2256.48\",\n      \"user\": \"\"\n    },\n    \"resourcePath\": \"/{proxy+}\",\n    \"httpMethod\": \"GET\",\n    \"apiId\": \"wt6mne2s9k\"\n  },\n  \"resource\": \"/{proxy+}\",\n  \"httpMethod\": \"GET\",\n  \"queryStringParameters\": {\n    \"name\": \"me\"\n  },\n  \"stageVariables\": {\n    \"stageVarName\": \"stageVarValue\"\n  }\n}\n```\n\nThen invoke your function with a synthetic request\n\n```sh\n$ npx serverless invoke -f hello -d \"$(cat payload.json)\"\n```\n\n## 🔬 logs\n\nWith your function deployed you can now tail it's logs right from your project\n\n```sh\n$ npx serverless logs -f hello\n```\n\n## 👴 retiring\n\nGood code should be easily replaceable. Good code is should also be easily disposable. Retiring applications should be as easy as creating and deploying them. The dual of `serverless deploy` is `serverless remove`. Use this for retiring services and cleaning up resources.\n\n```bash\n$ npx serverless remove\n```\n\n## ℹ️ additional information\n\n- See the [serverless-rust plugin's documentation](https://github.com/softprops/serverless-rust) for more information on plugin usage.\n\n- See the [aws rust runtime's documentation](https://github.com/awslabs/aws-lambda-rust-runtime) for more information on writing Rustlang lambda functions\n\n## 👯 contributing\n\nThis template's intent is to set a minimal baseline for getting engineers up an running with a set of repeatable best practices. See something you'd like in this template that would help others? Feel free to [open a new github issue](https://github.com/softprops/serverless-aws-rust-http/issues/new). Pull requests are also welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftprops%2Fserverless-aws-rust-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftprops%2Fserverless-aws-rust-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftprops%2Fserverless-aws-rust-http/lists"}