{"id":25070870,"url":"https://github.com/farhanshoukat/web-app-cloudformation","last_synced_at":"2026-05-18T02:31:52.049Z","repository":{"id":108177343,"uuid":"469424696","full_name":"FarhanShoukat/web-app-cloudformation","owner":"FarhanShoukat","description":"CloudFormation scripts to deploy a simple static web application","archived":false,"fork":false,"pushed_at":"2022-04-03T14:25:53.000Z","size":986,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-22T06:52:04.625Z","etag":null,"topics":["automation","cloud","cloudformation","iac","infrastructure-as-code","yaml"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/FarhanShoukat.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-03-13T16:17:06.000Z","updated_at":"2022-04-03T12:29:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"4ac16dd9-50e2-4c25-bd7c-5d541ceef552","html_url":"https://github.com/FarhanShoukat/web-app-cloudformation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FarhanShoukat/web-app-cloudformation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FarhanShoukat%2Fweb-app-cloudformation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FarhanShoukat%2Fweb-app-cloudformation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FarhanShoukat%2Fweb-app-cloudformation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FarhanShoukat%2Fweb-app-cloudformation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FarhanShoukat","download_url":"https://codeload.github.com/FarhanShoukat/web-app-cloudformation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FarhanShoukat%2Fweb-app-cloudformation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33162607,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"online","status_checked_at":"2026-05-18T02:00:06.436Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["automation","cloud","cloudformation","iac","infrastructure-as-code","yaml"],"created_at":"2025-02-06T21:39:00.278Z","updated_at":"2026-05-18T02:31:52.032Z","avatar_url":"https://github.com/FarhanShoukat.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Web App CloudFormation\nA simple web application deployed on AWS using CloudFormation. This project does not focus on creating a web application rather how to deploy it on AWS and autoscale it according to the traffic. For this purpose, EC2 instances are running in an auto scaling group. To expose the application to the world, an Application Load Balancer is attached to the Auto Scaling group.\n\n## Architecture\n\u003cp align=\"middle\"\u003e\n  \u003cimg src=\"./Diagram.png\"/\u003e\n\u003c/p\u003e\n\nAs it can be seen the EC2 instances (Web servers) are deployed in a private subnets to make sure they are not accessible publically. The application is also deployed in two different Availability Zones for high availability.\n\n## Prerequisites\nAWS Command Line Interface (AWS CLI) need to be installed and configured in order to run this application\n* Follow [this](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) guide to install AWS CLI.\n* Follow [this](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html) guide to configure AWS CLI.\n\n## How to run\n* Upload your zipped build archive to the S3 bucket. A sample hello world build archive is included [here](./project-archive.zip).\n* Create network for the application which includes creating VPC, subnets, NAT gateway, Internet gateway etc.\n```bash\naws cloudformation deploy \\\n  --template-file network.yml \\\n  --stack-name \u003cstack-name-for-network\u003e \\  # e.g. my-network\n  --parameter-overrides EnvironmentName=\u003cenviroment-name\u003e  # e.g. MyEnvironment\n```\nYou can read more about cloudformation deploy [here](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/deploy/index.html).\n\n* Next step is to deploy our application on EC2 instances in our network. Run the following command to deploy your application on EC2 instances behind a load balancers\n```bash\naws cloudformation deploy \\\n  --template-file servers.yml \\\n  --stack-name \u003cstack-name\u003e \\  e.g. my-servers\n  --parameter-overrides EnvironmentName=\u003csame-environment-name-as-networks\u003e \\\n    AMIId=\u003cami-id\u003e \\\n    S3Bucket=\u003cS3-bucket-containing-build-archive\u003e \\\n    ArchivePath=\u003carchive-path-in-S3-bucket\u003e \\\n  --capabilities \"CAPABILITY_IAM\" \"CAPABILITY_NAMED_IAM\"\n```\n  * **Note:** The EnvironmentName should be the same as used while creating the network.\n  * **AMIId:** The application is meant to be deployed on Ubuntu 18.04. To find the correct AMI for your region, refer [this](https://cloud-images.ubuntu.com/locator/ec2/).\n  * **ArchivePath**: Refers to the path of the archive in S3 bucket. Defaults value: archives/project-archive.zip\n\n**Tip:** Both [network.yml](./network.yml) and [servers.yml](./servers.yml) support many more parameters like changing the minimum and maximum number of EC2 instances that can be deployed. These parameters can be found in each file after description.\n\n## Delete CloudFormation Stacks\nTo destroy the CloudFormation stacks and their associated resources run the following command\n```bash\naws cloudformation delete-stack --stack-name \u003cstack-to-destroy\u003e\n```\nAlternatively, you can also delete stacks directly from AWS Console.\n\n## Contact\nYou can get in touch with me on LinkedIn: [Farhan Shoukat](https://www.linkedin.com/in/farhan-shoukat/)\n\n## License\n[MIT](./LICENSE) Copyright (c) 2022 Farhan Shoukat\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarhanshoukat%2Fweb-app-cloudformation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffarhanshoukat%2Fweb-app-cloudformation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarhanshoukat%2Fweb-app-cloudformation/lists"}