Skip to content

Keimille/terraform-aws-stack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS Simple EC2 Webserver Module

Terraform module which creates VPC and EC2 resources on AWS.

Supported Resources:

Terraform versions

Terraform 0.12 and newer. Submit pull requests to the master branch

Usage

module "stack" {
  source = "github.com/Keimille/terraform-aws-stack"

  ami = "<ami-id here>"

  cidr = "10.0.0.0/16"

  public-subnet = "10.0.101.0/24"

  private-subnet = "10.0.2.0/24"
}

provider "aws" {
  region = "us-east-1"
}

Using the user data option

If desired, use similar commands in user data to test configuration after build

<<-EOF
          #!/bin/bash 
          yum install httpd -y
          echo "hello world" > /var/www/html/index.html
          yum update -y
          systemctl start httpd
          firewall-cmd --zone=public --permanent --add-service=http
          firewall-cmd --zone=public --permanent --add-service=https
          firewall-cmd --reload
          EOF

About

Module for VPC, IGW, Security group, route table, ec2 resource for learning.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages