{"id":16006338,"url":"https://github.com/swinton/echo","last_synced_at":"2026-04-20T22:03:19.373Z","repository":{"id":138109732,"uuid":"110719121","full_name":"swinton/echo","owner":"swinton","description":"A simple AWS Lambda function","archived":false,"fork":false,"pushed_at":"2017-11-16T03:06:25.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-27T08:24:49.405Z","etag":null,"topics":["aws-lambda","aws-lambda-python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/swinton.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-11-14T16:57:28.000Z","updated_at":"2017-11-14T20:43:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"14ae2a77-1f01-40ab-ad14-e4ac2e663d0f","html_url":"https://github.com/swinton/echo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/swinton/echo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swinton%2Fecho","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swinton%2Fecho/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swinton%2Fecho/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swinton%2Fecho/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swinton","download_url":"https://codeload.github.com/swinton/echo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swinton%2Fecho/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32067626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T21:26:33.338Z","status":"ssl_error","status_checked_at":"2026-04-20T21:26:22.081Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","aws-lambda-python"],"created_at":"2024-10-08T11:41:01.876Z","updated_at":"2026-04-20T22:03:19.368Z","avatar_url":"https://github.com/swinton.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `echo`\n\nA simple AWS Lambda function.\n\n## Installation\n\n1. Sign up for AWS Lambda\n1. Install and configure the `aws` command-line client\n1. Create a `lambda-default` role\n1. Install the `echo` function\n\n### Sign up for AWS Lambda\n\nSign up for AWS [**here**](https://aws.amazon.com/).\n\nThe Lambda free tier includes 1M free requests per month and 400,000 GB-seconds of compute time per month.\n\n### Install and configure the `aws` command-line client\n\nTo install the `aws` command-line client use `pip`:\n\n```\npip install awscli --upgrade --user\n```\n\nTo configure `aws`, follow these [**quick configuration steps**](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-quick-configuration).\n\nOnce configured, you should see `config` and `credentials` files in `~/.aws`.\n\n### Create a `lambda-default` role\n\nThe Lambda function will _assume_ a role when executing and will be granted permissions based on the policies attached to this role.\n\nAt the very least, we need to create a _basic execution_ role that grants write permissions to CloudWatch Logs. AWS provides one that we can use, `arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole`.\n\nUse `aws iam create-role` and `aws iam attach-role-policy` to create the role and attach the desired policy as follows:\n\n```bash\n# Create the role\naws iam create-role \\\n    --role-name lambda-default \\\n    --assume-role-policy-document file://.aws/lambda-default-role-policy.json \\\n    --description \"Lambda execution role\"\n\n# Attach the policy to the role just created\naws iam attach-role-policy \\\n    --role-name lambda-default \\\n    --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole\n```\n\nLook up the role to confirm everything looks good, and make a note of the `Arn` returned:\n\n```bash\naws iam get-role \\\n    --role-name lambda-default\n```\n\n### Install the `echo` function\n\nGenerate a `.zip` of the source code in `package.zip`:\n\n```bash\n# Generate package.zip\nzip package echo.py\n```\n\nCopy `package.zip` to an S3 bucket that you own:\n\n```bash\n# Copy package.zip to your S3 bucket\naws s3 cp package.zip s3://${YOUR_AWS_S3_BUCKET}/lambda/\n```\n\nFinally, create the function, remember to specify the `Arn` of your `lambda-default` role:\n\n```bash\n# Create your function\naws lambda create-function \\\n    --publish \\\n    --runtime python2.7 \\\n    --role ${YOUR_ARN_LAMBDA_DEFAULT_ROLE} \\\n    --handler echo.handler \\\n    --function-name echo \\\n    --code S3Bucket=${YOUR_AWS_S3_BUCKET},S3Key=lambda/package.zip\n```\n\n## Usage\n\nInvoke using `aws lambda invoke`:\n\n```bash\n# Invoke the function and save the output to output.txt\naws lambda invoke --function-name echo --payload '[\"hello\", \"world\"]' output.txt\n```\n\nReview the output via:\n\n```bash\ncat output.txt\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswinton%2Fecho","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswinton%2Fecho","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswinton%2Fecho/lists"}