Skip to content

yegorski/terraform-aws-ec2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS EC2 Instance Terraform Module

Terraform module to create an AWS EC2 instance.

You can set up VPC and subnets with terraform-aws-account-scaffolding.

Usage

Variables in all caps need to be replaced, as well as other as desired.

module "ec2" {
  source = "git::https://github.com/yegorski/terraform-aws-ec2.git?ref=master"

  ami_id      = "AMI_ID"  # or use `ami_lookup_filter`
  name        = "SERVER_NAME"
  size        = "t3.large"    # 2 CPU, 8 GB, for example
  volume_size = "50"

  aws_account_id              = "AWS_ACCOUNT_ID"
  subnet_id                   = "${data.aws_subnet_ids.private.ids[0]}"
  associate_public_ip_address = false
  ssh_ip                      = "VISIT_IPCHICKEN"

  ssh_key_name = "PUBLIC_KEY_NAME"

  tags = {
    Owner       = "yegorski"
    Environment = "production"
  }
}

About

Terraform module to create an AWS EC2 instance.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors