{"id":20901584,"url":"https://github.com/willfarrell/terraform-aws-template","last_synced_at":"2025-06-12T22:34:05.977Z","repository":{"id":142528793,"uuid":"151661759","full_name":"willfarrell/terraform-aws-template","owner":"willfarrell","description":"Project temple for building out a full AWS application","archived":false,"fork":false,"pushed_at":"2019-11-30T16:06:10.000Z","size":262,"stargazers_count":12,"open_issues_count":0,"forks_count":14,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-19T13:27:15.954Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/willfarrell.png","metadata":{"files":{"readme":"docs/README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-10-05T02:32:01.000Z","updated_at":"2024-10-13T14:10:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"378c9fdf-0d09-43e7-a07a-9e4201d480e5","html_url":"https://github.com/willfarrell/terraform-aws-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willfarrell%2Fterraform-aws-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willfarrell%2Fterraform-aws-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willfarrell%2Fterraform-aws-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willfarrell%2Fterraform-aws-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willfarrell","download_url":"https://codeload.github.com/willfarrell/terraform-aws-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243292852,"owners_count":20268126,"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":[],"created_at":"2024-11-18T11:36:06.857Z","updated_at":"2025-03-12T20:34:14.225Z","avatar_url":"https://github.com/willfarrell.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Infrastructure\nVisit [`willfarrell/terraform-aws-template`](https://github.com/willfarrell/terraform-aws-template) for the latest improvements and most up to date documentation.\n\n## Accounts\n\nName        | Account ID   | Colour | Root Email         |\n------------|--------------|--------|--------------------|\nmaster      |              | ------ |                    |\nproduction  |              | Red    |                    |\nstaging     |              | Orange |                    |\ntesting     |              | Yellow |                    |\ndevelopment |              | Green  |                    |\noperations  |              | Blue   |                    |\nforensics   |              | Purple |                    |\n\n## Project Structure\n\n```bash\n${project}-infrastructure\n|-- package.json\t# Script shortcuts (lint, install, deploy, test) \u0026 versioning?\n|-- amis            # Collection of AMIs, built by Packer\n|   |-- {name}      # AMI folders, ie bastion, ecs, nat or custom ones\n|-- master\t\t\t# Setup for root level account\n|   |-- state\t\t# Sets up state management for terraform\n|   |-- account     # Account setup (Groups, Monitoring)\n|   |-- operations\t# Setup for operation pieces\n|-- environments\n|   |-- account     # Account setup (Roles, Monitoring)\n|   |-- domain\t\t# Domain specific VPC, App, API, ECS, etc. Rename folder to `name`.\n|-- modules\t\t\t# Collection of project specific modules\n```\n\n## Getting Started\nFor up to date documentation and modules see [terraform-aws-template](https://github.com/willfarrell/terraform-aws-template).\n\n### Installing CLIs\n```bash\n$ brew install terraform\n\n# Optional, for building AMIs\n$ brew install packer\n```\n\n- [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-macos.html)\n- [AWS SSM Plugin](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html)\n- [AWS ECS CLI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_CLI_installation.html)\n\n### Setup Terraform Workspaces\nTo create the workspaces, go to the respective subfolder (`/environments/*/`), and run:\n\n```bash\n$ terraform init\n$ terraform workspace new production\n$ terraform workspace new staging\n$ terraform workspace new testing\n$ terraform workspace new development\n```\n\nEnsure you have the right workspace selected before you `apply`.\n\n```bash\n$ terraform workspace select development\n$ terraform workspace list\n```\n\n### Setup Multi-Accounts\nSee [docs](./docs/Multi Account Setup.md) for detailed steps.\n\n### Build AMIs\nTo create the AMIs, go to the respective subfolder (`/amis/*/`), edit the `variables.json`, and run:\n```bash\n$ packer build -var-file=variables.json ami.json\n```\n\nSee [docs](./docs/AMIs.md) for configuration and full documentation.\n\n### Install node dependencies\n```bash\n$ npm run install:npm\n```\n\n## Switch Roles\n- `OrganizationAccountAccessRole`: Admin Access\n\nIt is recommended that the `account/roles` module be forks to customized to specific needs\n\n## Manual Steps\n- [Well-Architected Tool](https://aws.amazon.com/well-architected-tool/)\n- [Trust Advisor](https://aws.amazon.com/premiumsupport/technology/trusted-advisor/)\n- [Macie](https://docs.aws.amazon.com/macie/latest/userguide/macie-setting-up.html#macie-setting-up-enable)\n\n## Deployment Steps\n1. Build an AMIs that will be needed\n```bash\npacker build -var-file=variables.json ami.json\n```\n\n1. master/state\n\n1. master/account\n    - [ ] Users (Manual)\n    - [ ] Macie (Manual)\n    - [x] Sub-Accounts / Organization\n    - [x] Groups for sub account access\n    - [x] Roles for sub accounts (bastion, ECR)\n    - [x] AMI permissions\n    - [x] CloudTrail\n    - [x] GuardDuty\n    - [ ] Security Hub\n\n1. Switch Roles into each sub-account using `OrganizationAccountAccessRole`. Create a `terraform` user to bootstrap assume roles.\nBe sure to delete the user after you bootstrap\n\n1. Setup `terraform` workspaces\nRun the following in each `environments` folder\n```bash\nterraform workspace new production\nterraform workspace new staging\nterraform workspace new testing\nterraform workspace new development\nterraform workspace select ${sub_account_name}\n```\n\n1. environment/account\n    - [x] Roles (admin, developer, operator, audit, etc)\n    - [x] API Gateway Logs\n    - [x] CloudTrail\n    - [x] GuardDuty\n    - [ ] Inspector Agent\n    - [ ] Macie (Manual)\n\n1. At this point you'll need to update your AWS credentials.\nUpdate `~/.aws/credentials`:\n```bash\n[${profile}-${sub_account_name}]\nsource_profile = ${profile}\nrole_arn = arn:aws:iam::${sub_account_id}:role/admin\nsession_name = ${profile}-${sub_account_name}\n```\n\n1. environment/domain\n    - [x] VPC\n    - [x] VPC Endpoints (S3, DynamoDB)\n    - [x] Bastion\n    - [x] RDS (postgres,mysql)\n    - [x] ElasticCache (redis)\n    - [x] ElasticSearch\n    - [x] DynamoDB\n    - [x] ALB + ECS\n    - [x] NLB + ECS\n    - [x] ECS\n    - [ ] API Gateway\n    - [ ] Events, SQS, SNS, Lambda, S3,\n    - [x] CloudFront\n    - [x] S3\n    - [ ] CloudWatch Dashboards\n\n## Built With\n- [Terraform](https://www.terraform.io/)\n- [Packer](https://www.packer.io/)\n- [NodeJS](https://nodejs.org/en/)\n\n### Modules\n- [state module](https://github.com/willfarrell/terraform-state-module)\n- [account modules](https://github.com/willfarrell/terraform-account-modules)\n- [logs module](https://github.com/willfarrell/terraform-logs-module)\n- [VPC module](https://github.com/willfarrell/terraform-vpc-module)\n- [DB modules](https://github.com/willfarrell/terraform-db-modules)\n- [EC modules](https://github.com/willfarrell/terraform-ec-modules)\n- [WAF module](https://github.com/willfarrell/terraform-waf-module)\n- [LB module](https://github.com/willfarrell/terraform-lb-module)\n- [IdP module](https://github.com/willfarrell/terraform-idp-module) - TODO\n- [CDN module](https://github.com/willfarrell/terraform-public-static-assets-module)\n\n## Contributing\nSee Developer Guide (TODO add link)\n\n## Versioning\nWe use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/willfarrell/terraform-aws-template/tags).\n\n## Authors\n- [will Farrell](https://github.com/willfarrell)\n\nSee also the list of [contributors](https://github.com/willfarrell/terraform-aws-template/contributors) who participated in this project.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n\n## Acknowledgments\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillfarrell%2Fterraform-aws-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillfarrell%2Fterraform-aws-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillfarrell%2Fterraform-aws-template/lists"}