{"id":22804223,"url":"https://github.com/iknowjavascript/terraform-aws-stable-diffusion","last_synced_at":"2026-04-28T11:32:39.895Z","repository":{"id":267621087,"uuid":"901811622","full_name":"iKnowJavaScript/terraform-aws-stable-diffusion","owner":"iKnowJavaScript","description":"This project sets up an AWS infrastructure to deploy a Stable Diffusion model using AWS Lambda, EC2, S3, and API Gateway. The Lambda function triggers an EC2 instance to run the Stable Diffusion model and store the generated images in an S3 bucket.","archived":false,"fork":false,"pushed_at":"2024-12-11T11:52:39.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T14:48:00.398Z","etag":null,"topics":["ai","aws","infrastructure-as-code","nvidia","stable-diffusion"],"latest_commit_sha":null,"homepage":"","language":"HCL","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/iKnowJavaScript.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-12-11T11:07:05.000Z","updated_at":"2024-12-11T11:54:34.000Z","dependencies_parsed_at":"2024-12-11T12:36:27.749Z","dependency_job_id":"0f602791-62c5-47ce-a353-ed61df4be1ac","html_url":"https://github.com/iKnowJavaScript/terraform-aws-stable-diffusion","commit_stats":null,"previous_names":["iknowjavascript/terraform-aws-stable-diffusion"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iKnowJavaScript%2Fterraform-aws-stable-diffusion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iKnowJavaScript%2Fterraform-aws-stable-diffusion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iKnowJavaScript%2Fterraform-aws-stable-diffusion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iKnowJavaScript%2Fterraform-aws-stable-diffusion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iKnowJavaScript","download_url":"https://codeload.github.com/iKnowJavaScript/terraform-aws-stable-diffusion/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246376090,"owners_count":20767218,"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":["ai","aws","infrastructure-as-code","nvidia","stable-diffusion"],"created_at":"2024-12-12T10:06:56.718Z","updated_at":"2026-04-28T11:32:39.642Z","avatar_url":"https://github.com/iKnowJavaScript.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stable Diffusion AWS Deployment\n\nThis project sets up an AWS infrastructure to deploy a Stable Diffusion model using AWS Lambda, EC2, S3, and API Gateway. The Lambda function triggers an EC2 instance to run the Stable Diffusion model and store the generated images in an S3 bucket.\n\n## Prerequisites\n\n- AWS CLI configured with appropriate permissions\n- Terraform installed\n- Python 3.8 installed\n\n## Project Structure\n\n```\n.DS_Store\n.gitignore\ninfra/\n\tapi-gateway.tf\n\tec2.tf\n\tinputs.tf\n\tkms.tf\n\tlambda.tf\n\tmain.tf\n\ts3.tf\nlambda/\n\tlambda_function.py\nLICENSE\nREADME.md\n```\n\n## Setup Instructions\n\n### Step 1: Create Lambda Zip Package\n\nFrom the root folder, run the following command to create a zip package for the Lambda function:\n\n```sh\nzip -r ./lambda.zip ./lambda\n```\n\n### Step 2: Initialize and Apply Terraform Configuration\n\n1. Navigate to the \n\ninfra\n\n directory:\n\n    ```sh\n    cd infra\n    ```\n\n2. Initialize Terraform:\n\n    ```sh\n    terraform init\n    ```\n\n3. Apply the Terraform configuration:\n\n    ```sh\n    terraform apply\n    ```\n\n    Confirm the apply action when prompted.\n\n## Lambda Function\n\nThe Lambda function is defined in \n\nlambda_function.py\n\n. It triggers an EC2 instance to run the Stable Diffusion model and stores the generated image in an S3 bucket.\n\n## Terraform Configuration\n\nThe Terraform configuration is located in the \n\ninfra\n Includes:\n\n## API Gateway\n\nThe API Gateway is configured to invoke the Lambda function via an HTTP POST request. The configuration is defined in \n\n\n\n## IAM Roles and Policies\n\nThe necessary IAM roles and policies are defined in the Terraform configuration to allow the Lambda function and EC2 instance to perform their required actions.\n\n## S3 Bucket\n\nAn S3 bucket is created to store the generated images. The configuration is defined in \n\n\n## EC2 Instance\n\nAn EC2 instance is configured to run the Stable Diffusion model. The configuration is defined in \n\n\n## License\n\nThis project is licensed under the MIT License. See the \n\nLICENSE\n\n file for details.\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.\n\n## Contact\n\nFor any questions or support, please open an issue in the repository.\n\n\nFeel free to check repo https://github.com/iKnowJavaScript/stable-diffusion-docker.git for commands and how the model works","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiknowjavascript%2Fterraform-aws-stable-diffusion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiknowjavascript%2Fterraform-aws-stable-diffusion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiknowjavascript%2Fterraform-aws-stable-diffusion/lists"}