Terraform module which creates VPC and EC2 resources on AWS.
Supported Resources:
- VPC
- Subnet - Both Public and Private
- Internet Gateway
- Route Table
- Route Table Association
- Security Group
- EC2
Terraform 0.12 and newer. Submit pull requests to the master branch
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"
}
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