{"id":23300545,"url":"https://github.com/dongkoony/aws_3_tier","last_synced_at":"2026-04-28T18:34:57.454Z","repository":{"id":219681769,"uuid":"749272256","full_name":"dongkoony/aws_3_tier","owner":"dongkoony","description":"코드로 AWS 인프라를 손 쉽게 다뤄보자 ","archived":false,"fork":false,"pushed_at":"2024-04-14T08:50:20.000Z","size":101,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T03:29:05.590Z","etag":null,"topics":["aws","terraform"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dongkoony.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-28T04:17:37.000Z","updated_at":"2024-06-02T05:14:00.000Z","dependencies_parsed_at":"2024-12-20T09:27:05.637Z","dependency_job_id":null,"html_url":"https://github.com/dongkoony/aws_3_tier","commit_stats":null,"previous_names":["dongkoony/aws_3_tier"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongkoony%2Faws_3_tier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongkoony%2Faws_3_tier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongkoony%2Faws_3_tier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongkoony%2Faws_3_tier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dongkoony","download_url":"https://codeload.github.com/dongkoony/aws_3_tier/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247555209,"owners_count":20957721,"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","terraform"],"created_at":"2024-12-20T09:16:59.215Z","updated_at":"2026-04-28T18:34:52.409Z","avatar_url":"https://github.com/dongkoony.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"![header](https://capsule-render.vercel.app/api?type=Venom\u0026color=0078D7\u0026height=200\u0026section=header\u0026text=Terraform.AWS.3-Tier.Architecture\u0026fontSize=40\u0026fontColor=703EE5\u0026animation=twinkling)\n\n![aws_3-tier_architecture](https://github.com/dongkoony/aws_3_tier/assets/109497684/8f63b8aa-ed96-4588-9ca5-d644446fec4c)\n\n## 프로젝트 개요: AWS 3-Tier 아키텍처 구축\n**목표:**\n이 프로젝트의 목표는 Terraform, Amazon Web Services (AWS) 클라우드 플랫폼을 사용하여 안정적이고 확장 가능한 3-Tier 웹 애플리케이션 아키텍처를 자동으로 구축하고 관리하는 것입니다. 이 아키텍처는 웹 서버(Nginx), 애플리케이션 서버 및 데이터베이스 서버로 구성됩니다.\n\n## 프로젝트 주요 구성 요소\n\n**Infrastructure as Code (Terraform):**\n프로젝트는 테라폼 코드를 사용하여 AWS 클라우드 리소스를 정의하고 관리합니다.\n테라폼 코드는 인프라스트럭처를 프로그래밍 방식으로 설계하고 프로비저닝하는 데 사용됩니다.\n\n**네트워크 및 보안:**\nVirtual Private Cloud (VPC)를 설정하여 네트워크 분리 및 보안 그룹을 관리합니다.\n인터넷 및 내부 서브넷을 구성하여 서버 및 데이터베이스의 네트워크 격리를 유지합니다.\n\n### AWS 3-Tier\n**웹 서버 (Web Tier):**\nNginx 웹 서버를 사용하여 정적 및 동적 콘텐츠를 제공합니다.\nAuto Scaling 그룹을 통해 확장 가능한 웹 서버 구성을 구현합니다.\n\n**애플리케이션 서버 (Application Tier):**\n웹 애플리케이션을 호스팅하는 서버 그룹입니다.\n자동으로 확장 및 축소되는 Auto Scaling 그룹을 구성합니다.\n애플리케이션 코드를 배포하는 스크립트를 실행하여 CI/CD를 구현합니다.\n\n**데이터베이스 서버 (Database Tier):**\nAmazon RDS (Relational Database Service)를 사용하여 관계형 데이터베이스를 호스팅합니다.\n데이터베이스 보안 및 백업 설정을 구성합니다.\n\n## 프로젝트 주요 단계\n\n**테라폼 코드 작성:**\n테라폼 코드를 사용하여 AWS 리소스를 정의하고 관리합니다. 이 코드는 인프라스트럭처를 설계하고 프로비저닝하는 데 사용됩니다.\n\n**인프라스트럭처 배포:**\n테라폼 코드를 사용하여 AWS 클라우드에 3-Tier 아키텍처를 배포합니다.\n\n**자동화 및 관리:**\nAuto Scaling을 활용하여 웹 서버 및 애플리케이션 서버의 확장과 축소를 자동화합니다. CI/CD 파이프라인을 설정하여 애플리케이션 배포를 자동화하고 데이터베이스 관리 및 보안을 유지합니다.\n\n**모니터링 및 로깅:**\nAWS CloudWatch 및 로깅 서비스를 사용하여 인프라스트럭처 및 애플리케이션의 상태를 모니터링하고 이벤트 및 경고를 설정합니다.\n\n## 프로젝트 기대 결과값\n이 프로젝트를 완료하면 안정적이며 확장 가능한 3-Tier 아키텍처가 AWS 클라우드에서 자동으로 구축되며 애플리케이션 배포와 관리가 간소화될 것입니다. \n이 아키텍처는 웹 트래픽의 증가에 따라 확장되고 감소하며 안전한 데이터베이스 백업 및 보안을 유지합니다.\n\n## 설치 및 사용법\n\n### 이 저장소를 클론합니다.\n   ```bash\n   git clone https://github.com/dongkoony/aws_3_tier.git\n   cd aws_3_tier\n   ```\n\n### Version\n  ```bash\n  Terraform \u003e v1.7.1\n  aws-cli \u003e 2.15.14\n  ```\n\n### AWS Configuration\n  ``` bash\n  // AWS Access Key, Secret Key 구성\n  aws configure\n  \n  // 설정 AWS IAM 액세스 key\n  AWS Access Key ID [None] :\n  AWS Secret Access Key [None] :\n  Default region name [None] : ap-northeast-2(서울)\n  Default output format [None] : json\n  \n  // 등록 확인\n  aws configure list\n  \n  // 여러 AWS 계정과 아이디로 운용할 경우\n  aws configure --profile [원하는 이름]\n  ```\n\n### Terraform install (Ubuntu)\n  ``` bash\n  wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg\n  echo \"deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main\" | sudo tee /etc/apt/sources.list.d/hashicorp.list\n  sudo apt update \u0026\u0026 sudo apt install terraform\n\n  $ terraform version\n  ```\n### Terraform install (Windows)\n  ``` bash\n  https://developer.hashicorp.com/terraform/install?product_intent=terraform\n  다운로드 후 시스템 환경 변수 등록.\n\n  \u003e\u003e terraform version\n  ```\n\n### Terraform Apply(실행)\n  ``` bash\n  // AWS 서비스 실행\n  \u003e\u003e terraform init\n\n  \u003e\u003e terraform apply 또는 terraform apply --auto-approve\n  ****--auto-approve 옵션 넣을 시 \"Enter a value: yes\" 없이 다이렉트로 진행****\n\n  Do you want to perform these actions?\n    Terraform will perform the actions described above.\n    Only 'yes' will be accepted to approve.\n  \n    Enter a value: yes\n  \n  aws_db_parameter_group.three_rds_parameter: Creating...\n  aws_eip.three_tier_eip: Creating...\n  aws_vpc.three_tier_vpc: Creating...\n  aws_eip.three_tier_eip: Creation complete after 1s [id=eipalloc-0476********62f52]\n  aws_vpc.three_tier_vpc: Creation complete after 1s [id=vpc-046c4********5ed38]\n  aws_internet_gateway.three_tier_GateWay: Creating...\n  .\n  .\n  .\n  .\n  aws_db_instance.three_rds: Still creating... [6m20s elapsed]\n  aws_db_instance.three_rds: Still creating... [6m30s elapsed]\n  aws_db_instance.three_rds: Creation complete after 6m40s [id=db-YX5ZZ4M***********OADYXQ4]\n  \n  Apply complete! Resources: 28 added, 0 changed, 0 destroyed.\n  \n  Outputs: (Example)\n  \n  was_instance_id = \"i-07f5xxxxxxxxxxx865\"\n  was_instance_private_ip = \"10.0.x.xx\"\n  web_instance_eip = \"43.xxx.xxx.187\"\n  web_instance_id = \"i-0cxxxxxxxxx7e9\"\n  ```\n\n### 리소스 확인 및 웹 페이지 확인\n![Nginx_Web_Page](https://github.com/dongkoony/aws_3_tier/assets/109497684/2444a9d0-292b-4375-a4db-ee907aec4fae)\n  ```bash\n  실행 후 프롬프트 Outputs: web_instance_eip = \"43.xxx.xxx.187\" Web Page 접속 확인.\n  AWS 리소스 확인\n  ```\n\n### Terraform Destroy(리소스 삭제)\n  ```bash\n  // AWS 서비스(리소스) 삭제\n  \u003e\u003e terraform destroy / terraform destroy --auto-approve\n  ****--auto-approve 옵션 넣을 시 \"Enter a value: yes\" 없이 다이렉트로 진행****\n\n  Do you really want to destroy all resources?\n    Terraform will destroy all your managed infrastructure, as shown above.\n    There is no undo. Only 'yes' will be accepted to confirm.\n  \n    Enter a value: yes\n  \n  aws_route_table_association.pub_c_assoc: Destroying... [id=rtbassoc-087353******bc1a9]\n  aws_eip.web_eip: Destroying... [id=eipalloc-0d04626******192f]\n  aws_route_table_association.rds_a_assoc: Destroying... [id=rtbassoc-001e0b******a3972]\n  aws_route_table_association.pub_sub_route: Destroying... [id=rtbassoc-07a4******c73f216]\n  aws_route_table_association.rds_c_assoc: Destroying... [id=rtbassoc-02f2c3******d535e]\n  aws_route_table_association.pri_c_assoc: Destroying... [id=rtbassoc-093e6c******3d9c6]\n  .\n  .\n  .\n  .\n  aws_subnet.Pri_subnet_A: Destruction complete after 0s\n  aws_vpc.three_tier_vpc: Destroying... [id=vpc-046c4f******d38]\n  aws_vpc.three_tier_vpc: Destruction complete after 1s\n  \n  Destroy complete! Resources: 28 destroyed.\n  ```\n\n### AWS 서비스(리소스) 삭제 확인\n  ```bash\n  EC2, EIP, RDS, VPC 등등 삭제 여부 확인\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdongkoony%2Faws_3_tier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdongkoony%2Faws_3_tier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdongkoony%2Faws_3_tier/lists"}