{"id":26158285,"url":"https://github.com/envygeeks/discourse-terraform","last_synced_at":"2025-08-31T12:42:14.844Z","repository":{"id":66024060,"uuid":"100344199","full_name":"envygeeks/discourse-terraform","owner":"envygeeks","description":"A basic Terraform for Discourse","archived":false,"fork":false,"pushed_at":"2022-07-13T04:02:15.000Z","size":55,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-06T00:04:01.619Z","etag":null,"topics":["amazon","amazon-aws","aws","discourse","discourse-terraform","ops","terraform"],"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/envygeeks.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":"security.tf","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-15T06:03:00.000Z","updated_at":"2024-05-19T12:53:37.000Z","dependencies_parsed_at":"2023-02-20T19:30:17.627Z","dependency_job_id":null,"html_url":"https://github.com/envygeeks/discourse-terraform","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/envygeeks/discourse-terraform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envygeeks%2Fdiscourse-terraform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envygeeks%2Fdiscourse-terraform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envygeeks%2Fdiscourse-terraform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envygeeks%2Fdiscourse-terraform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/envygeeks","download_url":"https://codeload.github.com/envygeeks/discourse-terraform/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envygeeks%2Fdiscourse-terraform/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271247505,"owners_count":24725915,"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","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"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":["amazon","amazon-aws","aws","discourse","discourse-terraform","ops","terraform"],"created_at":"2025-03-11T10:49:17.819Z","updated_at":"2025-08-20T01:04:49.582Z","avatar_url":"https://github.com/envygeeks.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"[1]: https://console.aws.amazon.com/iam/home?region=us-east-2#/security_credential\n[2]: https://console.aws.amazon.com/iam/home?region=us-east-2#/users\n[3]: https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/#platform-windows\n[4]: https://aws.amazon.com/blogs/aws/new-aws-certificate-manager-deploy-ssltls-based-apps-on-aws/\n\n# Discourse Terraform\n\nA Terraform project to launch Discourse in the cloud.\n\n## Quick Usage\n### 1. Create an API Key-Pair and Export It\n\nYou should first [go to AWS Console][1] and then click on Access Keys , and create a key-pair... you can also optionally setup an IAM user to limit your surface, this can be done at [through IAM console][2].  After you have done one of these things you should export your key so that we can use it to build your infrastructure.\n\n#### Linux/Unix\n\n```sh\nexport AWS_ACCESS_KEY_ID=\"\u003cAccessKey\u003e\"\nexport AWS_SECRET_ACCESS_KEY=\"\u003cSecretKey\u003e\"\nexport AWS_DEFAULT_REGION=\"us-west-2\"\n```\n\n#### Windows\n\n```sh\nset AWS_ACCESS_KEY_ID=\"\u003cAccessKey\u003e\"\nset AWS_SECRET_ACCESS_KEY=\"\u003cSecretKey\u003e\"\nset AWS_DEFAULT_REGION=\"us-west-2\"\n```\n\n### 2. Create your deploy key\n#### Linux/Unix\n\n```sh\n# This generates an RSA Key.\nssh-keygen -t rsa -b 4096 -f keys/deploy.key\nmv keys/deploy.key.pub keys/deploy.pub\n```\n\n#### Windows\n\nOn Windows you should either have bash on Windows, or you will need to visit [Github][3] for a guide on how to create an SSH key with Github, Git Bash (CYGWin), or... if you know another way, then use it.  Launch bash and then refer to the `Linux/Unix` section.\n\n### 3. Add your personal public key to `keys/`\n#### Linux/Unix\n***The following assumes you use a Yubikey to store your SSH keys on separate hardware, if you do not, switch `cardno:\u003cserial\u003e` with your email and it will extract your key.***\n\n```sh\nssh-add -L cardno:\u003cSerial\u003e \u003e keys/user.pub\n```\n\n#### Windows\n\nOn Windows you will need to manually copy your public key from wherever you store it, if you use `pa-agent` it might be able to extract the public key on your behalf to a file to copy, if you have GPG2 and store your key on hardware, and it is in your path you should be able to do\n\n```sh\ngpg2 --export-ssh-key you@example.com\n```\n\n### 4. Init your Terraform\n\nThis is an important step, since we need both the AWS plugin, as well as the Template plugin so that we can build out your infrastructure. ***Please do not skip this step***\n\n```sh\nterraform init\n```\n\n### 5. Adjust your variables\n\n***Inside of `vars.tf` there are a bunch of variables you can customize, some of them, however, are required.  You can set those with `terraform.tfvars`.***\n\n```terraform\ndiscourse_hostname=\"your.fqdn\"\ndiscourse_smtp_username=\"you@example.com\"\ndiscourse_developer_emails=\"you@example.com\"\ndiscourse_smtp_password=\"myPassword\"\ndb_password = \"myPassword\"\n```\n\n***For a full list of customizable variables please refer to `vars.tf` everything in there except for templates is customizable via `terraform.tfvars`***\n\n### 6. Verify Your Plan\n\nFirst you should review and make sure everything looks okay, never randomly launch instances without first reviewing.  One of the golden rules of systems.\n\n```\nterraform plan\n```\n\n### 7. Launch Your Plan\n\nAfter reviewing you can launch the instances\n\n```\nterraform apply\n```\n\nThis will launch a VPC, several Security Groups, an RDS (PostgreSQL) instance, 2 Subnets (across 2 Zones), an ElastiCache (Redis) instance, and an ELB to route your traffic to the instance.  Each one of these is slugged, and designed so that you can spot them within your admin panel of your AWS control plane. ***By default this Terraform project is designed so that it can be ran on minimal costs, you can adjust `vars.tf` so that you can also run it entirely free***\n\n## Extras\n### Enable SSL\n#### Using AWS Certificate Manager (Free)\n\nYou should first visit [this blog post][4] and learn how to create your own SSL certificate inside of AWS (for free of-course), there are manual and necessary steps to create one.  After doing that you can run the following and repeat the `terraform` steps necessary to deploy.\n\n```bash\ncp templates/ssl.tf .\n```\n\n#### Using A Private Provider\n\nIf you use a private provider, you should first copy your private key, and\nyour public key to `keys/ssl.key` and `keys/ssl.crt` respectively, and then run the following:\n\n```\ncp templates/ssl.private.tf ssl.tf\n```\n\nWe will upload your certificate to the certificate manager and then attach it to your load balancer on your behalf, without much more interaction or requirement then that.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenvygeeks%2Fdiscourse-terraform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenvygeeks%2Fdiscourse-terraform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenvygeeks%2Fdiscourse-terraform/lists"}