Skip to content

Commit ac2d5a6

Browse files
committed
Add terraform version requirement and docs
1 parent ca3681f commit ac2d5a6

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,58 @@
99

1010
#### Introduction
1111

12+
This is a Terraform module for bringing up a fully-formed Zookeeper ensemble. It has the following features:
13+
14+
- Forces an odd number of nodes for quorum.
15+
- Nodes are auto provisioning and auto healing. They will come up and cluster automatically.
16+
- Data and log volumes are separate.
17+
- CPU, memory, network and disk metrics are sent to CloudWatch metrics.
18+
- Zookeeper logs are sent to CloudWatch logs.
19+
20+
#### Usage
21+
22+
```hcl
23+
module "zookeeper" {
24+
source = "github.com/barryw/terraform-aws-zookeeper"
25+
26+
# If empty, no keypair will be assigned to instances
27+
keypair_name = var.keypair
28+
vpc_id = var.vpc_id
29+
# Zookeeper instance subnets. Should be private
30+
zookeeper_subnets = [var.private_subnet1, var.private_subnet2]
31+
# defaults to false
32+
create_bastion = true
33+
bastion_subnet = [var.public_subnet1]
34+
bastion_ingress_cidrs = ["0.0.0.0/0"]
35+
zookeeper_version = "3.7.0"
36+
# Add any custom tags to include on created resources
37+
tags = {}
38+
# Gets added to the beginning of resource names
39+
name_prefix = "my-zookeeper"
40+
# Must be odd
41+
cluster_size = 3
42+
instance_type = "m4.large"
43+
root_volume_size = 32
44+
data_volume_type = "gp2"
45+
data_volume_size = 10
46+
log_volume_type = "gp2"
47+
log_volume_size = 10
48+
# Specify a zone to create records on
49+
route53_zone = ""
50+
# Specify the security group id of the groups to allow connections to ZK. If not specified, use the VPC's CIDR
51+
client_security_group_id = ""
52+
# The namespace to use for CloudWatch metrics
53+
cloudwatch_namespace = "CWAgent"
54+
zookeeper_config = {
55+
clientPort = 2181,
56+
syncLimit = 5,
57+
initLimit = 10,
58+
tickTime = 2000,
59+
zkHeap = 4096
60+
}
61+
}
62+
```
63+
64+
#### License
65+
66+
This module is licensed under the MIT license: https://opensource.org/licenses/MIT

main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
terraform {
2+
required_version = ">=0.13.0"
3+
}
4+
15
locals {
26
prefix = var.name_prefix == "" ? "" : "${var.name_prefix}-"
37
asg_arns = jsonencode([for arn in aws_autoscaling_group.zookeeper.*.arn : arn])

0 commit comments

Comments
 (0)