{"id":19357864,"url":"https://github.com/swiftsoftwaregroup/aws-ec2-terraform","last_synced_at":"2026-03-04T04:02:58.724Z","repository":{"id":251407816,"uuid":"837260802","full_name":"swiftsoftwaregroup/aws-ec2-terraform","owner":"swiftsoftwaregroup","description":"Deploy EC2 instance with Terraform","archived":false,"fork":false,"pushed_at":"2024-08-07T01:28:49.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-24T11:49:43.672Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/swiftsoftwaregroup.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":"2024-08-02T14:55:57.000Z","updated_at":"2024-08-07T01:28:52.000Z","dependencies_parsed_at":"2024-08-02T20:33:25.953Z","dependency_job_id":"e9689fc5-9ace-46d4-98f1-98dae7684b4e","html_url":"https://github.com/swiftsoftwaregroup/aws-ec2-terraform","commit_stats":null,"previous_names":["swiftsoftwaregroup/aws-ec2-terraform"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/swiftsoftwaregroup/aws-ec2-terraform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Faws-ec2-terraform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Faws-ec2-terraform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Faws-ec2-terraform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Faws-ec2-terraform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swiftsoftwaregroup","download_url":"https://codeload.github.com/swiftsoftwaregroup/aws-ec2-terraform/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Faws-ec2-terraform/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30071670,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T03:25:38.285Z","status":"ssl_error","status_checked_at":"2026-03-04T03:25:05.086Z","response_time":59,"last_error":"SSL_read: 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-10T07:09:28.998Z","updated_at":"2026-03-04T04:02:58.690Z","avatar_url":"https://github.com/swiftsoftwaregroup.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aws-ec2-terraform\nDeploy EC2 instance with Terraform\n\n## Setup for macOS\n\nMake sure you do this setup first:\n\n1. [Setup macOS for AWS Cloud DevOps](https://blog.swiftsoftwaregroup.com/setup-macos-for-aws-cloud-devops)\n\n2. [AWS Authentication](https://blog.swiftsoftwaregroup.com/aws-authentication)\n\n3. Install Terraform via Homebrew:\n\n   ```bash\n   # install\n   brew tap hashicorp/tap\n   brew install hashicorp/tap/terraform\n   \n   # verify\n   terraform -help\n   ```\n\n## Development\n\nConfigure the project:\n\n```bash\nsource configure.sh\n```\n\nFormat configuration:\n\n```bash\nterraform fmt\n```\n\nValidate configuration:\n\n```bash\nterraform validate\n```\n\n### Deploy\n\nPreview infrastructure:\n\n```bash\nterraform plan -out terraform.plan\n```\n\nCreate infrastructure:\n\n```bash\nterraform apply terraform.plan\n```\n\nCheck state:\n\n```bash\nterraform show\n```\n\n### Test Deployment\n\nCheck that you can browse the `nginx` default site:\n\n```bash \ninstance_public_ip=$(terraform output -json | jq -r '.instance_public_ip.value')\nopen http://$instance_public_ip\n```\n\nConnect to instance via SSH:\n\n```bash\nkey=\"aws-ec2-key\"\ninstance_public_ip=$(terraform output -json | jq -r '.instance_public_ip.value')\nssh -i ~/.ssh/$key ec2-user@$instance_public_ip\n```\n\n## Cleanup\n\nReview the changes and verify the execution plan:\n\n```bash\nterraform plan -destroy\n```\n\nDelete the resources:\n\n```bash\nterraform destroy\n```\n\n## How to create a new project\n\n```bash\n# create main.tf\ncat \u003c\u003c 'EOF' \u003e main.tf\nterraform {\n  required_providers {\n    aws = {\n      source  = \"hashicorp/aws\"\n      version = \"~\u003e 4.16\"\n    }\n  }\n\n  required_version = \"\u003e= 1.2.0\"\n}\n\n# AWS config\n# leave empty to read the settings from the AWS CLI configuration\nprovider \"aws\" {}\nEOF\n\n# initialize the project\n# this will download provider plugin into .terraform subdir\nterraform init\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftsoftwaregroup%2Faws-ec2-terraform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswiftsoftwaregroup%2Faws-ec2-terraform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftsoftwaregroup%2Faws-ec2-terraform/lists"}