Skip to content

Latest commit

 

History

History
95 lines (81 loc) · 8.77 KB

File metadata and controls

95 lines (81 loc) · 8.77 KB

Locust Distributed Loadtest on AWS Terraform Module

This module proposes a simple and uncomplicated way to run your load tests created with Locust on AWS as IaaS.

NOTE: This is a fork of https://github.com/marcosborges/terraform-aws-loadtest-distribuited. Few changes:

  1. Supports only locust - removed support for JMeter, K6 etc
  2. Added support for running multiple locust "workers" in a single worker node (input_locust_replicas_per_node)
  3. Fixed bug to execute custom entrypoint scripts when provided (previously only the default scripts were executed even if custom entrypoint scripts were provided)
  4. Fixed few typos, lints etc

Requirements

Name Version
terraform >= 0.13.1
aws >= 3.63

Providers

Name Version
aws >= 3.63
null n/a
tls n/a

Modules

No modules.

Resources

Name Type
aws_iam_instance_profile.loadtest resource
aws_iam_role.loadtest resource
aws_instance.leader resource
aws_instance.nodes resource
aws_key_pair.loadtest resource
aws_security_group.loadtest resource
null_resource.executor resource
null_resource.key_pair_exporter resource
null_resource.setup_leader resource
null_resource.setup_nodes resource
null_resource.spliter_execute_command resource
tls_private_key.loadtest resource
aws_ami.amazon_linux_2 data source
aws_subnet.current data source
aws_vpc.current data source

Inputs

Name Description Type Default Required
auto_execute Execute Loadtest after leader and nodes available bool true no
auto_setup Install and configure instances Amazon Linux2 with Locust bool true no
executor Executor of the loadtest string "locust" no
leader_ami_id Id of the AMI string "" no
leader_associate_public_ip_address Associate public IP address to the leader bool true no
leader_custom_setup_base64 Custom bash script encoded in base64 to setup the leader string "" no
leader_instance_type Instance type of the cluster leader string "c5n.large" no
leader_monitoring Enable monitoring for the leader bool true no
leader_tags Tags of the cluster leader map {} no
loadtest_dir_destination Path to the destination loadtest directory string "/loadtest" no
loadtest_dir_source Path to the source loadtest directory string n/a yes
loadtest_entrypoint Path to the entrypoint command string "bzt -q -o execution.0.distributed=\"{NODES_IPS}\" *.yml" no
locust_plan_filename Filename locust plan string "" no
locust_replicas_per_node Number of locust replicas per node. You should typically run one worker instance per processor core on the worker machines in order to utilize all their computing power. number 1 no
name Name of the provision string n/a yes
node_custom_entrypoint Path to the entrypoint command string "" no
nodes_ami_id Id of the AMI string "" no
nodes_associate_public_ip_address Associate public IP address to the nodes bool true no
nodes_custom_setup_base64 Custom bash script encoded in base64 to setup the nodes string "" no
nodes_intance_type Instance type of the cluster nodes string "c5n.xlarge" no
nodes_monitoring Enable monitoring for the leader bool true no
nodes_size Total number of nodes in the cluster number 2 no
nodes_tags Tags of the cluster nodes map {} no
region Name of the region string "us-east-1" no
split_data_mass_between_nodes Split data mass between nodes
object({
enable = bool
data_mass_filenames = list(string)
})
{
"data_mass_filenames": [],
"enable": false
}
no
ssh_cidr_ingress_blocks SSH user for the leader list
[
"0.0.0.0/0"
]
no
ssh_export_pem n/a bool false no
ssh_user SSH user for the leader string "ec2-user" no
subnet_id Id of the subnet string n/a yes
tags Common tags map {} no
web_cidr_ingress_blocks web for the leader list
[
"0.0.0.0/0"
]
no

Outputs

Name Description
leader_private_ip The private IP address of the leader server instance.
leader_public_ip The public IP address of the leader server instance.
nodes_private_ip The private IP address of the nodes instances.
nodes_public_ip The public IP address of the nodes instances.