Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Added usage instructions for the yugabyte terraform AWS module.
  • Loading branch information
rkarthik007 authored Feb 13, 2018
1 parent 7cc65ad commit 7e6d0ff
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,78 @@
# terraform-aws-yugabyte
A Terraform module to deploy and run YugaByte on AWS.

## Config

```
module "yugabyte-db-cluster" {
source = "./terraform-aws-yugabyte"
# The name of the cluster to be created.
cluster_name = "tf-test"
# A custom security group to be passed so that we can connect to the nodes.
custom_security_group_id="SECURITY_GROUP_HERE"
# AWS key pair.
ssh_keypair = "SSH_KEYPAIR_HERE"
ssh_key_path = "SSH_KEY_PATH_HERE"
# The vpc and subnet ids where the nodes should be spawned.
vpc_id = "VPC_ID_HERE"
subnet_ids = ["SUBNET_ID_HERE"]
# Replication factor.
replication_factor = "3"
# The number of nodes in the cluster, this cannot be lower than the replication factor.
num_instances = "3"
}
```

**NOTE:** If you do not have a custom security group, you would need to remove the `${var.custom_security_group_id}` variable in `main.tf`, so that the `aws_instance` looks as follows:

```
resource "aws_instance" "yugabyte_nodes" {
count = "${var.num_instances}"
...
vpc_security_group_ids = [
"${aws_security_group.yugabyte.id}",
"${aws_security_group.yugabyte_intra.id}",
"${var.custom_security_group_id}"
]
```

## Usage

Init terraform first if you have not already done so.

```
$ terraform init
```

Now run the following to create the instances and bring up the cluster.

```
$ terraform apply
```

Once the cluster is created, you can go to the URL `http://<node ip or dns name>:7000` to view the UI. You can find the node's ip or dns by running the following:

```
terraform state show aws_instance.yugabyte_nodes[0]
```

You can access the cluster UI by going to any of the following URLs.

You can check the state of the nodes at any point by running the following command.

```
$ terraform show
```

To destroy what we just created, you can run the following command.

```
$ terraform destroy
```

0 comments on commit 7e6d0ff

Please sign in to comment.