{"id":20547816,"url":"https://github.com/mjamalg/ec2-instance-connect-endpoint","last_synced_at":"2026-04-18T01:36:40.844Z","repository":{"id":259988679,"uuid":"828204404","full_name":"mjamalg/ec2-instance-connect-endpoint","owner":"mjamalg","description":"Terraform configs to deploy a VPC with 2 instances in a private subnet and an EC2 Instance Connect Endpoint as well as security groups to allow ssh connectivity into the private EC2 instances.","archived":false,"fork":false,"pushed_at":"2024-09-28T15:39:14.000Z","size":45,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-26T18:01:58.234Z","etag":null,"topics":["aws","ec2-instance-connect-endpoint","terraform"],"latest_commit_sha":null,"homepage":"","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/mjamalg.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":"2024-07-13T12:31:20.000Z","updated_at":"2024-10-16T02:10:45.000Z","dependencies_parsed_at":"2024-10-29T00:20:59.205Z","dependency_job_id":"df927c0a-1524-469d-bfc3-d7e0a7f4da0f","html_url":"https://github.com/mjamalg/ec2-instance-connect-endpoint","commit_stats":null,"previous_names":["mjamalg/ec2-instance-connect-endpoint"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mjamalg/ec2-instance-connect-endpoint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjamalg%2Fec2-instance-connect-endpoint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjamalg%2Fec2-instance-connect-endpoint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjamalg%2Fec2-instance-connect-endpoint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjamalg%2Fec2-instance-connect-endpoint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mjamalg","download_url":"https://codeload.github.com/mjamalg/ec2-instance-connect-endpoint/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjamalg%2Fec2-instance-connect-endpoint/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31953515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"ssl_error","status_checked_at":"2026-04-18T00:39:20.671Z","response_time":62,"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":["aws","ec2-instance-connect-endpoint","terraform"],"created_at":"2024-11-16T02:10:44.092Z","updated_at":"2026-04-18T01:36:40.828Z","avatar_url":"https://github.com/mjamalg.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Using EC2 Instance Connect Endpoint\n\n### About\nThe terraform configs in this repo, most of which were created with the community supported modules, provision a VPC with my \"production ready layout\":\t\n- us-east-1 region\n- 10.72.0.0/16 custom VPC CIDR\n- 2 Availability Zones (us-east-1a, us-east-1b)\n- 3 Subnets in each AZ\n    - 1 public\n    - 2 private (app and data respectively)\n- 1 NAT Gateway \n- 1 Internet Gateway\n- 1 public route table\n- 1 private route table (for the Nat Gateway)\n\n![eic-project-vpc-readme](https://github.com/user-attachments/assets/6bdfb6ee-e66a-4bf7-959f-c476ee42a797)\n\nThey also create an EC2 Instance Connect Endpodint, 2 instances in the \"app\" private subnet of each AZ, as well as 2 security groups with the AWS recommended ingress and egress ssh rules for both the EICE and the EC2 instances.\n![eic-project-sgr-list-readme](https://github.com/user-attachments/assets/9b4c69e8-b0ea-4bdc-9ca3-9f3e0d050255)\n\nWhat's great about the EC2 Instance Connect Endpoint (EICE) is that it allows secure remote acess to instances in a private subnet without the need for a bastion host or having to place instances in the public subnet!\n\nIn order to utilize the EICE, I make use of the _aws ec2-instance-connect_ aws cli option with the ssh ProxyCommand like this:\n```\nssh ec2-user@i-0123456789example -i mypem.pem -o ProxyCommand='aws ec2-instance-connect open-tunnel --instance-id %h'\n```\nReplace the i-0123456789example with an instance id, and replace mypem.pem with YOUR EC2 ssh key file. When you run the command you will make an ssh connection!:\n![eic-project-ssh-readm](https://github.com/user-attachments/assets/aa63b643-a938-4d66-85dd-407762355b69)\n\n### Cost\n- NAT Gateway - $0.45 an hour and THERE IS NO FREE TIER (crazy)\n- EC2 Instance Connect Endpoint - no extra cost, just standard data transfer rates apply\n\n### Q.E.D\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjamalg%2Fec2-instance-connect-endpoint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmjamalg%2Fec2-instance-connect-endpoint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjamalg%2Fec2-instance-connect-endpoint/lists"}