Skip to content

This is a simple module for creating EC2 instance with SSH Access.

License

Notifications You must be signed in to change notification settings

rlnchow/terraform-ec2-instance-ssh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS EC2 Instance Terraform module with SSH

This is a simple module for creating EC2 instance with SSH Access.

  • This module will create required security groups for SSH
  • This module is designed to take advantage of local keys (id_rsa & id_rsa.pub)
  • If you're using id_rsa.pub on your local machine then you can connect remote machine with simple commands.
    • Example: ssh ec2-user@56.45.9.121.

These types of resources are supported:

Terraform versions

Terraform 0.12. Pin module version to ~> v2.0.

Usage

module "ec2_cluster" {
  source                 = "github.com/rlnchow/terraform-ec2-instance-ssh"

  name                   = "my-cluster"
  instance_count         = 5

  region                 = "us-east-1"
  ami                    = "ami-ebd02392"
  vpc_id                 = "vpc-123456
  key_name               = "user1"
  public_key             = "/User/Ravipati/.ssh/id_rsa.pub" # Physical location of Key.
}

Inputs

Name Description Type Default Required
region Region where to spin up EC2 instance string n/a yes
ami_id ID of AMI to use for the instance string n/a yes
vpc_id VPC ID string n/a yes
public_key Location of Public ID on workstation string n/a yes

Outputs

Name Description
ec2_ip Public IP address for instance
ec2_id Instance ID

Credits.

This module is created by using verified modules from Hashicorp

License

GNU GENERAL PUBLIC LICENSE

About

This is a simple module for creating EC2 instance with SSH Access.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages