{"id":24286190,"url":"https://github.com/d2verb/ec2-rds-single-az-template","last_synced_at":"2026-01-28T11:02:39.864Z","repository":{"id":98589693,"uuid":"409578171","full_name":"d2verb/ec2-rds-single-az-template","owner":"d2verb","description":null,"archived":false,"fork":false,"pushed_at":"2021-09-23T12:20:52.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-02T02:49:59.313Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/d2verb.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":"2021-09-23T12:15:42.000Z","updated_at":"2021-09-23T12:20:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"b30969e8-6638-452e-bbb0-7f40fd656021","html_url":"https://github.com/d2verb/ec2-rds-single-az-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/d2verb/ec2-rds-single-az-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d2verb%2Fec2-rds-single-az-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d2verb%2Fec2-rds-single-az-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d2verb%2Fec2-rds-single-az-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d2verb%2Fec2-rds-single-az-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d2verb","download_url":"https://codeload.github.com/d2verb/ec2-rds-single-az-template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d2verb%2Fec2-rds-single-az-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28844432,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T10:53:21.605Z","status":"ssl_error","status_checked_at":"2026-01-28T10:53:20.789Z","response_time":57,"last_error":"SSL_read: 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":[],"created_at":"2025-01-16T07:28:53.487Z","updated_at":"2026-01-28T11:02:39.844Z","avatar_url":"https://github.com/d2verb.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ec2-rds-single-az-template\n\n## なにこれ\nSingle-AZ 構成で EC2, RDS を構築する terraform テンプレート\n\n## 前提\n- terraform のインストール\n  - see: https://learn.hashicorp.com/tutorials/terraform/install-cli?in=terraform/aws-get-started\n- aws cli のインストールおよび何かしらの aws profile の設定\n  - see: https://docs.aws.amazon.com/ja_jp/cli/latest/userguide/cli-configure-quickstart.html\n\n## 構築方法\n### 1. 鍵の生成\n\nEC2 インスタンスに ssh アクセスするための秘密鍵・公開鍵を作成する。鍵の名前は `variables.tf` 内の設定と一致させないといけない\n\n```\n$ cd ~/.ssh\n$ ssh-keygen -t rsa -f sample\n$ ls ~/.ssh | grep sample\nsample\nsample.pub\n```\n\n### 2. 設定の変更\n\n自身の環境や使い方に合わせて `variables.tf` 内の値を変更する\n\n\n### 3. terraform apply の実行\n\nterraform apply を実行して、yes を入力する\n```\n$ terraform apply\n\nAn execution plan has been generated and is shown below.\nResource actions are indicated with the following symbols:\n  + create\n\nTerraform will perform the following actions:\n...\nPlan: 19 to add, 0 to change, 0 to destroy.\n\nChanges to Outputs:\n  + public_ip    = (known after apply)\n  + rds_endpoint = (known after apply)\n\nDo 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リソースの作成が完了すると、以下が出力される\n\n```\nApply complete! Resources: 0 added, 0 changed, 0 destroyed.\n\nOutputs:\n\nec2_endpoint = \"ec2-*-***-**-**.ap-northeast-1.compute.amazonaws.com\"\nrds_endpoint = \"terraform-********************.***********.ap-northeast-1.rds.amazonaws.com:3306\"```\n\n```\n\n## 動作確認\n### 1. EC2 の疎通確認\n```\n$ ssh -i ~/.ssh/sample ec2-user@ec2-*-***-**-**.ap-northeast-1.compute.amazonaws.com\n...\n\n       __|  __|_  )\n       _|  (     /   Amazon Linux 2 AMI\n      ___|\\___|___|\n\nhttps://aws.amazon.com/amazon-linux-2/\n11 package(s) needed for security, out of 35 available\nRun \"sudo yum update\" to apply all updates.\n[ec2-user@ip-10-0-1-8 ~]$\n```\n\n### 2. RDS の疎通確認\n```\n[ec2-user@ip-10-0-1-8 ~]$ sudo yum install -y mysql\n[ec2-user@ip-10-0-1-8 ~]$ mysql -h terraform-********************.***********.ap-northeast-1.rds.amazonaws.com -u foo -p\nEnter password: \nWelcome to the MariaDB monitor.  Commands end with ; or \\g.\nYour MySQL connection id is 14\nServer version: 5.7.33 Source distribution\n\nCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.\n\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\n\nMySQL [(none)]\u003e \n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd2verb%2Fec2-rds-single-az-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd2verb%2Fec2-rds-single-az-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd2verb%2Fec2-rds-single-az-template/lists"}