{"id":21384458,"url":"https://github.com/daljitdokal/aws-server-setup-with-terraform","last_synced_at":"2026-02-05T13:31:17.671Z","repository":{"id":167743638,"uuid":"527066809","full_name":"daljitdokal/aws-server-setup-with-terraform","owner":"daljitdokal","description":"aws server setup with terraform","archived":false,"fork":false,"pushed_at":"2022-12-08T04:15:58.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-17T05:37:41.958Z","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":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daljitdokal.png","metadata":{"files":{"readme":"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":"2022-08-21T00:03:51.000Z","updated_at":"2022-08-21T01:46:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"a67240f3-410b-4209-b41b-cc3677eb63aa","html_url":"https://github.com/daljitdokal/aws-server-setup-with-terraform","commit_stats":null,"previous_names":["daljitdokal/aws-server-setup-with-terraform"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/daljitdokal/aws-server-setup-with-terraform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daljitdokal%2Faws-server-setup-with-terraform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daljitdokal%2Faws-server-setup-with-terraform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daljitdokal%2Faws-server-setup-with-terraform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daljitdokal%2Faws-server-setup-with-terraform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daljitdokal","download_url":"https://codeload.github.com/daljitdokal/aws-server-setup-with-terraform/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daljitdokal%2Faws-server-setup-with-terraform/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29122605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T10:47:47.471Z","status":"ssl_error","status_checked_at":"2026-02-05T10:45:08.119Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2024-11-22T11:40:59.246Z","updated_at":"2026-02-05T13:31:17.642Z","avatar_url":"https://github.com/daljitdokal.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS server setup with terraform\n\nThe purpose of this documentation is to automate your AWS cloud infrastructure.\n\n\nRequirements:\n\n- AWS account setup\n- Windows or Linux machine with VSCode\n\n\n## Step 1 - Intall Terraform\n\n**Ubuntu:**\n\nPlease run following commands to setup.\n\n```bash\nwget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg\necho \"deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main\" | sudo tee /etc/apt/sources.list.d/hashicorp.list\nsudo apt update \u0026\u0026 sudo apt install terraform\n```\n\n**Windows:**\n\n- Download latest version of Terraform - https://www.terraform.io/downloads\n- Unzip and Copy `terraform.exe`\n- Create new Folder in `C:\\Terraform` and paste the file.\n- Edit `Environment variables` via adding new `Path` value as `C:\\Terraform` in `System variables`\n\n**Testing:**\n\nRun the following command to test if its installed correctly:\n\n```bash\nterraform -v\n``` \n\n\n## Step 2 - Setup VSCode\n\nInstall extentions:\n\n- Terraform\n- AWS Toolkit\n\n\n## Step 3 - Read documentation for example provided by Terraform\n\nhttps://registry.terraform.io/providers/hashicorp/aws/latest/docs\n\n\n## Step 4 - Create Project and Connect to AWS\n\n#### Create AWS shared credentials in VScode\n\n- Press `Cntl+Shft+p` in VSCode and Select `AWS: Crete Credentials Profile`\n  - Enter `aws_access_key_id` and `aws_secret_access_key` (from your AWS account)\n  - Update default name to `USER NAME` of AWS account. \n\n#### Install and Configure AWS Provider\n\nInstall and Configure AWS Provider:\n\n- Create new folder `Terraform` and open it in VSCode\n- Create new file `providers.tf` with following code\n\n```bash\n# Install AWS Provider\nterraform {\n  required_providers {\n    aws = {\n      source  = \"hashicorp/aws\"\n      version = \"~\u003e 4.0\"\n    }\n  }\n}\n\n# Configure the AWS Provider\nprovider \"aws\" {\n  region = \"us-east-1\"\n  shared_config_files      = [\"~/.aws/config\"]\n  shared_credentials_files = [\"~/.aws/credentials\"]\n  profile                  = \"User Name\"\n}\n``` \n- Run command: `terraform init`.\n\n#### Add required configration\n\nPlease see:\n\n- `providers.tf`\n- `main.tf`\n- `variables.tf`\n- `output.tf`\n\n## Step 5 - Format and Validate\n\nRun the following commands:\n\n```bash\nterraform fmt\nterraform validate\n``` \n\n## Step 6 - Create AWS Resources\n\nRun the following commands:\n\n```bash\n# terraform apply\nterraform apply -auto-approve\n\n# Apply complete! Resources: 1 added, 0 changed, 0 destroyed.\n``` \n\nor with custom name for EC2\n\n```bash\nterraform apply -var \"instance_name=devEC2Instance\" -auto-approve\n\n# Apply complete! Resources: 1 added, 0 changed, 0 destroyed.\n``` \n\n## Step 7 - Teardown\n\nRun the following command to teardown all resources created within this project\n\n```bash\nterraform destroy -auto-approve\n\n# Destroy complete! Resources: 1 destroyed.\n``` \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaljitdokal%2Faws-server-setup-with-terraform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaljitdokal%2Faws-server-setup-with-terraform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaljitdokal%2Faws-server-setup-with-terraform/lists"}