File tree Expand file tree Collapse file tree 3 files changed +51
-4
lines changed Expand file tree Collapse file tree 3 files changed +51
-4
lines changed Original file line number Diff line number Diff line change 2
2
* .tfstate.backup
3
3
* .tfvars
4
4
* .lock.info
5
+ .terraform
Original file line number Diff line number Diff line change 17
17
18
18
## How to use it ?
19
19
20
- Create ` terraform.tfvars ` file with content:
20
+ Clone the repo, go to ` example ` directory, create ` terraform.tfvars ` file with content:
21
21
```
22
22
region = "<REGION-HERE>"
23
23
access_key = "<YOUR-KEY-HERE>"
24
24
secret_key = "<YOUR-SECRET-HERE>"
25
25
ssh_key_name = "<SSH-KEY-NAME>"
26
26
vpc_id = "<VPC-ID>"
27
- subnet_ids = ["<SUBNET-1-ID>", "<SUBNET-2-ID>"]
28
- count = 3
27
+ subnet_ids = ["<SUBNET-ID-1>", "<SUBNET-ID-2>"]
28
+ ssh_security_group_ids = []
29
+ elb_security_group_ids = []
30
+
31
+ rabbitmq_admin_password = "example-password"
32
+ rabbitmq_admin_password = "example-password"
33
+ rabbitmq_secret_cookie = "example-secret-cookie"
34
+ rabbitmq_node_count = 3
29
35
```
30
36
31
- then run ` terraform plan ` and ` terraform apply `
37
+ then run ` terraform get ` , ` terraform plan` and ` terraform apply ` .
32
38
33
39
Are 3 node not enough ? Update ` count ` to ` 5 ` and run ` terraform apply ` again,
34
40
it will update Autoscaling Group and add ` 2 ` nodes more. Dead simple.
Original file line number Diff line number Diff line change
1
+ variable "access_key" {}
2
+ variable "secret_key" {}
3
+ variable "region" {}
4
+
5
+ variable "vpc_id" {}
6
+ variable "ssh_key_name" {}
7
+ variable "subnet_ids" {
8
+ type = " list"
9
+ }
10
+ variable "ssh_security_group_ids" {
11
+ type = " list"
12
+ }
13
+ variable "elb_security_group_ids" {
14
+ type = " list"
15
+ }
16
+
17
+ variable "rabbitmq_admin_password" {}
18
+ variable "rabbitmq_rabbit_password" {}
19
+ variable "rabbitmq_secret_cookie" {}
20
+ variable "rabbitmq_node_count" {}
21
+
22
+ provider "aws" {
23
+ region = " ${ var . region } "
24
+ access_key = " ${ var . access_key } "
25
+ secret_key = " ${ var . secret_key } "
26
+ }
27
+
28
+ module "rabbitmq" {
29
+ source = " github.com/ulamlabs/rabbitmq-cluster"
30
+ region = " ${ var . region } "
31
+ vpc_id = " ${ var . vpc_id } "
32
+ ssh_key_name = " ${ var . ssh_key_name } "
33
+ subnet_ids = " ${ var . subnet_ids } "
34
+ ssh_security_group_ids = " ${ var . ssh_security_group_ids } "
35
+ elb_security_group_ids = " ${ var . elb_security_group_ids } "
36
+ admin_password = " ${ var . rabbitmq_admin_password } "
37
+ rabbit_password = " ${ var . rabbitmq_rabbit_password } "
38
+ rabbitmq_secret_cookie = " ${ var . rabbitmq_secret_cookie } "
39
+ count = " ${ var . rabbitmq_node_count } "
40
+ }
You can’t perform that action at this time.
0 commit comments