{"id":22166122,"url":"https://github.com/alextanhongpin/terraform-aws","last_synced_at":"2026-05-07T11:35:02.949Z","repository":{"id":79115275,"uuid":"127163024","full_name":"alextanhongpin/terraform-aws","owner":"alextanhongpin","description":"Code structure for Terraform running AWS Modules","archived":false,"fork":false,"pushed_at":"2018-04-09T13:54:21.000Z","size":1069,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T16:15:18.636Z","etag":null,"topics":["aws","go","hashicorp","terraform","terraform-modules"],"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/alextanhongpin.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":"2018-03-28T15:43:48.000Z","updated_at":"2018-04-09T13:54:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"68b4828c-2d56-4d4b-bbb2-55c496ed4bc6","html_url":"https://github.com/alextanhongpin/terraform-aws","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alextanhongpin/terraform-aws","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextanhongpin%2Fterraform-aws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextanhongpin%2Fterraform-aws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextanhongpin%2Fterraform-aws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextanhongpin%2Fterraform-aws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alextanhongpin","download_url":"https://codeload.github.com/alextanhongpin/terraform-aws/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextanhongpin%2Fterraform-aws/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32735318,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["aws","go","hashicorp","terraform","terraform-modules"],"created_at":"2024-12-02T05:18:07.178Z","updated_at":"2026-05-07T11:35:02.935Z","avatar_url":"https://github.com/alextanhongpin.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform Starter\n\n- [x] Create a single AWS instance\n- [ ] Link two instances together\n- [ ] Make variables\n- [ ] Make outputs\n- [ ] Store the data in s3\n- [ ] Create modules\n\n\n## Generic Makefile\n\n```Makefile\ninit:\n\tterraform init\n\nplan:\n\tterraform plan -var-file=main.tfvars -out=main\n\napply:\n\tterraform apply -var-file=main.tfvars\n\ndestroy:\n\tterraform destroy -var-file=main.tfvars\n\n# import:\n# \tterraform import [specific instance...]\n\ngraph:\n\t# If you hit the error: /bin/sh: dot: command not found, install graphviz\n\t# brew install graphviz\n\tterraform graph | dot -Tpng \u003e graph.png\n```\n\n## TIPS\n\n### Specify the current version \n\nAlways specify the current version in used so that users are aware of it.\n\n```\nterraform {\n  required_version = \"\u003e 0.7.0\"\n}\n```\n\n\n### Define variable type for required variables\n\n```hcl\n# Good\nvariable \"load_balancer_type\" {\n\ttype = \"string\"\n}\n\n# Redundant\nvariable \"idle_timeout\" {\n\ttype = \"string\"\n\tdefault = 60\n}\n\n# Redundant\nvariable \"internal\" {\n\ttype = \"string\"\n\tdefault = true\n}\n```\n\n### Split variables to optional and required section\n\n```\n# Required\nvariable \"a\" {\n\ttype = \"string\"\n}\n\nvariable \"b\" {\n\ttype = \"list\"\n}\n\n# Optional\nvariable \"c\" {\n\tdefault = true\n}\n\nvariable \"d\" {\n\tdefault = 10\n}\n```\n\n## Storing to S3 backend\n\nUnfortunately, when you change the access key or secret, the old state cannot be accessed anymore.\n\n```hcl\n/*\n * AWS S3\n *\n * Stores the Terraform state of the resources that has been created in the S3 backend.\n**/\n terraform {\n \trequired_version = \"\u003e= 0.11.2\"\n\n \tbackend \"s3\" {\n \t\tbucket = \"YOUR_BUCKET_NAME\"\n \t\tkey = \"YOUR_FILE_NAME\"\n \t\tregion = \"ap-southeast-1\"\n \t\tencrypt = true\n \t}\n }\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falextanhongpin%2Fterraform-aws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falextanhongpin%2Fterraform-aws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falextanhongpin%2Fterraform-aws/lists"}