{"id":19135162,"url":"https://github.com/uptechteam/terraform-aws-setup-template","last_synced_at":"2025-10-08T03:29:13.415Z","repository":{"id":114166021,"uuid":"154982051","full_name":"uptechteam/terraform-aws-setup-template","owner":"uptechteam","description":null,"archived":false,"fork":false,"pushed_at":"2019-04-14T18:04:09.000Z","size":12,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-07T03:10:13.910Z","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/uptechteam.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-10-27T15:54:51.000Z","updated_at":"2024-06-22T06:40:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"9154e891-00ad-4739-b529-0eb198ec101b","html_url":"https://github.com/uptechteam/terraform-aws-setup-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/uptechteam/terraform-aws-setup-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uptechteam%2Fterraform-aws-setup-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uptechteam%2Fterraform-aws-setup-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uptechteam%2Fterraform-aws-setup-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uptechteam%2Fterraform-aws-setup-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uptechteam","download_url":"https://codeload.github.com/uptechteam/terraform-aws-setup-template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uptechteam%2Fterraform-aws-setup-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278884915,"owners_count":26062787,"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-10-08T02:00:06.501Z","response_time":56,"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":[],"created_at":"2024-11-09T06:29:22.113Z","updated_at":"2025-10-08T03:29:13.389Z","avatar_url":"https://github.com/uptechteam.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform Environment Initialization Template\n\nThis is terraform scripts skeleton to initialize basic project development environment in the cloud. Currently only AWS supported.\n\n### General usage\n\nClone the repo and copy it to your project infrastructure folder, feel free to modify and add any resources you need. This project creates only most commonly used and basic resources for the fast development start.\n\n```\ngit clone git@github.com:uptechteam/terraform-aws-setup-template.git\n```\n\nIf you are not familar with terraform - check out documentation: https://www.terraform.io/docs/index.html  \n\nUsage workflow:\n\n - create S3 bucket for terraform state backend with `cloud-init`\n\n\n### Structure\n\nPackages:\n\n - `cloud-init`\n - `environment`\n\n#### Cloud Init\n\nThis package used to initialize AWS S3 bucket which will be used as backend for Terraform state of main `environment` module.  \nMore about different terraform backend here: https://www.terraform.io/docs/backends/index.html\n\n##### Variables:\n\n - `project_name` - will be used for state bucket name in format: \"{project_name}-terraform-state-bucket\"\n - `aws_region` - bucket AWS region\n - `aws_access_key` - AWS Access Key\n - `aws_secret_key` - AWS Secret Key\n\nExample of `.tfvars` can be found in the following folder  \nMore about variables: https://www.terraform.io/docs/configuration/variables.html\n\n##### Usage\n\n`terraform.tfvars` file with following variables should be created. Example can be found in `terraform.tfvars.example` file.  \n\nThen run:\n```bash\ncd cloud-init/\nterraform init\nterraform apply\n```\n\nTerraform state will be saved locally\n\n\n#### Environment\n\nMain package with initialize all infrastructure.\n\nInfrastructure list:\n\n - Service IAM with access to all used services. Keys for programmatic access are outputed. \n - VPC with private and public subnets\n - Three security groups - `open` - open all port all IPs, not used by default,\n `public` - open only chosen ports for all IPs (confgiured by variable), \n `private` - open all ports for listed CIDRs, subnets added by default. Adding new whitelisted IPs should be done in `main.tf` file in `security group` module config. Note: single IP in CIDR form has mask 32 bit. E.g. `172.68.0.15/32`\n - Two instances (Dev and Staging) inside public subnet of VPC.\n - Elastic IP for each instance\n - S3 bucket for each environment\n - Subdomains for each environment which mapped to created elastic IPs. Format: `dev.\u003cproject_name\u003e.\u003cdomain\u003e`, `staging.\u003cproject_name\u003e.\u003cdomain\u003e`.\n\nNote: no RDS database created because it mostly not be necessary for the development. \n\n##### Variables:\n\nGeneral variables:\n\n - `project_name` - used to create names for resources in format `{project_name}-{resource_name}`. Value should be URL compatible. E.g. `my-superchat-staging`, `my-superchat-vpc`  \n\nAWS general variables: \n\n - `aws_region` - bucket AWS region\n - `aws_access_key` - AWS Access Key\n - `aws_secret_key` - AWS Secret Key\n\n\nRoute 53 module variables:\n\n - `route53_domain_name` - Route53 domain name. Should be with `.` in the end. E.g. `uptech.team.`.\n\n\nInstance module variables:\n\n - `dev_instance_ssh_key_path` - path to public key for dev instace. Can be same as for staging.  \n - `staging_instance_ssh_key_path` - path to public key for staging instace. Can be same as for dev.  \n - `dev_instance_volume_size` - disk size for dev instance\n - `staging_instance_volume_size` - disk size for staging instance\n - `instance_ami` - Instances AMI. Expected that dev and staging use same AMI. More about AWS AMIs https://docs.aws.amazon.com/en_us/AWSEC2/latest/UserGuide/AMIs.html\n - `dev_instance_type` - dev instance type\n - `staging_instance_type` - staging instance type\n\n\nVPC module variables:\n\n - `vpc_cidr` - VPC CIDR, default `10.0.0.0/26` # More about CIDR: https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing \n - `vpc_subnets_cidrs` - Map with private and public subnets CIDRs, default `{ public = \"10.0.0.0/27\", private = \"10.0.0.32/27\" }`\n\n\nSecurity group module variables:\n\n - `public_ports` - List of ports which will be open in public security group \n\nMore about variables: https://www.terraform.io/docs/configuration/variables.html\n\n##### Usage\n\n`terraform.tfvars` file with following variables should be created. Example can be found in `terraform.tfvars.example` file.  \n\nTerraform state for this packages stored on AWS in the bucket which were created by `cloud-init`, so additional backend configuration required on init. \nExample: https://github.com/hashicorp/terraform/issues/13022#issuecomment-294262392  \n\nThen run:\n```bash\ncd environment/\nterraform init -backend-config=\"bucket=\u003ccloud-init-output-bucket-name\u003e\" -backend-config=\"region=us-east-1\" -backend-config=\"access_key=\u003cAWS_Access_key\u003e\" -backend-config=\"secret_key=\u003cAWS_Secret_key\u003e\"\nterraform apply\n```\nTo destroy infrastructure run:\n```bash\nterraform destroy\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuptechteam%2Fterraform-aws-setup-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuptechteam%2Fterraform-aws-setup-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuptechteam%2Fterraform-aws-setup-template/lists"}