{"id":20081992,"url":"https://github.com/exercism/terraform","last_synced_at":"2025-11-27T20:05:39.500Z","repository":{"id":37094260,"uuid":"271883797","full_name":"exercism/terraform","owner":"exercism","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-09T12:27:30.000Z","size":370,"stargazers_count":17,"open_issues_count":2,"forks_count":14,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-05-22T16:23:02.539Z","etag":null,"topics":["community-contributions-paused"],"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/exercism.png","metadata":{"funding":{"github":["exercism"],"custom":["https://exercism.org/donate"]},"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","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":"2020-06-12T20:23:36.000Z","updated_at":"2024-05-28T17:13:05.594Z","dependencies_parsed_at":"2023-01-29T03:45:41.279Z","dependency_job_id":"8c26a271-7bd2-4927-ba95-755134a88b25","html_url":"https://github.com/exercism/terraform","commit_stats":{"total_commits":221,"total_committers":18,"mean_commits":"12.277777777777779","dds":0.4298642533936652,"last_synced_commit":"dfdba8654b09ab4b6090fab1c546a71cf13c8622"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exercism%2Fterraform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exercism%2Fterraform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exercism%2Fterraform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exercism%2Fterraform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/exercism","download_url":"https://codeload.github.com/exercism/terraform/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241515953,"owners_count":19975140,"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":["community-contributions-paused"],"created_at":"2024-11-13T15:41:17.753Z","updated_at":"2025-11-27T20:05:39.495Z","avatar_url":"https://github.com/exercism.png","language":"HCL","funding_links":["https://github.com/sponsors/exercism","https://exercism.org/donate"],"categories":[],"sub_categories":[],"readme":"\n# Terraform scripts for Exercism\n\n## Manual Changes to Sync!\n\n- Add EFS Backup\n\n## TODO\n\n- Clean out old caches.\n- Switch Sidekick to small server.\n- Switch anycable to micro.\n- Toggle tooling jobs to serverless\n\n## Install\n\nTerraform is available via `brew` on Mac OS:\n\n```bash\nbrew install terraform\n```\n\n[Downloads for other OS](https://www.terraform.io/downloads.html) are available.\n\n## AWS Setup\n\n### Create a deploy user\n\n- Create an IAM user called `tooling-public-write-user`\n- Give them no permissions (these will be set by terraform)\n- Set programatic access and save the keys to add to GitHub\n\n### Create a public-write user for tooling\n\n- Create an IAM user called `github-deploy`\n- Give them no permissions (these will be set by terraform)\n- Set programatic access and save the keys to add to GitHub\n\n### Create a public-write user for lambda\n\n- Create an IAM user called `lambda-public-write-user`\n- Give them no permissions (these will be set by terraform)\n- Set programatic access and save the keys to add to GitHub\n\n### Create a CodeCommit user\n\n- Create an IAM user called `code-commit-replicator`\n- Give them no permissions (these will be set by terraform)\n- Set programatic access and save the keys to add to GitHub\n\n\n### Create state bucket\n\nTerraform state is stored in s3.\n\nCreate a bucket with Bucket Versioning enabled.\nThe default bucket is currently `exercism-terraform` - update `terraform/terraform.tf` if you want to change this.\n\nCreate a policy called `terraform-s3-state` with the following JSON:\n```\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": \"s3:ListBucket\",\n      \"Resource\": \"arn:aws:s3:::exercism-terraform\"\n    },\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": [\"s3:GetObject\", \"s3:PutObject\", \"s3:PutObjectAcl\"],\n      \"Resource\": \"arn:aws:s3:::exercism-terraform/production.state\"\n    }\n  ]\n}\n```\n\n### Create a terraform user\n\nCreate a policy called `terraform-iam` with the following JSON:\n```\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"VisualEditor0\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:GetUser\",\n                \"iam:GetUserPolicy\",\n                \"iam:GetRole\",\n                \"iam:UpdateAssumeRolePolicy\",\n                \"iam:GetPolicyVersion\",\n                \"iam:GetPolicy\",\n                \"iam:DeletePolicy\",\n                \"iam:CreateRole\",\n                \"iam:DeleteRole\",\n                \"iam:AttachRolePolicy\",\n                \"iam:PutRolePolicy\",\n                \"iam:GetRolePolicy\",\n                \"iam:CreatePolicy\",\n                \"iam:CreatePolicyVersion\",\n                \"iam:ListInstanceProfilesForRole\",\n                \"iam:GetServiceLinkedRoleDeletionStatus\",\n                \"iam:PassRole\",\n                \"iam:DetachRolePolicy\",\n                \"iam:ListPolicyVersions\",\n                \"iam:ListAttachedRolePolicies\",\n                \"iam:DeleteRolePolicy\",\n                \"iam:DeletePolicyVersion\",\n                \"iam:CreateInstanceProfile\",\n                \"iam:GetInstanceProfile\",\n                \"iam:RemoveRoleFromInstanceProfile\",\n                \"iam:DeleteInstanceProfile\",\n                \"iam:AddRoleToInstanceProfile\",\n                \"iam:DeleteUserPolicy\",\n                \"iam:ListRolePolicies\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"VisualEditor1\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:GetUserPolicy\",\n                \"iam:PutUserPolicy\"\n            ],\n            \"Resource\": [ \n              \"arn:aws:iam::*:user/github-deploy\",\n              \"arn:aws:iam::*:user/tooling-public-write-user\",\n              \"arn:aws:iam::*:user/lambda-public-write-user\"\n            ]\n        }\n    ]\n}\n```\n\n- Create a terraform IAM user.\n- Give them PowerUser privileges and the above policies (`terraform-iam` and `s3-state`)\n- Set programatic access and save the keys for later.\n\n## Setup\n\nCD into the `terraform` directory.\n\nInstall provider plugins:\n\n```bash\nterraform init\n```\n\n## Credentials Setup\n\nCreate a file `~/.aws/credentials`, or add the following stanza to an existing file with terraform user's credentials.\n\n```\n[exercism_terraform]\naws_access_key_id = XXXXXXXXXXXXXXXXXXXX\naws_secret_access_key = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n```\n\n## Init\n\nStart by running `terraform init`.\n\n```\nAWS_PROFILE=exercism_terraform terraform init\n```\n\n## Testing Before Doing\n\nTo see what will be run, use `plan`:\n\n```bash\nAWS_PROFILE=exercism_terraform terraform plan -var-file=variables/pre-production.tfvars\n```\n\n## Running for Real\n\nTo run things for real, and actually make changes to infrastructure:\n\n```bash\nAWS_PROFILE=exercism_terraform terraform apply -var-file=environments/staging.tfvars\n```\n\n## Debugging\n\nThe environment variable `TF_LOG` can be set to `DEBUG` or another value to enable more versbose logs.\n\nFor all values see the [Terraform debugging documenteion](https://www.terraform.io/docs/internals/debugging.html)\n\n## Formatting\n\nTerraform provides a tool to format manifests:\n\n```\nterraform fmt\n```\n\n## Adding new tooling\n\n- Add a line to the list of tools in [`terraform/main.tf`](./terraform/main.tf)\n- Add a line to the tooling type's configuration in [`terraform/dynamodb_tooling_language_groups.tf`](./terraform/dynamodb_tooling_language_groups.tf)\n\nCurrently the ami.sh also needs updating\n\n## More Documentation\n\n- [Getting started blog post](https://hackernoon.com/introduction-to-aws-with-terraform-7a8daf261dc0) which describes basic usage, templates, and variables.\n- [Terraform documentation](https://www.terraform.io/docs/index.html)\n- [S3 Bucket provider documentation](https://www.terraform.io/docs/providers/aws/r/s3_bucket.html)\n\n- [Public + Private VPC](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Scenario2.html#VPC_Scenario2_Implementation)\n- [Useful Fargate Blog Post](https://blog.oxalide.io/post/aws-fargate/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexercism%2Fterraform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexercism%2Fterraform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexercism%2Fterraform/lists"}