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).
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 ;) )
Name | Version |
---|---|
terraform | >= 0.12.24 |
Name | Version |
---|---|
aws | n/a |
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 |
Name | Description |
---|---|
private_subnet_ids | n/a |
public_subnet_ids | n/a |
vpc_id | n/a |
Name | Version |
---|---|
terraform | >= 0.12.24 |
Name | Version |
---|---|
aws | n/a |
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 |
Name | Description |
---|---|
private_ip | List of private IP addresses assigned to the instances |
public_ip | List of public IP assigned to the instances |
Name | Version |
---|---|
terraform | >= 0.12.24 |
Name | Version |
---|---|
aws | n/a |
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 |
{ |
no |
environment | Environment to deploy | string |
n/a | yes |
ingress_ports | Ingress ports for security group | map |
{ |
no |
sg_ref | reference another security group as a source | list(string) |
null |
no |
vpc_id | n/a | string |
n/a | yes |
Name | Description |
---|---|
id | n/a |