Skip to content

tonygyerr/terraform-aws-ec2

Repository files navigation

Module EC2

module "ec2" {
  source = "git::ssh://git@github.com:tonygyerr/terraform-aws-ec2.git"
  ami                         = var.ami
  app_name                    = var.app_name
  aws_key_name                = var.aws_key_name
  associate_public_ip_address = var.associate_public_ip_address
  instance_count              = var.instance_count
  instance_type	              = var.instance_type
  network_interface           = var.network_interface
  public_subnet_ids           = var.public_subnet_ids
  subnet_id                   = var.subnet_id
  tags                        = var.tags
  vpc                         = true
  vpc_config                  = var.vpc_config 
} 

Prerequisites

  • Docker (for using Docker Image of dependencies)
  • Git
  • Terraform
  • AWS Key pair for Terraform provisioning.
  • AWS S3 bucket for remote terraform state file (tfstate)
  • AWS Dynamo Database for tfstate table state lock

How to run this Module using Terraform Commands

cd examples
terraform get
terraform init -backend-config ../backend-config/dev.tfvars
terraform plan -var-file="../env-config/dev.tfvars"
terraform apply -var-file="../env-config/dev.tfvars" -auto-approve
terraform destroy -var-file="../env-config/dev.tfvars"

Requirements

Name Version
aws ~> 2.0

Providers

Name Version
aws ~> 2.0

Inputs

Name Description Type Default Required
acn_tags optional tags map(string) {} no
ami n/a string n/a yes
app_name Application Name string "" no
app_vol_encryption n/a string "true" no
app_vol_size size for app vol string "30" no
app_vol_type volume type for app string "gp2" no
associate_public_ip_address n/a bool n/a yes
aws_key_name aws key name string "" no
aws_region ec2 region for the vpc string "" no
iam_instance_profile_name n/a string "" no
instance_count n/a string n/a yes
instance_type app instance type string "t2.micro" no
network_interface Network interface ID to associate with string "" no
open_cidr vpc cidr for subnet string "0.0.0.0/0" no
public_ipv4_pool EC2 IPv4 address pool identifier or amazon. This option is only available for VPC EIPs. string null no
public_subnet_ids list of subnet ids list [] no
security_groups security groups applied to the load balancer. e.g. ["sg-ab15ebe3","sg-b012ecf8"] list [] no
subnet_id n/a string n/a yes
tags optional tags map(string) n/a yes
vpc Boolean if the EIP is in a VPC or not bool null no
vpc_config configuration option for vpc map(string) n/a yes

Outputs

Name Description
app_ebs_id n/a
app_ec2_id n/a
app_sg_id n/a
id Contains the EIP allocation ID
private_ip n/a
public_dns Public DNS associated with the Elastic IP address
public_eip Contains the public IP address
public_ip n/a

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published