{"id":16218673,"url":"https://github.com/loginov-rocks/build-react-static-in-lambda","last_synced_at":"2026-03-05T12:31:47.188Z","repository":{"id":135933547,"uuid":"484524446","full_name":"loginov-rocks/Build-React-Static-in-Lambda","owner":"loginov-rocks","description":"Static Site Generation in Lambda with React Static","archived":false,"fork":false,"pushed_at":"2024-07-11T04:29:49.000Z","size":223,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-12T16:38:01.470Z","etag":null,"topics":["aws","docker","lambda","react","static-site-generator"],"latest_commit_sha":null,"homepage":"https://loginov-rocks.medium.com/static-site-generation-in-lambda-with-react-static-bdba551e4fe4","language":"JavaScript","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/loginov-rocks.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":"2022-04-22T17:51:33.000Z","updated_at":"2024-07-11T04:29:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"9407816c-e266-4117-805c-48f23122815f","html_url":"https://github.com/loginov-rocks/Build-React-Static-in-Lambda","commit_stats":null,"previous_names":[],"tags_count":1,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loginov-rocks%2FBuild-React-Static-in-Lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loginov-rocks%2FBuild-React-Static-in-Lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loginov-rocks%2FBuild-React-Static-in-Lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loginov-rocks%2FBuild-React-Static-in-Lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loginov-rocks","download_url":"https://codeload.github.com/loginov-rocks/Build-React-Static-in-Lambda/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241455452,"owners_count":19965611,"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","docker","lambda","react","static-site-generator"],"created_at":"2024-10-10T11:50:16.045Z","updated_at":"2026-03-05T12:31:47.130Z","avatar_url":"https://github.com/loginov-rocks.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Build React Static in Lambda\n\nStatic Site Generation in Lambda with React Static: [Medium](https://loginov-rocks.medium.com/static-site-generation-in-lambda-with-react-static-bdba551e4fe4)\n\n![AWS Reference Infrastructure Diagram](https://raw.githubusercontent.com/loginov-rocks/Build-React-Static-in-Lambda/main/docs/AWS-Reference-Infrastructure-Diagram.png)\n\n## Configuration\n\n### Lambda\n\n* Architecture: `x86_64`\n* Memory: `1024` MB (at least)\n* Ephemeral storage: `512` MB (at least)\n* Timeout: `15` min (maximum available)\n\n#### Permissions\n\nConfigure the policy:\n\n```json\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Sid\": \"VisualEditor0\",\n      \"Effect\": \"Allow\",\n      \"Action\": \"s3:PutObject\",\n      \"Resource\": \"arn:aws:s3:::${LAMBDA_S3_BUCKET_NAME}/*\"\n    }\n  ]\n}\n```\n\n#### Environment Variables\n\n* `LAMBDA_ACCESS_KEY_ID` and `LAMBDA_SECRET_ACCESS_KEY` - credentials for the AWS user to deploy files, for local\n  development usage,\n* `LAMBDA_S3_BUCKET_NAME` - S3 bucket name to deploy files to,\n* `LAMBDA_USE_POLICY` - to use (`true`) or not to use (`false`) IAM policy instead of the AWS user, convenient in the\n  actual Lambda environment,\n* `LAMBDA_USE_TMPDIR` - to use (`true`) or not to use (`false`) temporary directory for the build artifacts, must\n  be `true` in the actual Lambda environment, can be `false` for local development usage.\n\n## Development\n\nMake sure to set up environment variables in the `.env` file (see `.env.example`).\n\n### Docker\n\n#### Build\n\n```sh\ndocker build -t build-react-static-in-lambda .\n```\n\n#### Run\n\n```sh\ndocker run --env-file .env -p 9000:8080 build-react-static-in-lambda\n```\n\n#### Test\n\n```sh\ncurl -XPOST \"http://localhost:9000/2015-03-31/functions/function/invocations\" -d '{}'\n```\n\n#### Explore container\n\n```sh\ndocker ps\ndocker exec -it \u003cCONTAINER ID\u003e bash\n```\n\n### Without Docker\n\n```sh\nnpm install\nnode lambda/without-docker\n```\n\n## Reference\n\n* [Creating Lambda container images](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html)\n* [Running Gatsby in an AWS Lambda](https://www.jameshill.dev/articles/running-gatsby-within-aws-lambda/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floginov-rocks%2Fbuild-react-static-in-lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floginov-rocks%2Fbuild-react-static-in-lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floginov-rocks%2Fbuild-react-static-in-lambda/lists"}