{"id":20123983,"url":"https://github.com/mjovanc/rust-aws-lambda","last_synced_at":"2025-05-06T17:32:41.072Z","repository":{"id":220130403,"uuid":"750830467","full_name":"mjovanc/rust-aws-lambda","owner":"mjovanc","description":"A simple example using Rust + AWS Lambda + Terraform.","archived":false,"fork":false,"pushed_at":"2024-04-29T12:46:14.000Z","size":53,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-29T13:55:25.104Z","etag":null,"topics":["aws","aws-lambda","cargo-lambda","rust","terraform"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mjovanc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-31T12:05:49.000Z","updated_at":"2024-04-29T12:46:17.000Z","dependencies_parsed_at":"2024-02-05T15:33:36.846Z","dependency_job_id":null,"html_url":"https://github.com/mjovanc/rust-aws-lambda","commit_stats":null,"previous_names":["mjovanc/rust-aws-lambda"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjovanc%2Frust-aws-lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjovanc%2Frust-aws-lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjovanc%2Frust-aws-lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjovanc%2Frust-aws-lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mjovanc","download_url":"https://codeload.github.com/mjovanc/rust-aws-lambda/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224517399,"owners_count":17324407,"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","aws-lambda","cargo-lambda","rust","terraform"],"created_at":"2024-11-13T19:47:14.228Z","updated_at":"2024-11-13T19:47:14.926Z","avatar_url":"https://github.com/mjovanc.png","language":"Rust","readme":"# Rust + AWS Lambda \u003c!-- omit in toc --\u003e\n\n![build](https://img.shields.io/github/actions/workflow/status/mjovanc/rust-aws-lambda/ci.yml?branch=master)\n[![rust-aws-lambda: rustc 1.75+](https://img.shields.io/badge/compiler-rustc_1.75+-lightgray.svg)](https://blog.rust-lang.org/2023/11/16/Rust-1.74.0.html)\n\nThis project is intended to demonstrate how to build a simple HTTP function in Rust and provision it to AWS with AWS Lambda using Terraform.\n\n## Getting Started\n\nFirst we need to configure AWS, so you have the access to provision necessary infrastructure on AWS.\n\n### Create the GitHub Identity Provider\n\nNavigate to IAM \u003e Identity providers and create a new provider. Select OpenID Connect and add the following:\n\n**Provider URL:** `https://token.actions.githubusercontent.com` \\\n**Audience:** `sts.amazonaws.com`\n\n### Create the AWS role\n\nNavigate to IAM \u003e Roles and create a new role. Select **Web Identity** and choose the just created identity provider. Add the permissions you want to role to have, in this example we will use the AWS managed permission **AdministratorAccess** (please do not use it in production).\n\nAfter the role has been created we are going to add the GitHub repo to the Trust relationships. After editing the trusted entities JSON should look something like this:\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Effect\": \"Allow\",\n            \"Principal\": {\n                \"Federated\": \"arn:aws:iam::12345678:oidc-provider/token.actions.githubusercontent.com\"\n            },\n            \"Action\": \"sts:AssumeRoleWithWebIdentity\",\n            \"Condition\": {\n                \"StringEquals\": {\n                    \"token.actions.githubusercontent.com:aud\": \"sts.amazonaws.com\"\n                },\n                \"StringLike\": {\n                    \"token.actions.githubusercontent.com:sub\": \"repo:mjovanc/rust-aws-lambda:*\"\n                }\n            }\n        }\n    ]\n}\n```\n\n### Add `permissions` to the job in `ci.yml`\n\n```yaml\npermissions:\n  id-token: write # This is required for requesting the JWT\n  contents: read  # This is required for actions/checkout\n```\n\n### Update the AWS configure action in `ci.yml`\n\nWe need to update the `role-to-assume` to match your IAM account number and the role name.\n\n```yaml\n- name: Configure AWS Credentials\n  uses: aws-actions/configure-aws-credentials@v2\n  with:\n    role-to-assume: arn:aws:iam::12345678:role/YourRoleNameHere\n    aws-region: eu-west-1\n```\n\nNow you should be good to go and can run run the workflow.\n\n## License\n\nThe GPLv3 License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjovanc%2Frust-aws-lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmjovanc%2Frust-aws-lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjovanc%2Frust-aws-lambda/lists"}