-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.tf
44 lines (38 loc) · 1.03 KB
/
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
43
44
terraform {
required_providers {
linode = {
source = "linode/linode"
version = "1.14.3"
}
}
/*
// https://adriano.fyi/post/2020-05-29-how-to-use-linode-object-storage-as-a-terraform-backend/
backend "s3" {
bucket = "test-bucket-jesh"
key = "state.tfstate"
region = "ap-south-1" # e.g. us-east-1
endpoint = "ap-south-1.linodeobjects.com" # e.g. us-est-1.linodeobjects.com
skip_credentials_validation = true # just do it
access_key = ""
secret_key = ""
}
*/
}
provider "linode" {
token = var.api_token
}
module "myapp-server" {
source = "./modules/webserver"
public_key_location = var.public_key_location
root_password = var.root_password
region = var.region
node_count = var.node_count
instance_type = var.instance_type
}
# node balancer configuration
module "myapp-lb" {
source = "./modules/nodebalancer"
region = var.region
node_count = var.node_count
web_server_ips = module.myapp-server.web_servers_ips
}