Skip to content

Terraform module to deploy basic VPC with a bastion host and instances

Notifications You must be signed in to change notification settings

ptran32/terraform-aws-minimal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-lint

terraform-aws-minimal

Terraform modules to deploy basic VPC with a bastion host and instances

This repo has a set of modules for deployment of network, instances and a bastion host on AWS. It is only for test purposes, and might not have all requirements for a production setup (e.g network-wise).

usage

1 - Export your AWS access key / secret key as variable

2 - Add your public key in terraform.tfvars file (for SSH connection to instances) In live/dev/aws-minimal-setup repo, replace the placeholder with yout public key: public_key = "PLACE_YOUR_PUBLIC_KEY"

3 - Apply the configuration terraform init terraform apply (check also the plan output here ;) )

Module VPC

Requirements

Name Version
terraform >= 0.12.24

Providers

Name Version
aws n/a

Inputs

Name Description Type Default Required
azs Availability zone where we want to deploy the instance list(string) n/a yes
component component in the infrastructure e.g vpn, app, database string n/a yes
environment Environment to deploy string n/a yes
private_cidr_block CIDR block for private subnets list(string) n/a yes
public_cidr_block CIDR block for publics subnets list(string) n/a yes
vpc_cidr_block CIDR block of the VPC string n/a yes

Outputs

Name Description
private_subnet_ids n/a
public_subnet_ids n/a
vpc_id n/a

Module EC2

Requirements

Name Version
terraform >= 0.12.24

Providers

Name Version
aws n/a

Inputs

Name Description Type Default Required
component component in the infrastructure e.g vpn, app, database string n/a yes
enable_public_ip Associate a public IP to the ec2 instance or not bool false no
environment Environment to deploy string n/a yes
instance_type ec2 instance type to use string "t2.micro" no
num_instances number of EC2 instances to deploy string 1 no
public_key public key to use to connect to ec2 instance string n/a yes
security_group_ids Security group_id(s) to use list(string) n/a yes
subnet_id Subnet ID. Use to deploy instance into it string n/a yes
vpc_id ID of the VPC. Use to deploy VPC into it string n/a yes

Outputs

Name Description
private_ip List of private IP addresses assigned to the instances
public_ip List of public IP assigned to the instances

Module security-group

Requirements

Name Version
terraform >= 0.12.24

Providers

Name Version
aws n/a

Inputs

Name Description Type Default Required
component component in the infrastructure e.g vpn, app, database string n/a yes
egress_ports Egress ports for security group map
{
"22": [
"0.0.0.0/0"
]
}
no
environment Environment to deploy string n/a yes
ingress_ports Ingress ports for security group map
{
"22": [
"0.0.0.0/0"
],
"80": [
"0.0.0.0/0"
]
}
no
sg_ref reference another security group as a source list(string) null no
vpc_id n/a string n/a yes

Outputs

Name Description
id n/a

About

Terraform module to deploy basic VPC with a bastion host and instances

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages