-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathmain.tf
42 lines (36 loc) · 1008 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Specify the provider and access details
provider "aws" {
access_key = "your_access_key"
secret_key = "your_secret_access_key"
region = "${var.aws_region}"
}
resource "aws_instance" "master" {
ami = "${var.ami}"
instance_type = "${var.instance_type}"
key_name = "${var.key_name}"
user_data = "${file("${var.bootstrap_path}")}"
vpc_security_group_ids = ["${aws_security_group.sgswarm.id}"]
tags {
Name = "master"
}
}
resource "aws_instance" "worker1" {
ami = "${var.ami}"
instance_type = "${var.instance_type}"
key_name = "${var.key_name}"
user_data = "${file("${var.bootstrap_path}")}"
vpc_security_group_ids = ["${aws_security_group.sgswarm.id}"]
tags {
Name = "worker 1"
}
}
resource "aws_instance" "worker2" {
ami = "${var.ami}"
instance_type = "${var.instance_type}"
key_name = "${var.key_name}"
user_data = "${file("${var.bootstrap_path}")}"
vpc_security_group_ids = ["${aws_security_group.sgswarm.id}"]
tags {
Name = "worker 2"
}
}