/terraform-ec2-instance

Terraform file with everything you need to create an internet-facing EC2 instance.

Primary LanguageHCLMIT LicenseMIT

terraform-ec2-instance

Installation

  1. Ensure you are signed up for AWS.
  2. Download the AWS command line interface.
  3. Set up the credentials file from AWS via aws configure
  4. git clone git@github.com:ryanmcdermott/terraform-ec2-instance.git
  5. Change the SSH key path variables in variables.tf to point to your SSH keys.
  6. terraform init
  7. terraform apply

Connecting to instance

  1. Visit the AWS console and find the Instances page.
  2. Click the my_instance link.
  3. Copy the Public IPv4 DNS name for the instance. It should look something like ubuntu@ec2-[ip1-ip2-ip3-ip4].[REGION].compute.amazonaws.com
  4. Open a terminal on your computer.
  5. ssh YOUR_HOSTNAME

Destroying EC2 instance

  1. terraform destroy