https://github.com/ryanmcdermott/terraform-ec2-instance
Terraform file with everything you need to create an internet-facing EC2 instance.
https://github.com/ryanmcdermott/terraform-ec2-instance
Last synced: 3 months ago
JSON representation
Terraform file with everything you need to create an internet-facing EC2 instance.
- Host: GitHub
- URL: https://github.com/ryanmcdermott/terraform-ec2-instance
- Owner: ryanmcdermott
- License: mit
- Created: 2020-12-20T23:47:04.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-06-19T22:47:13.000Z (almost 3 years ago)
- Last Synced: 2024-10-21T21:07:53.473Z (over 1 year ago)
- Language: HCL
- Size: 3.91 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# terraform-ec2-instance
## Installation
1. Ensure you are signed up for AWS.
1. Download the AWS command line interface.
1. Set up the credentials file from AWS via `aws configure`
1. `git clone git@github.com:ryanmcdermott/terraform-ec2-instance.git`
1. Change the SSH key path variables in `variables.tf` to point to your SSH keys.
1. `terraform init`
1. `terraform apply`
## Connecting to instance
1. Visit the AWS console and find the Instances page.
1. Click the `my_instance` link.
1. Copy the Public IPv4 DNS name for the instance. It should look something like `ubuntu@ec2-[ip1-ip2-ip3-ip4].[REGION].compute.amazonaws.com`
1. Open a terminal on your computer.
1. `ssh YOUR_HOSTNAME`
## Destroying EC2 instance
1. `terraform destroy`