Terraform module to provision servers. Provision servers in private and public subnets. Instances are launched by auto scaling groups and an elastic load balancer is provisioned for public instances.
Go to file
flavien bceb41d08d
continuous-integration/drone/push Build is passing Details
Merge pull request 'merge after manual tests' (#1) from beta into main
Reviewed-on: #1
2022-09-28 11:28:50 +02:00
.drone.yml feat(initial release): first version of the module 2022-09-21 14:51:57 +02:00
.gitignore Initial commit 2022-09-21 14:36:06 +02:00
.pre-commit-config.yaml feat(initial release): first version of the module 2022-09-21 14:51:57 +02:00
.releaserc.json feat(initial release): first version of the module 2022-09-21 14:51:57 +02:00
README.md fix(property name): fix type on variables 2022-09-28 11:23:27 +02:00
main.tf feat(inputs addition): add public subnet ids and private subnet ids as inputs 2022-09-28 11:20:16 +02:00
outputs.tf feat(output changed): change output from elb name to elb dns name 2022-09-28 10:58:03 +02:00
variables.tf fix(property name): fix type on variables 2022-09-28 11:23:27 +02:00

README.md

aws_servers terraform module

Terraform module to provision servers.
Provision servers in private and public subnets.
Instances are launched by auto scaling groups and an elastic load balancer is provisioned for public instances.
Instances are tagged with key "Tier" and value "public" or "private".
The IP used during a deployment is authorized to ssh in public instances.
To create the networks use: aws_network_module To alias the elastic load balancer to domain use: aws_elb_alias_module

Requirements

No requirements.

Providers

Name Version
aws n/a
http n/a

Modules

No modules.

Resources

Name Type
aws_autoscaling_group.private resource
aws_autoscaling_group.public resource
aws_elb.public resource
aws_launch_configuration.private resource
aws_launch_configuration.public resource
aws_security_group.private resource
aws_security_group.public resource
aws_instances.private data source
aws_instances.public data source
aws_vpc.selected data source
http_http.myip data source

Inputs

Name Description Type Default Required
env Environment of the deployment string n/a yes
image_id Id of the image to provision string n/a yes
key_name Name of the ssh key pair to provision string n/a yes
private_instances_count Number of private instances to provision number 3 no
private_instances_user_data User data to provision for private instances string n/a yes
private_subnets_ids Ids of the private subnets list(string) n/a yes
public_instances_count Number of public instances to provision number 3 no
public_instances_user_data User data to provision for public instances string n/a yes
public_subnets_ids Ids of the public subnets list(string) n/a yes
tags General tags to apply to all the resources map(string) {} no
vpc_id Id of the VPC on which to deploy string n/a yes

Outputs

Name Description
elb_dns_name Dns name of the public ELB
private_instances_private_ips Private instances ip addresses
public_instances_public_ips Public instances ip addresses